脑树自动续费有什么方法?

问题描述 投票:0回答:1

HI,我正在使用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

php laravel braintree braintree-sandbox
1个回答
0
投票

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

为此,Braintree提供了执行此操作的最佳方法,称为Subscription

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

© www.soinside.com 2019 - 2024. All rights reserved.