php - 脑树自动续费有什么方法吗?
问题描述
嗨,我正在使用 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
解决方案
推荐阅读
- r - R 在连字符后的字符串内填充 0
- python - 使用已弃用的 NumPy API 有什么问题吗?
- react-native - React 本机传感器数据检索未安装的组件。警告
- sockets - 附加输出模式下的结构化流水印
- git - Git 说这个目录既存在又不存在
- python - 为什么第一个字母返回-1的索引?
- amazon-web-services - aws_iam_service_linked_role 的 terraform 破坏失败
- python - 如何将默认 python 从 /usr/bin/python 更改为 /usr/local/bin/python?
- git - 推送提交和标记时 AWS Codebuild 未启动
- anylogic - Anylogic:代理不能被强制转换为类