I am doing a apple pay web implementation. I send the post, but I'm uncertain what is expected for the cert? I'm using php curl requests on the server side.
The closest I got to a real response was when I exported the cert from my mac as .p12, converted it to .pem and uploaded it to the server.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //for production, set value to true or 1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //for production, set value to 2
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_setopt($ch, CURLOPT_SSLCERT, Yii::getAlias('@app') . "\uploads\Certificates.pem");
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "vrajdham@123");
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
$content = curl_exec($ch);
if (FALSE === $content) {
throw new Exception(curl_error($ch), curl_errno($ch));
}
curl_close($ch);
Response
{
"statusMessage": "Error processing request.",
"statusCode": "500"
}
The closest I got to a real response was when I exported the cert from my mac as .p12, converted it to .pem and uploaded it to the server.
$ch = curl_init();
Code Block $validationUrl = "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession";
curl_setopt($ch, CURLOPT_URL, $validationUrl);curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //for production, set value to true or 1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //for production, set value to 2
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_setopt($ch, CURLOPT_SSLCERT, Yii::getAlias('@app') . "\uploads\Certificates.pem");
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, "vrajdham@123");
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
$content = curl_exec($ch);
if (FALSE === $content) {
throw new Exception(curl_error($ch), curl_errno($ch));
}
curl_close($ch);
Response
{
"statusMessage": "Error processing request.",
"statusCode": "500"
}