Skip to content

Instantly share code, notes, and snippets.

@didagu
Created February 2, 2017 09:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save didagu/7f83faa0b0013228a155f658e13f974a to your computer and use it in GitHub Desktop.
Save didagu/7f83faa0b0013228a155f658e13f974a to your computer and use it in GitHub Desktop.
$url="https://checkout.simplepay.ng/v2/payments/form/";
$fields=array('key'=>'test_pu_18fb91d02d7c4be5a386309c882bd176',
'description'=>'holla i am here',
'payment_type'=>'checkout' ,
'amount' => $subtotal,
'email' => $email,
'currency'=>'NGN',
'payment_id'=>'XVTID',
'success_url'=>'http://localhost/tender/tender/epayments/confirmation',
'cancel_url'=>'http://localhost/tender/tender/epayments/confirmation',
'fail_url' => 'http://localhost/tender/tender/epayments/confirmation'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
if (curl_errno($ch)){
debug(curl_error($ch));
}else{
curl_close($ch);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment