简体   繁体   English

为什么 PayPal REST api 通过信用卡选项在桌面上显示,而不是在移动设备上显示?

[英]Why is PayPal REST api pay by credit card option showing on desktop, not showing on mobile?

After a lot of digging around I have finally managed to get something working with the PayPal REST API, the documentation is awfully confusing.经过大量的挖掘,我终于设法让一些东西与 PayPal REST API 一起工作,文档非常混乱。

I'm creating a C#/MAUI mobile app where I need to take payments.我正在创建一个 C#/MAUI 移动应用程序,我需要在其中付款。

Anyway, I managed to get the PayPal API it to create this URL, below (I can simulate the same thing using Postman)无论如何,我设法获得了 PayPal API 来创建这个 URL,如下所示(我可以使用 Postman 模拟同样的事情)

https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXXXXX

  1. Get an access token (access_token) using the REST API使用 REST API 获取访问令牌 (access_token)

  2. POST to https://api-m.sandbox.paypal.com/v2/checkout/orders/ this payload发布到https://api-m.sandbox.paypal.com/v2/checkout/orders/这个负载

     { "intent": "CAPTURE", "purchase_units": [ { "reference_id": "d9f80740-38f0-11e8-b467-0ed5f89f718b", "amount": { "currency_code": "USD", "value": "100.00" } } ] }

The returned payload gives me this json.返回的有效负载给了我这个 json。 There are other kinks in the returned payload but this is the one I need.返回的有效负载中还有其他问题,但这是我需要的。

    {
        "href": "https://www.sandbox.paypal.com/checkoutnow?token=XXXXXXXXXX",
        "rel": "approve",
        "method": "GET"
    }

Using that URL, on a desktop PC browser I get the option to log-in or "pay by debit or credit-card" but on mobile browser I only get the option to create an account or log-in to an existing account, using that exact same URL.使用该 URL,在桌面 PC 浏览器上,我可以选择登录或“通过借记卡或信用卡付款”,但在移动浏览器上,我只能选择创建帐户或登录现有帐户,使用那个完全相同的网址。

Does, anybody know whats going on here?有人知道这里发生了什么吗? How do I get the same options in a mobile browser.如何在移动浏览器中获得相同的选项。 I can't find anything in the documentation that explains this behaviour.我在解释此行为的文档中找不到任何内容。

Guest availability in the paypal.com checkout depends on very many factors, including the IP address and geographic location of the buyer, the amount of the transaction, the device used, and any number of other things. paypal.com 结帐时的访客可用性取决于很多因素,包括买家的 IP 地址和地理位置、交易金额、使用的设备以及许多其他因素。 Other than disabling guest as a possibility in your account options, you cannot control this behavior of the PayPal page.除了在您的帐户选项中禁用来宾之外,您无法控制 PayPal 页面的这种行为。


A 'Debit or Credit Card' button on your own page can be added using the JS SDK for approval, rather than redirecting away.可以使用 JS SDK 在您自己的页面上添加“借记卡或信用卡”按钮以获得批准,而不是重定向。 Here is a demo , which would fetch the created order id/token from your server. 这是一个演示,它将从您的服务器获取创建的订单 ID/令牌。

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

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