[英]Paypal | Can I accept credit card payments using Paypal
I am trying to integrate Paypal REST SDK where user is redirected to Paypal website for payment and returns after success(or failure).我正在尝试集成 Paypal REST SDK,其中用户被重定向到 Paypal 网站进行付款并在成功(或失败)后返回。 The documentation page says(in red box) that "use of PayPal REST is restricted for credit cards"文档页面说(在红框中)“PayPal REST 的使用仅限于信用卡”
On reading online discussions , somewhere it is mentioned that "direct credit cards" can't be accepted.在阅读在线讨论时,某处提到不能接受“直接信用卡”。 Firstly, what is "direct credit card"?首先,什么是“直接信用卡”? Then is it true that normal credit cards can pay via this SDK.那么普通信用卡是否可以通过这个SDK支付呢? Also, does direct credit card holders can pay via normal route too.此外,直接信用卡持有人是否也可以通过正常途径付款。
Note: I can't use Braintree Direct as advised in docs as it is still not available in India注意:我不能按照文档中的建议使用 Braintree Direct,因为它在印度仍然不可用
The solution for the above question is called PayPal Guest Checkout.上述问题的解决方案称为 PayPal Guest Checkout。
Guest Checkout [hosted checkout solution on PayPal servers] is an option for buyers who don't have PayPal Account but can make a Payment using Credit Card which will redirect them to the PayPal website. Guest Checkout [在 PayPal 服务器上托管结帐解决方案] 是为没有 PayPal 帐户但可以使用信用卡付款的买家提供的选项,该信用卡会将他们重定向到 PayPal 网站。
FLOW: Checkout Page -> Checkout with PP(PayPal) -> No PP Account -> Guest Checkout -> Use Credit Card for Payment.流程:结帐页面 -> 使用 PP(PayPal) 结帐 -> 无 PP 帐户 -> 访客结帐 -> 使用信用卡付款。
This is how Guest Checkout looks like.这就是 Guest Checkout 的样子。 Guest Checkout客人结账
Direct Credit Card[DCC]: It is seamless checkout using Credit Card on the website without being redirected to PayPal.直接信用卡[DCC]:在网站上使用信用卡进行无缝结账,无需重定向到 PayPal。
FLOW: Checkout Page -> Select Pay using Credit Card -> Enter Card Details -> Submit流程:结帐页面 -> 选择使用信用卡付款 -> 输入卡详细信息 -> 提交
Here is how the DCC looks like.这是 DCC 的样子。 Direct Credit Card Payment直接信用卡付款
Does this help?这有帮助吗?
from paypalrestsdk import CreditCard
from paypalrestsdk import Payment
def card_payemnt(request):
paypalrestsdk.configure({
"mode": "sandbox", # sandbox or live
'client_id' :"",
'client_secret':"",
})
credit_card = CreditCard({
"type": "visa",
"number": "4024007185826731",
"expire_month": "12",
"expire_year": "2022",
"cvv2": "874",
"first_name": "Joe",
"last_name": "Shopper",
})
if credit_card.create():
print("CreditCard[%s] created successfully" % (credit_card.id ))
return HttpResponse('good')
else:
print("Error while creating CreditCard:")
print(credit_card.error)
def credit_card_payment(request):
paypalrestsdk.configure({
"mode": "sandbox", # sandbox or live
'client_id': "",
'client_secret': "",
})
payment = paypalrestsdk.Payment(
{
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [
{
"credit_card_token": {
"credit_card_id": "CARD-7MH68586JW7132142LXWASJI",
}
}]
},
"transactions": [
{
"amount": {
"total": "6.70",
"currency": "USD"
},
"description": "Payment by vaulted credit card."
}]
}
)
if payment.create():
print(payment.id)
print("Payment created successfully")
else:
print(payment.error)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.