简体   繁体   English

Paypal Rest API使用模拟帐户,但不能使用真实帐户

[英]Paypal Rest API Working with Demo Account but not with Live Account

I use below code for Paypal Rest API to Store Credit Card Information 我将以下代码用于Paypal Rest API来存储信用卡信息

            String AccessToken = "";
            PaypalAccessToken pat = new PaypalAccessToken();
            AccessToken = pat.GetPaypalAccessToken();
            PayPal.Api.Payments.Address add = new PayPal.Api.Payments.Address();
            add.city = TextBoxCity.Text;
            add.line1 = TextBoxAddress.Text;
            add.phone = TextBoxPhoneNumber.Text;
            add.postal_code = TextBoxZipcode.Text;
            add.state = DropDownState.SelectedValue;
            PayPal.Api.Payments.CreditCard cc = new PayPal.Api.Payments.CreditCard();
            cc.number = TextBoxCreditCardNumber.Text;
            cc.expire_month = Convert.ToInt16(TextBoxExpiryMonth.Text);
            cc.expire_year = Convert.ToInt16(TextBoxExpiryYear.Text);
            cc.cvv2 = TextBoxCVVNumber.Text;
            cc.type = DropDownCreditCardType.SelectedValue;
            //cc.billing_address = add;

           PayPal.Api.Payments.CreditCard ResultCC = cc.Create(AccessToken);

This Code working good with Demo Credentials but When I try to use same with Live Credentials, It is giving me error : 401 Unauthorized. 此代码可与演示凭证一起很好地工作,但是当我尝试将其与实时凭证一起使用时,它给我错误:401未经授权。 I can still get token in live credentials but I could not store credit card. 我仍然可以在实时凭据中获得令牌,但是我无法存储信用卡。

PayPal's REST API's are available globally as of the 31st of July 2013. PayPal的REST API自2013年7月31日起在全球范围内可用。
However, this applies only to PayPal payments. 但是,这仅适用于PayPal付款。 That is, setting the payment_method to paypal in the JSON payload and redirecting the buyer to PayPal. 也就是说,在JSON有效负载中将payment_method设置为paypal ,并将购买者重定向到PayPal。

If you want to process credit card payments, this is currently only supported in the US, UK or Canada. 如果您要处理信用卡付款,目前仅在美国,英国或加拿大支持。
You will need to enable this capability for your app via https://developer.paypal.com/ > Applications. 您需要通过https://developer.paypal.com/ >应用程序为您的应用程序启用此功能。
Note: Enabling card payments for live transactions requires a review of your account. 注意:为即时交易启用卡付款需要查看您的帐户。

If you try to process card payments in live, with an account that's not enabled for it, you will get a HTTP 401 in the response from the /payment resource. 如果您尝试使用未启用帐户的方式实时处理卡付款,则/payment资源的响应中将显示HTTP 401。

您是否已更新端点以使用实时端点?

It was something wrong with Paypal Rest ApI because its still in Beta version . Paypal Rest ApI有点问题,因为它仍处于Beta版本。 They fixed it for me. 他们为我修复了它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM