我正在尝试启动Adyen的定期付款,但我无法弄清楚如何做到这一点。我已经尝试发送一个收到付款结果的请求:
$request = array(
'amount.currency' => $this->currency,
'amount.value' => $sepaSubmission->amount,
'merchantAccount' => $this->merchantAccount,
'recurring.contract' => "RECURRING,ONECLICK",
'reference' => $sepaSubmission->psp_reference,
'shopperEmail' => $account->email,
'shopperReference' => $account->email,
"selectedRecurringDetailReference" => "LATEST",
"skinCode" => env('ADYEN_SKIN_CODE'),
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_USERPWD, env('ADYEN_USERNAME') . ":" . env('ADYEN_PASSWORD'));
curl_setopt($ch, CURLOPT_URL, "https://test.adyen.com/hpp/pay.shtml");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST,count($request));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($request));
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);我得到以下错误:错误:皮肤null不存在,我已验证是否包含有效的skinCode。
我使用SepaDirect作为支付方式。
我还尝试附加上述字段到我正在使用的初始付款提交表单,它们基本上被忽略了,付款是作为一次性处理。
任何帮助都将不胜感激,我已经梳理了几天的文件,以使这一点是无效的。
发布于 2017-07-19 16:24:58
您似乎正在尝试重定向到皮肤,以便进行后续的Sepa事务。这是因为您正在调用"https://test.adyen.com/hpp/pay.shtml“。
Sepa直接借记可通过API直接处理,无需将购物者发送到HPP
您可以执行以下操作:
$request = array(
'amount.currency' => $this->currency,
'amount.value' => $sepaSubmission->amount,
'merchantAccount' => $this->merchantAccount,
'recurring.contract' => "RECURRING",
'reference' => $sepaSubmission->psp_reference,
'shopperEmail' => $account->email,
'shopperReference' => $account->email,
"selectedRecurringDetailReference" => "LATEST",
"shopperInteraction" : "ContAuth",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_USERPWD, env('ADYEN_USERNAME') . ":" . env('ADYEN_PASSWORD'));
curl_setopt($ch, CURLOPT_URL, "https://pal-test.adyen.com/pal/servlet/Payment/v25/authorise");
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_POST,count($request));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($request));
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true); 请注意URL的变化,去掉了皮肤代码,增加了"shopperInteraction“:"ContAuth",去掉了recurring.contract的=> "RECURRING”中的一次点击。
因此,当您想再次向购物者收费时,您只需在您的端进行此呼叫,而不需要将他送到HPP。
希望这能帮上忙
干杯,安德鲁
https://stackoverflow.com/questions/45173314
复制相似问题