papal plus malformed_request JSON with shipping address

json curl paypal

66 просмотра

1 ответ

1 Репутация автора

To show the Paypal plus iFrame (REST API) i make a Request with JSON

{
"intent": "sale",
"experience_profile_id": "XP-XXXX-XXXX-XXX-XXX",
"redirect_urls": {
"return_url": "https://www.XXXXXXX.de/bestellen.php",
"cancel_url": "https://www.XXXXXXX.de/zahlungabbruch.php"
},

"payer": {  
    "payment_method": "paypal"  
},  
"transactions": [{  
    "amount": {  
        "total": "53.45",  
        "currency": "EUR",  
        "details": {  
            "subtotal": "49.5",  
            "shipping": "3.95"  
        }  
    },  
    "description": "Tollewolle",  
    "invoice_number": "",  
    "item_list": {  
        "items": [  

            {  
                "quantity": "4",  
                "name": "Fine Kid - 50",  
                "price": "8.25",  
                "currency": "EUR",  
                "sku": "8-50"  
            },  

            {  
                "quantity": "2",  
                "name": "Fine Kid - 208",  
                "price": "8.25",  
                "currency": "EUR",  
                "sku": "8-208"  
            }  

        ]  
    },  
    "shipping_address": {  
        "line1": "Rechnungs Str. 41",  
        "city": "Flensburg",  
        "postal_code": "24939",  
        "country_code": "DE"  
    }  
}]  

}

Without the shipping_address it works fine. With the address i get an Error 'MALFORMED_REQUEST'

Автор: Uwe Chardon Источник Размещён: 18.07.2016 05:36

Ответы (1)


0 плюса

1 Репутация автора

I believe Shipping address is a child ob lineitems so you need to move it up a level. E.g.

"transactions": [{"amount": {"total": "53.45", "currency": "EUR","details":{"subtotal": "49.5", "shipping": "3.95"}},"description": "Tollewolle", "invoice_number": "", "item_list": {"items": [{"quantity": "4", "name": "Fine Kid - 50", "price": "8.25", "currency": "EUR", "sku": "8-50"},{"quantity": "2", "name": "Fine Kid - 208","price": "8.25", "currency": "EUR", "sku": "8-208"}],"shipping_address": {"line1": "Rechnungs Str. 41","city": "Flensburg", "postal_code": "24939", "country_code": "DE"}}}]

Автор: Tobby Размещён: 07.08.2016 05:44
Вопросы из категории :
32x32