Payment Integration
-
Hi Team ,
I currently have a project where i need to integrate with a local payment processor “interpay” in Ghana “Africa”. will need help to integrate the php code sample below with any form in wordpress for applicants to make payment.
<?php $url='https://test.interpayafrica.com/interapi/ProcessPayment'; //GetValues From Another Page on this Processing Page //1. Name $_POST["Name"] //2. Email $_POST["Email"] //3. Mobile $_POST["Mobile"] //4. Currency Type $_POST["CurrencyType"] //5. Amount $_POST["Amount"] //6. OrderId $_POST["OrderId"] //7. OrderDesc $_POST["OrderDesc"] $app_id="2452015009"; $app_key="test"; $name="Yasir"; $email="Test@Test"; $mobile="0122545"; $currency="GHS"; $amount=10; $order_id="1212012454"; $order_desc="test"; //////////////////// AppID //// AppKey //////////////////////// $signature=$app_id.$app_key.$order_id.$amount.$currency; //Concatinate String to make encrypted signature //$HashValuemd5=md5($ConvertableString); //Md5 Signature Method $signature = sha1($signature); $base64= base64_encode(pack("H*",$signature)); $data=(array( "app_id" => $app_id, "app_key" =>$app_key, "name"=>$name, "email"=>$email, "mobile"=>$mobile, "currency"=>$currency, "amount"=>$amount, "order_id"=>$order_id, "order_desc"=>$order_desc, "signature"=>$base64, // "signature"=>$HashValue )); $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result=file_get_contents($url, false, $context); $ParseJson=json_decode($result, TRUE); //Parse The Json Response header("LOCATION: https://test.interpayafrica.com/interapi/confirmpayment?Token=".urlencode($ParseJson['Token'])."&"); ?>
Brgds
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Payment Integration’ is closed to new replies.