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]: REST API payment sale reversed reference to original transaction id? #14

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

When asking the PayPal REST API to simulate a PAYMENT.SALE.REVERSED event, I get the json below.
The problem is it does not provide any reference to the original transaction id that was reversed.
As a comparison, the PAYMENT.SALE.REFUNDED event has sale_id which corresponds to the original transaction id.

{
    "id": "WH-3EC545679X386831C-3D038940937933201",
    "event_version": "1.0",
    "create_time": "2014-10-23T00:19:27Z",
    "resource_type": "sale",
    "event_type": "PAYMENT.SALE.REVERSED",
    "summary": "A $ 0.49 USD sale payment was reversed",
    "resource": {
        "id": "77689802DL785834G",
        "create_time": "2014-10-23T00:19:12Z",
        "state": "completed",
        "amount": {
            "total": "-0.49",
            "currency": "USD",
            "details": {
                "subtotal": "-0.64",
                "tax": "0.08",
                "shipping": "0.07"
            }
        },
        "links": [
            {
                "href": "https:\/\/api.sandbox.paypal.com\/v1\/payments\/refund\/77689802DL785834G",
                "rel": "self",
                "method": "GET"
            }
        ]
    },
    "links": [
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-3EC545679X386831C-3D038940937933201",
            "rel": "self",
            "method": "GET"
        },
        {
            "href": "https:\/\/api.sandbox.paypal.com\/v1\/notifications\/webhooks-events\/WH-3EC545679X386831C-3D038940937933201\/resend",
            "rel": "resend",
            "method": "POST"
        }
    ]
}

PAYMENT.SALE.REFUNDED as a reference

{
    "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"
}

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
@8ctopus 8ctopus changed the title [Bug]: REST API simulate payment sale reversed event [Bug]: REST API payment sale reversed reference to original transaction id? Oct 18, 2023
@cnallam
Copy link
Contributor

cnallam commented Oct 20, 2023

@8ctopus Ack, asked this in our internal forum.

@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