Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INTERNAL_SERVICE_ERROR on PayPal order pay

Question updated - more details added. I get a 500 (INTERNAL_SERVICE_ERROR) error from PayPal when I try to pay for an order.

I get ok from create order, and get the orderID - order status CREATED. The order is approved by buyer - successfully and order status become APPROVED.

Order created by https://api.sandbox.paypal.com/v1/checkout/orders

Approved using paypal https://www.paypalobjects.com/api/checkout.js

{
"id": "53T50821FM697283T",
"gross_total_amount": {
    "value": "26.66",
    "currency": "ILS"
},
"purchase_units": [
    {
        "reference_id": "20180318-64466",
        "amount": {
            "currency": "ILS",
            "total": "26.66"
        },
        "payee": {
            "email": "[email protected]"
        },
        "items": [
            {
                "name": "Meeting",
                "sku": "20180318-64466",
                "description": "Meeting 1/26/2018 1:00 AM-1/26/2018 2:20 AM. aaaaa",
                "price": "26.66",
                "currency": "ILS",
                "quantity": 1
            }
        ],
        "shipping_address": {
            "recipient_name": "Andrey Dyachenko",
            "line1": "ישראליס 5 דירה 4",
            "city": "תל-אביב",
            "country_code": "IL",
            "postal_code": "61014",
            "state": "",
            "type": "HOME_OR_WORK"
        },
        "partner_fee_details": {
            "receiver": {
                "email": "[email protected]"
            },
            "amount": {
                "value": "12.66",
                "currency": "ILS"
            }
        }
    }
],
"payer_info": {
    "email": "[email protected]",
    "first_name": "Andrey",
    "last_name": "Dyachenko",
    "payer_id": "BZDA9RCZXKYQY",
    "country_code": "IL",
    "shipping_address": {
        "recipient_name": "Andrey Dyachenko",
        "line1": "ישראליס 5 דירה 4",
        "city": "תל-אביב",
        "country_code": "IL",
        "postal_code": "61014",
        "state": "",
        "type": "HOME_OR_WORK"
    }
},
"metadata": {
    "supplementary_data": [
        {
            "name": "risk_correlation_id",
            "value": "53T50821FM697283T"
        },
        {
            "name": "buyer_ipaddress",
            "value": "109.65.134.129"
        },
        {
            "name": "external_channel",
            "value": "WEB"
        }
    ]
},
"redirect_urls": {
    "return_url": "https://classeeks.com/order/details/70368c93-90db-4a8e-bd82-6d611acc2d17",
    "cancel_url": "https://classeeks.com/order/details/70368c93-90db-4a8e-bd82-6d611acc2d17"
},
"create_time": "2018-03-18T19:49:11Z",
"links": [
    {
        "href": "https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T",
        "rel": "self",
        "method": "GET"
    },
    {
        "href": "https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T/capture",
        "rel": "capture",
        "method": "POST"
    }
],
"status": "APPROVED"

}

Next step pay with https://api.sandbox.paypal.com/v1/checkout/orders/53T50821FM697283T/pay

{   "disbursement_mode":"DELAYED"  }

Response

{
"name": "INTERNAL_SERVICE_ERROR",
"message": "The server encountered an internal error that prevented it from fulfilling this request.",
"information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",
"debug_id": "be0c6976ab17a"

}

Based https://demo.paypal.com/us/demo/go?page=cart

like image 212
Andrey Dyachenko Avatar asked Nov 07 '22 09:11

Andrey Dyachenko


1 Answers

If you have created the order successfully, then you can either capture the order directly or create the authorization which places the fund on hold and later you can capture the authorization. Check the doc for PayPal order APIs.

like image 163
PP_MTS_hzhu Avatar answered Nov 25 '22 11:11

PP_MTS_hzhu