Php 重复付款不使用braintree中的PayPal按钮

Php 重复付款不使用braintree中的PayPal按钮,php,paypal,recurring-billing,braintree,Php,Paypal,Recurring Billing,Braintree,我在HTML表单中使用PayPal按钮。所有这些都可以正常工作,比如PayPal请求身份验证并立即以HTML形式注入支付方法 但是,当我使用此付款方法创建订阅时,其“给我”错误为:- 消息:-支付方法令牌无效 代码:-91903 我正在使用PHP库,下面是我的代码片段:- $subscription = Braintree_Subscription::create(array( 'paymentMethodToken' => payment_method_nonce that Pa

我在HTML表单中使用PayPal按钮。所有这些都可以正常工作,比如PayPal请求身份验证并立即以HTML形式注入支付方法

但是,当我使用此付款方法创建订阅时,其“给我”错误为:- 消息:-支付方法令牌无效 代码:-91903

我正在使用PHP库,下面是我的代码片段:-

$subscription = Braintree_Subscription::create(array(
    'paymentMethodToken' => payment_method_nonce that PayPal button inject in my form,
    'planId' => planId that created in Braintree,   
));
或者如果我使用销售方法,使用相同的付款方法,如下所示:-

$subscription = Braintree_Transaction::sale(array(
    'amount' => $amount,
    'paymentMethodToken' => payment_method_nonce that PayPal button inject in my form
));
比它的作品好

请告诉我这有什么问题?

我在Braintree工作。如果你需要更多的帮助,你可以随时联系

在使用付款方式之前,需要先对其进行调整

对于不指向保险存储支付方法的nonce,您可以使用它创建一个,然后使用它创建订阅。(我们将更新文档以使其更加清晰。)


hell@afg我也使用了您上面的代码,它与我的本地主机工作正常,但当我在服务器中执行相同的代码时,没有返回任何成功响应。当我检查我的braintree帐户交易是否成功完成时,问题是什么?请help@AmitKumarSahu抱歉,这些信息确实不足以帮助您解决问题。拜托,这帮我节省了很多时间。注意-3年后,文档尚未更新!:P
$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',
));