PayPal 客户端身份验证失败 [英] PayPal Client Authentication Failed

查看:190
本文介绍了PayPal 客户端身份验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我从沙盒模式切换到真实交易后,我收到了客户端身份验证失败的错误.

Since I switched from the sandbox mode to the real deal I get a client authentication failed error.

配置:

{
  "port": 5000,
  "api": {
    "host": "api.paypal.com/v1/",
    "port": "",
    "client_id": "-",
    "client_secret": "-"
  }
}

我已经仔细检查了我的客户端 ID 和密码,它们已启用并且不适用于沙盒模式.

I've double checked my client id and secret, they are enabled and aren't for the sandbox mode.

代码:

   paypalService.getPaypalMethodOption(req.body.paymentMethodOptionId).then(function (paymentMethodOption) {
    var invoiceId = uuid.v4();
    var payment = {
        "intent": "sale",
        "payer": {
            "payment_method": "paypal"
        },
        "transactions": [{
                "amount": {
                    "currency": 'USD',
                    "total": paymentMethodOption.Price
                },
                "description": paymentMethodOption.Description,
                "invoice_number": invoiceId
            }]
    };

    payment.payer.payment_method = 'paypal';
    payment.redirect_urls = {
        "return_url": "http://localhost:3000/paypal/execute",
        "cancel_url": "http://localhost:3000/donate/cancelled"
    };
    paypal.payment.create(payment, function (error, payment) {
        // error
    });
}); 

可能是什么问题?

推荐答案

搜索了几个小时后,我发现我需要另一个属性.显然,您需要添加值为live"的属性模式.这部分的文档不是很清楚,node sdk github存储库中也没有任何实时示例代码.

After searching for a few hours i found out that i needed another property. Apparently you need to add the property mode with the value "live". The documentation isn't very clear on this part, neither are there any live example codes in the node sdk github repository.

我的配置现在如下所示:

My config now looks like the following:

{
    "port": 5000,
    "api": {
        "mode": "live",
        "host": "api.paypal.com",
        "port": "",
        "client_id": "-",
        "client_secret": "-"
    }
}

这篇关于PayPal 客户端身份验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆