// sets transaction-amounts details (all amounts are in cents) $transactionAmount = new TransactionAmount($paymentAmount); $transactionAmount->setTotalAmount($totalAmount); $transactionAmount->setServiceFeeAmount($serviceFeeAmount); //$transactionAmount->setPaymentAmount((float) $paymentAmount); $transactionAmount->setCurrency($currency); $initRequest->setTransactionAmount($transactionAmount); // sets redirect settings $redirect = new Redirect($returnUrl); // $redirect->setReturnUrl($returnUrl); $redirect->setReturnMethod($returnMethod); $initRequest->setRedirect($redirect); /* ------------------------------------------------------------------------------ STEP4: Process PaymentInitRequest object ------------------------------------------------------------------------------ */ $initResponse = $client->getPayment()->init($initRequest); } ?> <div class="col-lg-12 "> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Paycorp PayCentreWeb Client (v4) </a> </div>
$clientConfig->setHmacSecret("Test1234"); $clientConfig->setValidateOnly(FALSE); /* ------------------------------------------------------------------------------ STEP2: Build PaycorpClient object ------------------------------------------------------------------------------ */ $client = new GatewayClient($clientConfig); /* ------------------------------------------------------------------------------ STEP3: Build PaymentCompleteRequest object ------------------------------------------------------------------------------ */ $completeRequest = new PaymentCompleteRequest(); //$completeRequest->setClientId(123); $completeRequest->setReqid($_GET['reqid']); /* ------------------------------------------------------------------------------ STEP4: Process PaymentCompleteRequest object ------------------------------------------------------------------------------ */ $completeResponse = $client->getPayment()->complete($completeRequest); $creditCard = $completeResponse->getCreditCard(); $transactionAmount = $completeResponse->getTransactionAmount(); ?> <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">Paycorp PayCentreWeb Client (v4) </a> </div> <div id="navbar" class="navbar-collapse collapse">
$creditCard->setExpiry($expiryDate); $creditCard->setNumber($cardNo); $creditCard->setSecureId($secureId); $creditCard->setSecureIdSupplied(TRUE); $realTimeRequest->setCreditCard($creditCard); // sets transaction-amounts details (all amounts are in cents) $transactionAmount = new TransactionAmount($paymentAmount); $transactionAmount->setTotalAmount(); //$transactionAmount->setPaymentAmount($paymentAmount); $transactionAmount->setServiceFeeAmount(); $transactionAmount->setCurrency($currency); $realTimeRequest->setTransactionAmount($transactionAmount); /* ------------------------------------------------------------------------------ STEP4: Process PaycorpRealTimeRequest object ------------------------------------------------------------------------------ */ $realTimeResponse = $client->getPayment()->realTime($realTimeRequest); } ?> <html> <head> <meta charset="UTF-8"> <title>RealTime Payments -demo</title> <link rel="stylesheet" href="css/bootstrap.css" media="screen"> <link rel="stylesheet" href="css/bootswatch.min.css"> <link rel="stylesheet" href="css/jsonprettyprint.css"> <script src="js/jquery-1.10.2.min.js"></script> </head> <body>