Skip to content

[Bug]: payment sale refunded event significantly different between simulate and sandbox #15

@8ctopus

Description

@8ctopus

Contact Details

[email protected]

Describe the Issue

PAYMENT.SALE.REFUNDED event is significantly different when you compare webhook simulate with sandbox. For example, resource_type is different.

webhook simulate:

{
    "id": "WH-2N242548W9943490U-1JU23391CS4765624",
    "create_time": "2014-10-31T15:42:24Z",
    "resource_type": "sale",
    "event_type": "PAYMENT.SALE.REFUNDED",
    "summary": "A 0.01 USD sale payment was refunded",
    "resource": {
        "sale_id": "9T0916710M1105906",
        "parent_payment": "PAY-5437236047802405NKRJ22UA",
        "update_time": "2014-10-31T15:41:51Z",
        "amount": {
            "total": "-0.01",
            "currency": "USD"
        },
        "create_time": "2014-10-31T15:41:51Z",
        "links": [
            {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/refund\/6YX43824R4443062K",
                "rel": "self",
                "method": "GET"
            },
            {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/payment\/PAY-5437236047802405NKRJ22UA",
                "rel": "parent_payment",
                "method": "GET"
            },
            {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/sale\/9T0916710M1105906",
                "rel": "sale",
                "method": "GET"
            }
        ],
        "id": "6YX43824R4443062K",
        "state": "completed"
    },
    "links": [
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-2N242548W9943490U-1JU23391CS4765624",
            "rel": "self",
            "method": "GET",
            "encType": "application\/json"
        },
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-2N242548W9943490U-1JU23391CS4765624\/resend",
            "rel": "resend",
            "method": "POST",
            "encType": "application\/json"
        }
    ],
    "event_version": "1.0"
}

Sandbox refund:

{
    "id": "WH-99627641P9549114Y-4UE56547JX3066623",
    "event_version": "1.0",
    "create_time": "2023-10-18T06:44:15.324Z",
    "resource_type": "refund",
    "event_type": "PAYMENT.SALE.REFUNDED",
    "summary": "A $ 2.49 USD sale payment was refunded",
    "resource": {
        "sale_id": "3XR5603039148253T",
        "refund_reason_code": "REFUND",
        "amount": {
            "total": "2.49",
            "currency": "USD"
        },
        "refund_from_received_amount": {
            "currency": "USD",
            "value": "2.09"
        },
        "create_time": "2023-10-18T06:44:07Z",
        "refund_from_transaction_fee": {
            "currency": "USD",
            "value": "0.40"
        },
        "update_time": "2023-10-18T06:44:07Z",
        "total_refunded_amount": {
            "currency": "USD",
            "value": "2.49"
        },
        "links": [
            {
                "method": "GET",
                "rel": "self",
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/refund\/2C948619700512732"
            },
            {
                "method": "GET",
                "rel": "sale",
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/sale\/3XR5603039148253T"
            }
        ],
        "id": "2C948619700512732",
        "state": "completed",
        "refund_to_payer": {
            "currency": "USD",
            "value": "2.49"
        },
        "invoice_number": ""
    },
    "links": [
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-99627641P9549114Y-4UE56547JX3066623",
            "rel": "self",
            "method": "GET"
        },
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-99627641P9549114Y-4UE56547JX3066623\/resend",
            "rel": "resend",
            "method": "POST"
        }
    ]
}

Steps To Reproduce

See above

What type of Operating System are you seeing the problem on?

N/A

What type of browser are you seeing the problem on?

N/A

Screenshots or Videos

No response

Code to produce this issue.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions