Checkout.js +服务器端->使用REST API / v1 / payments / payment的country_code和电话问题

时间:2018-07-26 22:40:10

标签: rest api paypal

无济于事,成功致电创建付款后,我无法填写country_code(CA)或电话。

国家/地区始终显示为“美国”,电话始终显示为“ +1”。

带或不带发运地址,发运偏好:NO_SHIPPING。使用所谓的示例(可能已过时或未正确记录)和API文档,这对于包含示例非常有用...

这是json中的创建付款查询。我得到了以下相同的结构:

  • id:PAY-xxx
  • 状态:已创建
  • payer_info中的电话(但没有API预期的country_code)
  • created_time
  • ...和...
  • 链接中的PayPal链接。

表明通话成功。

或者我应该放弃“ / v1 / payments / payment”以进行其他我不知道的事情,或者Paypal API不是最新的。

----- json创建付款查询-----

{
    "intent": "sale",
    "payer": {
        "payment_method": "paypal",
        "payer_info": {
            "email": "<snip>",
            "first_name": "Bob",
            "last_name": "Smith",
            "billing_address": {
                "line1": "1 notre dame",
                "line2": "",
                "city": "Montreal",
                "country_code": "CA",
                "postal_code": "H1H 1H1",
                "phone": "011862212345678",
                "state": "QC"
            }
        }
    },
    "application_context": {
        "brand_name": "Server-side Test",
        "locale": "fr_CA",
        "landing_page": "Billing"
    },
    "transactions": [
        {   
            "description": "The payment transaction description.",
            "invoice_number": "5b5a38cb35bb7",
            "custom": "merchant custom data",
            "payment_options": {
                "allowed_payment_method": "INSTANT_FUNDING_SOURCE"
            },
            "amount": {
                "total": "5.75",
                "currency": "CAD",
                "details": {
                    "subtotal": "5",
                    "tax": "0.75"
                }
            },
            "item_list": {
                "items": [
                    {   
                        "name": "item 1",
                        "description": "item 1 description",
                        "quantity": "1",
                        "price": "1",
                        "tax": "0.15",
                        "currency": "CAD"
                    },
                    {   
                        "name": "item 2",
                        "description": "item 2 description",
                        "quantity": "2",
                        "price": "2",
                        "tax": "0.6",
                        "currency": "CAD"
                    }
                ],
                "shipping_address": {
                    "recipient_name": "Bob Smith",
                    "line1": "1 notre dame",
                    "line2": "",
                    "city": "Montreal",
                    "country_code": "CA",
                    "postal_code": "H1H 1H1",
                    "phone": "011862212345678",
                    "state": "QC"
                }
            }
        }
    ],
    "redirect_urls": {
        "return_url": "http:\/\/<snip>\/return.php",
        "cancel_url": "http:\/\/<snip>\/cancel.php"
    }
}

0 个答案:

没有答案