paypal-examples / paypal-dev-support

Resources and guidance on how to engage with the developer community & the PayPal Developer Tools team.
1 stars 1 forks source link

[Bug]: REST API payment sale reversed reference to original transaction id? #14

Open 8ctopus opened 11 months ago

8ctopus commented 11 months ago

Contact Details

hello@octopuslabs.io

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

cnallam commented 11 months ago

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

8ctopus commented 9 months ago

Any update?