165 lines
9.6 KiB
Plaintext
165 lines
9.6 KiB
Plaintext
![]() |
2024-09-21 14:02:29,146 - API日志 - INFO - [支付执行] 获取的访问令牌: A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ
|
|||
|
2024-09-21 14:02:50,451 - API日志 - INFO - [支付执行] 接收到来自前端的 POST 请求,开始处理支付...
|
|||
|
2024-09-21 14:02:50,452 - API日志 - INFO - [支付执行] 请求内容: paymentId=PAYID-M3XGC5I9U46968696522382D, PayerID=8RSF8T3UK8NT2
|
|||
|
2024-09-21 14:02:50,454 - API日志 - INFO - [支付执行] 获取到的订单信息: Order PAYID-M3XGC5I9U46968696522382D - pending
|
|||
|
2024-09-21 14:02:50,527 - API日志 - INFO - [支付执行] 获取的访问令牌: A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ
|
|||
|
2024-09-21 14:02:50,527 - API日志 - INFO - [支付执行] 获取到的 PayPal 访问令牌: A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ
|
|||
|
2024-09-21 14:02:50,528 - API日志 - INFO - [支付执行] 发送支付请求,URL: https://api.sandbox.paypal.com/v1/payments/payment/PAYID-M3XGC5I9U46968696522382D/execute, 请求头: {'Content-Type': 'application/json', 'Authorization': 'Bearer A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ'}, 请求体: {'payer_id': '8RSF8T3UK8NT2'}
|
|||
|
2024-09-21 14:02:51,294 - API日志 - INFO - [支付执行] PayPal API 响应状态码: 200
|
|||
|
2024-09-21 14:02:51,295 - API日志 - INFO - [支付执行] PayPal API 响应内容: {'id': 'PAYID-M3XGC5I9U46968696522382D', 'intent': 'sale', 'state': 'approved', 'cart': '2Y943631F86154047', 'payer': {'payment_method': 'paypal', 'status': 'VERIFIED', 'payer_info': {'email': 'sb-pztpq32086919@personal.example.com', 'first_name': 'John', 'last_name': 'Doe', 'payer_id': '8RSF8T3UK8NT2', 'shipping_address': {'recipient_name': 'Doe John', 'line1': 'NO 1 Nan Jin Road', 'city': 'Shanghai', 'state': 'Shanghai', 'postal_code': '200000', 'country_code': 'C2'}, 'country_code': 'C2'}}, 'transactions': [{'amount': {'total': '1.00', 'currency': 'USD', 'details': {'subtotal': '1.00', 'shipping': '0.00', 'insurance': '0.00', 'handling_fee': '0.00', 'shipping_discount': '0.00', 'discount': '0.00'}}, 'payee': {'merchant_id': 'AQJTM59Z4T3EG', 'email': 'sb-05ob032098751@business.example.com'}, 'description': '购买 Hobby 计划', 'item_list': {'items': [{'name': 'Hobby', 'sku': '1', 'price': '1.00', 'currency': 'USD', 'tax': '0.00', 'quantity': 1, 'image_url': ''}], 'shipping_address': {'recipient_name': 'Doe John', 'line1': 'NO 1 Nan Jin Road', 'city': 'Shanghai', 'state': 'Shanghai', 'postal_code': '200000', 'country_code': 'C2'}}, 'related_resources': [{'sale': {'id': '40C15537SF235414R', 'state': 'completed', 'amount': {'total': '1.00', 'currency': 'USD', 'details': {'subtotal': '1.00', 'shipping': '0.00', 'insurance': '0.00', 'handling_fee': '0.00', 'shipping_discount': '0.00', 'discount': '0.00'}}, 'payment_mode': 'INSTANT_TRANSFER', 'protection_eligibility': 'ELIGIBLE', 'protection_eligibility_type': 'ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE', 'transaction_fee': {'value': '0.33', 'currency': 'USD'}, 'parent_payment': 'PAYID-M3XGC5I9U46968696522382D', 'create_time': '2024-09-21T06:02:50Z', 'update_time': '2024-09-21T06:02:50Z', 'links': [{'href': 'https://api.sandbox.paypal.com/v1/payments/sale/40C15537SF235414R', 'rel': 'self', 'method': 'GET'}, {'href': 'https://api.sandbox.paypal.com/v1/payments/sale/40C15537SF235414R/refund', 'rel': 'refund', 'method': 'POST'}, {'href': 'https://api.sandbox.paypal.com/v1/payments/payment/PAYID-M3XGC5I9U46968696522382D', 'rel': 'parent_payment', 'method': 'GET'}]}}]}], 'failed_transactions': [], 'create_time': '2024-09-21T06:02:29Z', 'update_time': '2024-09-21T06:02:50Z', 'links': [{'href': 'https://api.sandbox.paypal.com/v1/payments/payment/PAYID-M3XGC5I9U46968696522382D', 'rel': 'self', 'method': 'GET'}]}
|
|||
|
2024-09-21 14:02:51,295 - API日志 - INFO - [支付执行] 支付成功,订单状态更新为 'approved'
|
|||
|
2024-09-21 14:02:51,352 - API日志 - INFO - [支付执行] 用户 19978615506 当前积分: 50
|
|||
|
2024-09-21 14:02:51,352 - API日志 - ERROR - [支付执行] 支付执行过程中发生异常: 'Plan' object has no attribute 'name'
|
|||
|
2024-09-21 14:03:02,480 - API日志 - INFO - 接收到 PayPal Webhook 请求...
|
|||
|
2024-09-21 14:03:02,481 - API日志 - INFO - 验证 PayPal Webhook 签名...
|
|||
|
2024-09-21 14:03:02,661 - API日志 - INFO - 获取的访问令牌: A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ
|
|||
|
2024-09-21 14:03:02,784 - API日志 - INFO - Webhook 签名验证成功
|
|||
|
2024-09-21 14:03:02,784 - API日志 - INFO - 接收到 PayPal Webhook 事件: PAYMENTS.PAYMENT.CREATED
|
|||
|
2024-09-21 14:03:02,785 - API日志 - INFO - Webhook payload: {
|
|||
|
"id": "WH-53X19961TT501671H-9G343651RY447041V",
|
|||
|
"event_version": "1.0",
|
|||
|
"create_time": "2024-09-21T06:02:53.663Z",
|
|||
|
"resource_type": "payment",
|
|||
|
"event_type": "PAYMENTS.PAYMENT.CREATED",
|
|||
|
"summary": "Checkout payment is created and approved by buyer",
|
|||
|
"resource": {
|
|||
|
"update_time": "2024-09-21T06:02:50Z",
|
|||
|
"create_time": "2024-09-21T06:02:29Z",
|
|||
|
"links": [
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAYID-M3XGC5I9U46968696522382D",
|
|||
|
"rel": "self",
|
|||
|
"method": "GET"
|
|||
|
}
|
|||
|
],
|
|||
|
"id": "PAYID-M3XGC5I9U46968696522382D",
|
|||
|
"state": "approved",
|
|||
|
"transactions": [
|
|||
|
{
|
|||
|
"amount": {
|
|||
|
"total": "1.00",
|
|||
|
"currency": "USD",
|
|||
|
"details": {
|
|||
|
"subtotal": "1.00",
|
|||
|
"shipping": "0.00",
|
|||
|
"insurance": "0.00",
|
|||
|
"handling_fee": "0.00",
|
|||
|
"shipping_discount": "0.00",
|
|||
|
"discount": "0.00"
|
|||
|
}
|
|||
|
},
|
|||
|
"payee": {
|
|||
|
"merchant_id": "AQJTM59Z4T3EG",
|
|||
|
"email": "sb-05ob032098751@business.example.com"
|
|||
|
},
|
|||
|
"description": "\u8d2d\u4e70 Hobby \u8ba1\u5212",
|
|||
|
"item_list": {
|
|||
|
"items": [
|
|||
|
{
|
|||
|
"name": "Hobby",
|
|||
|
"sku": "1",
|
|||
|
"price": "1.00",
|
|||
|
"currency": "USD",
|
|||
|
"tax": "0.00",
|
|||
|
"quantity": 1,
|
|||
|
"image_url": ""
|
|||
|
}
|
|||
|
],
|
|||
|
"shipping_address": {
|
|||
|
"recipient_name": "John Doe",
|
|||
|
"line1": "NO 1 Nan Jin Road",
|
|||
|
"city": "Shanghai",
|
|||
|
"state": "Shanghai",
|
|||
|
"postal_code": "200000",
|
|||
|
"country_code": "C2"
|
|||
|
}
|
|||
|
},
|
|||
|
"related_resources": [
|
|||
|
{
|
|||
|
"sale": {
|
|||
|
"id": "40C15537SF235414R",
|
|||
|
"state": "completed",
|
|||
|
"amount": {
|
|||
|
"total": "1.00",
|
|||
|
"currency": "USD",
|
|||
|
"details": {
|
|||
|
"subtotal": "1.00",
|
|||
|
"shipping": "0.00",
|
|||
|
"insurance": "0.00",
|
|||
|
"handling_fee": "0.00",
|
|||
|
"shipping_discount": "0.00",
|
|||
|
"discount": "0.00"
|
|||
|
}
|
|||
|
},
|
|||
|
"payment_mode": "INSTANT_TRANSFER",
|
|||
|
"protection_eligibility": "ELIGIBLE",
|
|||
|
"protection_eligibility_type": "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE",
|
|||
|
"transaction_fee": {
|
|||
|
"value": "0.33",
|
|||
|
"currency": "USD"
|
|||
|
},
|
|||
|
"parent_payment": "PAYID-M3XGC5I9U46968696522382D",
|
|||
|
"create_time": "2024-09-21T06:02:50Z",
|
|||
|
"update_time": "2024-09-21T06:02:50Z",
|
|||
|
"links": [
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/payments/sale/40C15537SF235414R",
|
|||
|
"rel": "self",
|
|||
|
"method": "GET"
|
|||
|
},
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/payments/sale/40C15537SF235414R/refund",
|
|||
|
"rel": "refund",
|
|||
|
"method": "POST"
|
|||
|
},
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAYID-M3XGC5I9U46968696522382D",
|
|||
|
"rel": "parent_payment",
|
|||
|
"method": "GET"
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
],
|
|||
|
"intent": "sale",
|
|||
|
"payer": {
|
|||
|
"payment_method": "paypal",
|
|||
|
"status": "VERIFIED",
|
|||
|
"payer_info": {
|
|||
|
"email": "sb-pztpq32086919@personal.example.com",
|
|||
|
"first_name": "John",
|
|||
|
"last_name": "Doe",
|
|||
|
"payer_id": "8RSF8T3UK8NT2",
|
|||
|
"shipping_address": {
|
|||
|
"recipient_name": "John Doe",
|
|||
|
"line1": "NO 1 Nan Jin Road",
|
|||
|
"city": "Shanghai",
|
|||
|
"state": "Shanghai",
|
|||
|
"postal_code": "200000",
|
|||
|
"country_code": "C2"
|
|||
|
},
|
|||
|
"phone": "2192589204",
|
|||
|
"country_code": "C2"
|
|||
|
}
|
|||
|
},
|
|||
|
"cart": "2Y943631F86154047"
|
|||
|
},
|
|||
|
"links": [
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-53X19961TT501671H-9G343651RY447041V",
|
|||
|
"rel": "self",
|
|||
|
"method": "GET"
|
|||
|
},
|
|||
|
{
|
|||
|
"href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-53X19961TT501671H-9G343651RY447041V/resend",
|
|||
|
"rel": "resend",
|
|||
|
"method": "POST"
|
|||
|
}
|
|||
|
]
|
|||
|
}
|
|||
|
2024-09-21 14:03:02,785 - API日志 - INFO - 回调接收到 开始执行支付,订单ID: PAYID-M3XGC5I9U46968696522382D, 付款人ID: 8RSF8T3UK8NT2
|
|||
|
2024-09-21 14:03:02,795 - API日志 - INFO - 订单 PAYID-M3XGC5I9U46968696522382D 已经支付,不需要再次执行支付
|
|||
|
2024-09-21 14:06:05,605 - API日志 - INFO - [支付执行] 获取的访问令牌: A21AAIVwWsRmSYRX_McyZN1RISbr4rs-amzjrc5R8H2rYRMZfH_Ia3QNs4HvEFVKxK2VAEMVe2dWfciYCJ5yhzGlbJgMBDuYQ
|