【问题标题】:Recurring payment not working with PayPal button in braintreeBraintree 中的 PayPal 按钮无法使用定期付款
【发布时间】:2014-11-08 14:21:16
【问题描述】:

我在我的 HTML 表单中使用了 PayPal 按钮。一切正常,例如 PayPal 要求身份验证并以 HTML 形式注入 payment_method_nonce。

但是,当我使用此 payment_method_nonce 创建订阅时,它会给我以下错误:- 消息:- 付款方式令牌无效 代码:- 91903

我正在使用 PHP 库,这是我的代码 sn-p:-

$subscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => payment_method_nonce that PayPal button inject in my form,
    'planId' => planId that created in Braintree,   
));

或者如果我使用使用相同的 payment_method_nonce 的销售方法,如下所示:-

$subscription = Braintree_Transaction::sale(array(
    'amount' => $amount,
    'paymentMethodToken' => payment_method_nonce that PayPal button inject in my form
));

比它的工作正常。

请告诉我这是什么问题?

【问题讨论】:

    标签: php paypal recurring-billing braintree


    【解决方案1】:

    我在布伦特里工作。如果您需要更多帮助,可以随时联系our support team

    付款方式需要vaulted才能使用create a subscription

    如果 nonce 不指向受保管的付款方式,您可以使用它来创建一个,然后使用它来创建订阅。 (我们将更新文档以使其更加清晰。)

    $result = Braintree_Customer::create(array(
        'paymentMethodNonce' => $payment_method_nonce,
    ));
    
    $token = $result->customer->paypalAccounts[0]->token;
    
    $result = Braintree_Subscription::create(array(
      'paymentMethodToken' => $token,
      'planId' => 'planId that created in Braintree',
    ));
    

    【讨论】:

    • hell @afg 我也使用了上面的代码,它在我的本地主机上运行良好,但是当我在服务器中执行相同的代码时没有返回任何成功响应。当我检查我的braintree帐户交易成功完成时,有什么问题?请帮忙
    • @AmitKumarSahu 抱歉,这些信息确实不足以帮助您解决问题。请get in touch with our support team.
    • 这为我节省了很多时间。注意 - 3 年后,文档尚未更新! :P
    猜你喜欢
    • 2020-07-01
    • 2017-07-12
    • 2014-03-01
    • 2020-01-03
    • 2019-03-15
    • 2016-04-01
    • 1970-01-01
    • 2011-08-23
    • 2015-11-07
    相关资源
    最近更新 更多