1
votes

We Need to Help For issue in Sandbox Payment Process of my Beta Site.

When i go to create payment after completion of checkout process i sent request to Preapproval url : https://svcs.paypal.com/AdaptivePayments/Pay then it is give me Error Message: "File opening failed = fopen(https://svcs.sandbox.paypal.com/AdaptivePayments/Pay): failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request". i use Adaptive Payment process.

it is working proper in live site but not in beta so We need to change in settings of our paypal account or any other way to solve it please give us solution about it.

1
i have not ssl in my beta site but in live site ssl availableYagnesh
i have also clear cookie and try but it is not working for meYagnesh

1 Answers

2
votes

we found the same issue. The way we where able to fix it was migrating the code from fopen to curl.

the code we use to fix it is:

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $body_data);
$headers = array(
    "X-PAYPAL-SECURITY-USERID: " . $API_UserName,
    "X-PAYPAL-SECURITY-SIGNATURE: " . $API_Signature,
    "X-PAYPAL-SECURITY-PASSWORD: " . $API_Password,
    "X-PAYPAL-APPLICATION-ID: " . $API_AppID,
    "X-PAYPAL-REQUEST-DATA-FORMAT: " . $API_RequestFormat,
    "X-PAYPAL-RESPONSE-DATA-FORMAT: " . $API_ResponseFormat );
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);

Hope it will help you.