我想使用Django服务器将我的Android Studio应用程序与PayPal Restapi集成
我想使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关注 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.