1

I am implementing an assembly payment API for making payments using PHP. Everything is working well in a sandbox environment. But in production, it is giving an error message.

Credit card payment failed: Unable to process the purchase transaction. (2)

Code that I have implemented for making payment is:

$rest = curl_init();
curl_setopt($rest,CURLOPT_URL,$url);
curl_setopt($rest,CURLOPT_HTTPGET,1);
curl_setopt($rest,CURLOPT_CUSTOMREQUEST,"PATCH");
curl_setopt($rest,CURLOPT_POSTFIELDS,$accountdata);
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($rest);
$data = Zend_Json::decode($response);
return $data;

Where $url = https://secure.api.promisepay.com/items/wc5xxq6k-gkx0-jx5x-l1gm-xxxxxxx/make_payment

Jaskaran Singh
  • 2,392
  • 24
  • 39
  • Does `curl_setopt($rest,CURLOPT_SSL_VERIFYHOST, false);` make any difference? Also have a look at [this](https://stackoverflow.com/a/12293898/4964822) though to mention CA certs. – nice_dev Dec 23 '19 at 09:45

0 Answers0