姜戈与贝宝集成
我正在用 Python(使用 Django)设计一个网站,我需要通过它来销售东西。
有人可以帮助我使用源代码来集成 paypal-pro(直接付款)或 paypal-standard(快速结账)吗?
I am designing a website in Python (using Django), and I need to sell things through it.
Can somebody help me with the source code to integrate the paypal-pro (do-direct payment) or else paypal-standard (express checkout)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可能想尝试 django-paypal,甚至还有一个 教程就在首页上。
You might want to try django-paypal, there's even a tutorial right there on the front page.
paypal.standard.ipn
PayPal API 生成一个按钮,该按钮将通过
paypal.standard.ipn
。对于 API 集成,您必须遵循以下给定步骤:
安装
django-paypal
:更新 settings.py 文件:
写入接收者的电子邮件地址。
PAYPAL_TEST = True
表示您想要测试 API 付款。原始支付API可以写“False”。运行命令:
在urls.py中:
在views.py中:
按照参考中给出的 django 代码视频教程进行操作。
在 payment_process.html 中:
要调用 API,您需要请求
/ payment_process/.它将在 HTML 上生成一个按钮,调用 PayPal API 进行交易。进一步的处理将在 PayPal 端、登录或卡支付上完成。
paypal.standard.ipn
PayPal API Generates a Button which will call its API through
paypal.standard.ipn
.For API Integration you have to follow below given steps:
Install
django-paypal
:Update settings.py file:
Write Email address of Receiver.
PAYPAL_TEST = True
means you want a Test API payment. You can write "False" for Original payment API.Run command:
In urls.py:
In views.py:
Follow video tutorial for django-code given in reference.
In payment_process.html:
For calling API you have request for
/payment_process/
. It will generate a button on HTML which calls PayPal API for transaction. Further process will be done on PayPal end, Login or Card Payment.您查看过 pypaypal 吗?您可以创建一个连接到 PayPal 的视图并提交您的付款命令。
Did you look at pypaypal? You could create a view that connects to PayPal and submit your payment commands.
更好的是使用所有者的“本机”文档:docs paypal
Better will be to use "native" docs from owner: docs paypal
此教程指导如何接受Paypal 应用程序通过沙箱
ClientId
进行支付SecretKey
无需任何第三方库。您还可以将付款跟踪 ID 作为
purchase_units
列表的字典对象中的custom_id
发送到create_order.request_body
函数。如下图:
This tutorial guides how to accept Paypal apps payment via sandbox
ClientId
&SecretKey
without any third party library.You can also send payment tracking id as
custom_id
inpurchase_units
list's dictionary object tocreate_order.request_body
function.As shown below: