这是我的代码:
def test(request):
paypalrestsdk.configure({
"mode": "security-test-sandbox",
"client_id": "XXXXXXX-XXXX-XXXX-XXXX",
"client_secret": "XXXXXXX-XXXX-XXXX-XXXX" })
payment = paypalrestsdk.Payment({
"intent": "sale",
"payer": {
"payment_method": "credit_card",
"funding_instruments": [{
"credit_card": {
"type": "visa",
"number": "4417119669820331",
"expire_month": "11",
"expire_year": "2018",
"cvv2": "874",
"first_name": "Joe",
"last_name": "Shopper" }}]},
"transactions": [{
"item_list": {
"items": [{
"name": "item",
"sku": "item",
"price": "1.00",
"currency": "USD",
"quantity": 1 }]},
"amount": {
"total": "1.00",
"currency": "USD" },
"description": "This is the payment transaction description." }]})
if payment.create():
print("Payment created successfully")
else:
print(payment.error)
return render(request, "test.html")
执行命令payment.create()
时,错误为:
[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:590)
我正在使用Mac。