0

我正在尝试在 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);

我收到以下错误:错误:Skin null 不存在我已验证包含有效的 skinCode。

我使用 SepaDirect 作为付款方式。

我也刚刚尝试将上述字段附加到我正在使用的初始付款提交表单中,但它们基本上被忽略了,付款被一次性处理。

任何帮助将不胜感激,我几天来一直在梳理文件以使这无济于事。

4

1 回答 1

2

您似乎正在尝试重定向到皮肤以进行后续 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 的变化,去掉了 skincode 和增加了 "shopperInteraction" : "ContAuth",去掉了 recurring.contract' => "RECURRING" 中的一键点击,

因此,当您想再次向购物者收费时,您只需从您端打这个电话,无需将他发送到 HPP。

希望这可以帮助,

干杯,安德鲁

于 2017-07-19T08:24:57.723 回答