Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
8ctopus opened this issue Oct 18, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@8ctopus
Copy link

8ctopus commented Oct 18, 2023

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

@8ctopus 8ctopus added the bug Something isn't working label Oct 18, 2023
@cnallam
Copy link
Contributor

cnallam commented Oct 19, 2023

Ack, looking in to issue. Will raise the internal bug to the webhooks team

@8ctopus
Copy link
Author

8ctopus commented Nov 24, 2023

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants