php - PayPal Request keep getting MALFORMED_REQUEST -


i tried send payment paypal. reason malformed_request error. there no more information. not getdata() function exception.

here compiled json:

{ "intent": "sale", "payer": {     "payment_method": "paypal",     "payer_info": {         "first_name": "testvorname",         "last_name": "testnachname",         "email": "test@example.com",         "suffix": "herr"     } }, "transactions": [     {         "amount": {             "currency": "eur",             "total": "72.00"         },         "item_list": {             "items": [                 {                     "quantity": "4",                     "name": "test1",                     "price": "8",                     "currency": "eur"                 },                 {                     "quantity": "2",                     "name": "test2",                     "price": "20",                     "currency": "eur"                 }             ]         }     } ], "redirect_urls": {     "return_url": "https://www.google.de",     "cancel_url": "https://www.google.de" } } 

i have no idea wrong json. i'm using php sdk.

the issue not in sdk. data passing paypal server causing issue. error message not obvious here though.

you not need pass "payer_info" in "payer" object. removing fixes issue. here how json like:

{     "intent": "sale",     "payer": {         "payment_method": "paypal"     },     "transactions": [         {             "amount": {                 "currency": "eur",                 "total": "72.00"             },             "item_list": {                 "items": [                     {                         "quantity": "4",                         "name": "test1",                         "price": "8",                         "currency": "eur"                     },                     {                         "quantity": "2",                         "name": "test2",                         "price": "20",                         "currency": "eur"                     }                 ]             }         }     ],     "redirect_urls": {         "return_url": "https://www.google.de",         "cancel_url": "https://www.google.de"     } } 

for more information use samples provided in sdk, , documentation helps debug issues, etc.

here useful links:


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -