Would anyone have any ideas on how to create a merchant session key for Opayo, using Wordpress, for use with their drop in checkout.
Struggling with the online instructions:
https://developer.elavon.com/products/o ... n-checkout
Working with the code below:
Код: Выделить всё
$key = base64_encode('opayo_integration_key');
$password = base64_encode('opayo_integration_password');
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://pi-test.sagepay.com/api/v1/merchant-session-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{ "vendorName": "MY VENDOR" }',
CURLOPT_HTTPHEADER => array(
"Authorization: Basic $key:$password",
"Cache-Control: no-cache",
"Content-Type: application/json"
)
));
$response = curl_exec($curl);
$response = json_decode($response, true);
$err = curl_error($curl);
curl_close($curl);
Источник: https://stackoverflow.com/questions/781 ... n-checkout