【问题标题】:Recurring payment in Adyen在 Adyen 定期付款
【发布时间】:2017-12-23 16:58:29
【问题描述】:

我正在尝试在 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 作为付款方式。

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

任何帮助都将不胜感激,我已经梳理了几天的文件以使这无济于事。

【问题讨论】:

    标签: php adyen


    【解决方案1】:

    您似乎正在尝试重定向到皮肤以进行后续 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-10-01
      • 2020-01-03
      • 1970-01-01
      • 2010-10-31
      • 2017-03-25
      • 2011-09-16
      • 2012-07-01
      • 2016-02-25
      • 2011-11-28
      相关资源
      最近更新 更多