首页 > 解决方案 > 脑树自动续费有什么方法吗?

问题描述

嗨,我正在使用 Braintree(braintree/braintree_php": "4.5.0) 。我已经在网络上实现了 3dsecure。它工作正常。我需要使用 paymentMethodToken 自动更新付款。下面的代码我用于自动更新。

$trans = [
            'amount' => "14.63",
            'merchantAccountId' => "Vo**ID",
            'paymentMethodToken' =>"token",
            'transactionSource' => "recurring",
            'customFields' => [
                'client_id' => "id",
                'service_id' => "id",
                'invoice_id' => "id",
                'action' => "autorenew",
                'slots' => "15",
            ],
            'options' => [
                'submitForSettlement' => true,
                'storeInVaultOnSuccess' => true,
                'paypal' => [
                    'description' =>"Renew server",
                ]
            ]
        ];
 $transaction = $gateway->transaction()->sale($trans);

运行此代码时,我得到以下错误

Util.php 第 59 行中的授权:

当用户输入信用卡信息进行支付时,上面的代码正在工作。这只会在我使用 paymentMethodToken 进行支付以自动更新付款时给出错误。有帮助吗?

参考:https ://developers.braintreepayments.com/guides/paypal/server-side/php

标签: phplaravelbraintreebraintree-sandbox

解决方案


据我了解您的要求。您需要进行自动付款。

为此,Braintree 提供了最好的方法,称为Subscription

让我知道,如果您需要更多帮助。


推荐阅读