我想使用Django服务器将我的Android Studio应用程序与PayPal Restapi集成

发布于 2025-01-23 08:15:08 字数 74 浏览 1 评论 0原文

我想使用REST-API将我的应用程序与PayPal集成。我是在服务器端使用Django。我需要服务器端实现代码来集成我的应用程序吗?

i want to integrate my app with paypal using Rest-API .I am using django on server-side .i need server-side implementation code to integrate my app?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意中人 2025-01-30 08:15:08

关注 paypal结帐集成集成一个用于“创建订单”,另一个用于“捕获顺序”。您可以使用 Checkout-python-sdk 用于路由的API呼叫,或您自己的HTTPS实施,首先获得访问令牌然后进行呼叫。这两种路线都应仅返回JSON数据(无HTML或文本)。在第二路线内,当捕获API成功时,您应该验证金额正确,并将其由此产生的付款详细信息存储在您的数据库中(尤其是paskuy_units [0] .payments.payments.captures.captures [0] .id,这是PayPal交易ID)并执行任何必要的业务逻辑(例如发送确认电子邮件或保留产品),然后再转发您的返回JSON。如果错误向前转发JSON的详细信息,因为前端应处理此类情况。

将这两个路线与本地结帐sdk

Follow the PayPal Checkout integration guide and make 2 django routes on your server, one for 'Create Order' and one for 'Capture Order'. You can use the Checkout-Python-SDK for the routes' API calls to PayPal, or your own HTTPS implementation of first getting an access token and then doing the call. Both of these routes should return only JSON data (no HTML or text). Inside the 2nd route, when the capture API is successful you should verify the amount was correct and store its resulting payment details in your database (particularly purchase_units[0].payments.captures[0].id, which is the PayPal transaction ID) and perform any necessary business logic (such as sending confirmation emails or reserving product) immediately before forwarding your return JSON. In the event of an error forward the JSON details of it as well, since the frontend should handle such cases.

Pair those 2 routes with the Native Checkout SDK on the Android side.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文