Giter Site home page Giter Site logo

paypal-dev-support's People

Contributors

cnallam avatar devchristina avatar

Watchers

 avatar  avatar  avatar

paypal-dev-support's Issues

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

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

[Bug]: order of webhooks events when events occur in a short period of time

Contact Details

[email protected]

Describe the Issue

Events that occur within a short period of time are not sent to the web-hook in time ordered fashion.

Here's an example with a new subscription being made, then I pause and un-pause the subscription within the PayPal admin and finally cancel it:

Fields are:

  • date when logged in my script
  • event type
  • billing agreement
  • create_time
  • status
  • status_update_time
[2023-10-27 14:36:54] BILLING.SUBSCRIPTION.CREATED - I-2DLP2S1P3YFG - 2023-10-27T12:36:38.813Z - APPROVAL_PENDING - 
[2023-10-27 14:37:47] BILLING.SUBSCRIPTION.ACTIVATED - I-2DLP2S1P3YFG - 2023-10-27T12:37:24.339Z - ACTIVE - 2023-10-27T12:37:20Z
[2023-10-27 14:38:08] PAYMENT.SALE.COMPLETED - 25G22362885451447 - 2023-10-27T12:37:44.899Z
[2023-10-27 14:42:07] BILLING.SUBSCRIPTION.SUSPENDED - I-2DLP2S1P3YFG - 2023-10-27T12:41:45.323Z - SUSPENDED - 2023-10-27T12:41:41Z
[2023-10-27 14:42:17] BILLING.SUBSCRIPTION.ACTIVATED - I-2DLP2S1P3YFG - 2023-10-27T12:41:50.845Z - ACTIVE - 2023-10-27T12:41:46Z
[2023-10-27 14:42:27] BILLING.SUBSCRIPTION.SUSPENDED - I-2DLP2S1P3YFG - 2023-10-27T12:42:06.790Z - CANCELLED - 2023-10-27T12:42:02Z
[2023-10-27 14:42:28] BILLING.SUBSCRIPTION.ACTIVATED - I-2DLP2S1P3YFG - 2023-10-27T12:42:00.374Z - ACTIVE - 2023-10-27T12:41:56Z
[2023-10-27 14:42:57] BILLING.SUBSCRIPTION.CANCELLED - I-2DLP2S1P3YFG - 2023-10-27T12:42:33.914Z - CANCELLED - 2023-10-27T12:42:02Z

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

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

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

[Bug]: sandbox subscribe no longer triggers onApprove callback

Contact Details

[email protected]

Describe the Issue

As of today, the PayPal Sandbox subscription confirmation screen has changed and the onApprove callback in not called when I close the subscription confirmation window. Also confirmation window has no button to return to the business.
Yesterday everything was working so I presume it's changes deployed in the last 24 hours that caused the problem.

Here's my code. It's taken from the official PayPal example.

<!DOCTYPE html>
<head>
<title>store</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<script src="https://www.paypal.com/sdk/js?client-id={{ clientId }}&vault=true&intent=subscription"></script>
<script>

paypal.Buttons({
  style: {
    shape: 'rect',
    color: 'blue',
    layout: 'vertical',
    label: 'subscribe'
  },
  createSubscription: function(data, actions) {
    return actions.subscription.create({
      'plan_id': '{{ planId }}'
    });
  },
  onApprove: function(data, actions) {
    alert('You have successfully subscribed to ' + data.subscriptionID);
  },
  onDecline: function() {
    alert('Something went wrong. Please try again ');
  }
}).render('#paypal-button-container');

</script>
<h1> Subscription plan </h1>
<h2> Sandbox account </h2>
<ul>
  <li> {{ login }} </li>
  <li> {{ password }} </li>
</ul>
<div id="paypal-button-container"></div>
</body>
</html>

Steps To Reproduce

See above

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

Windows

What type of browser are you seeing the problem on?

Edge

Screenshots or Videos

image

Code to produce this issue.

See above

[Bug]: sandbox subscription window doesn't close when there is a popup window in FireFox that is behind it

Contact Details

[email protected]

Describe the Issue

When I click Agree & Subscribe in the PayPal checkout window (2 on screenshot), a popup window with an OK button (1 on screenshot) appears behind it (but it is not visible until I move away from the PayPal window).

Steps To Reproduce

see below

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

No response

What type of browser are you seeing the problem on?

No response

Screenshots or Videos

image
image

Code to produce this issue.

No response

[Bug]: Simulate BILLING.SUBSCRIPTION.EXPIRED webhook validation error

Contact Details

[email protected]

Describe the Issue

The webhooks api provides a curl example to simulate a webhook event:

simulate

Simulation works just fine for events such as "PAYMENT.AUTHORIZATION.CREATED", but fails for "BILLING.SUBSCRIPTION.EXPIRED" as shown in the curl example below

curl -v -X POST "https://api-m.sandbox.paypal.com/v1/notifications/simulate-event" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-d '{
  "url": "https://example.com/example_webhook",
  "event_type": "BILLING.SUBSCRIPTION.EXPIRED",
  "resource_version": "1.0"
}' 
Note: Unnecessary use of -X or --request, POST is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/notifications/simulate-event
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 151.101.1.35:443...
* Connected to api-m.sandbox.paypal.com (151.101.1.35) port 443
* schannel: disabled automatic use of client certificate
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* using HTTP/1.x
> POST /v1/notifications/simulate-event HTTP/1.1
> Host: api-m.sandbox.paypal.com
> User-Agent: curl/8.2.1
> Accept: */*
> Content-Type: application/json
> Authorization: Bearer TOKEN_RETRACTED
> Content-Length: 127
>
} [127 bytes data]
< HTTP/1.1 400 Bad Request
< Connection: keep-alive
< Content-Length: 243
< Content-Type: application/json
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Content-Language:
< Paypal-Debug-Id: 9f817b6cd1db9
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Accept-Ranges: bytes
< Via: 1.1 varnish, 1.1 varnish
< Edge-Control: max-age=0
< Date: Mon, 25 Sep 2023 10:16:57 GMT
< X-Served-By: cache-fra-eddf8230042-FRA, cache-bma1650-BMA
< X-Cache: MISS, MISS
< X-Cache-Hits: 0, 0
< X-Timer: S1695637018.596681,VS0,VE197
< Vary: Accept-Encoding
<
{ [243 bytes data]
100   370  100   243  100   127    141     73  0:00:01  0:00:01 --:--:--   215{"name":"VALIDATION_ERROR","message":"Invalid data provided","debug_id":"9f817b6cd1db9","information_link":"https://developer.paypal.com/docs/api/webhooks/#errors","details":[{"location":"body","issue":"Not a valid Resource Type"}],"links":[]}
* Connection #0 to host api-m.sandbox.paypal.com left intact

Here's the prettified json

{
    "name": "VALIDATION_ERROR",
    "message": "Invalid data provided",
    "debug_id": "9f817b6cd1db9",
    "information_link": "https://developer.paypal.com/docs/api/webhooks/#errors",
    "details": [
        {
            "location": "body",
            "issue": "Not a valid Resource Type"
        }
    ],
    "links": []
}

Steps To Reproduce

See above

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

Windows

What type of browser are you seeing the problem on?

N/A

Screenshots or Videos

No response

Code to produce this issue.

See above

[Bug]: REST Api doc curl examples do not work in Windows

Contact Details

[email protected]

Describe the Issue

curl examples do not work on Windows. Here's an example taken from the documentation:

https://developer.paypal.com/api/rest/authentication/
curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token"\
 -u "CLIENT_ID:CLIENT_SECRET"\
 -H "Content-Type: application/x-www-form-urlencoded"\
 -d "grant_type=client_credentials"

Copy and pasting this in a Windows command line leads to the following output:

K:\downloads>curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token"\
*   Trying 199.232.169.35:443...
* Connected to api-m.sandbox.paypal.com (199.232.169.35) port 443 (#0)
* schannel: disabled automatic use of client certificate
* ALPN: offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.1
> POST /v1/oauth2/token\ HTTP/1.1
> Host: api-m.sandbox.paypal.com
> User-Agent: curl/8.0.1
> Accept: */*
>
< HTTP/1.1 400 Bad Request
< Connection: keep-alive
< Content-Length: 435
< Content-Type: text/html;charset=utf-8
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Content-Language: en
< Paypal-Debug-Id: 45d637c97df00
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Accept-Ranges: bytes
< Via: 1.1 varnish, 1.1 varnish
< Edge-Control: max-age=0
< Date: Tue, 26 Sep 2023 03:58:58 GMT
< X-Served-By: cache-lhr7327-LHR, cache-par-lfpg1960041-PAR
< X-Cache: MISS, MISS
< X-Cache-Hits: 0, 0
< X-Timer: S1695700738.861618,VS0,VE482
< Vary: Accept-Encoding
<
<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>* Connection #0 to host api-m.sandbox.paypal.com left intact

K:\downloads> -u "CLIENT_ID:CLIENT_SECRET"\
'-u' is not recognized as an internal or external command,
operable program or batch file.

K:\downloads> -H "Content-Type: application/x-www-form-urlencoded"\
'-H' is not recognized as an internal or external command,
operable program or batch file.

K:\downloads> -d "grant_type=client_credentials"

Correct output gets displayed if \ is replaced by ^

curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token" ^
 -u "CLIENT_ID:CLIENT_SECRET" ^
 -H "Content-Type: application/x-www-form-urlencoded" ^
 -d "grant_type=client_credentials"
K:\downloads>curl -v -X POST "https://api-m.sandbox.paypal.com/v1/oauth2/token" ^
More?  -u "CLIENT_ID:CLIENT_SECRET" ^
More?  -H "Content-Type: application/x-www-form-urlencoded" ^
More?  -d "grant_type=client_credentials"
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 199.232.169.35:443...
* Connected to api-m.sandbox.paypal.com (199.232.169.35) port 443 (#0)
* schannel: disabled automatic use of client certificate
* ALPN: offers http/1.1
* ALPN: server accepted http/1.1
* using HTTP/1.1
* Server auth using Basic with user 'CLIENT_ID'
> POST /v1/oauth2/token HTTP/1.1
> Host: api-m.sandbox.paypal.com
> Authorization: Basic Q0xJRU5UX0lEOkNMSUVOVF9TRUNSRVQ=
> User-Agent: curl/8.0.1
> Accept: */*
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 29
>
< HTTP/1.1 401 Unauthorized
< Connection: keep-alive
< Content-Length: 77
< Content-Type: application/json
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Paypal-Debug-Id: 1cf300fcf12d3
< Pragma: no-cache
< X-Paypal-Token-Service: IAAS
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Accept-Ranges: bytes
< Via: 1.1 varnish, 1.1 varnish
< Edge-Control: max-age=0
< Date: Tue, 26 Sep 2023 04:17:49 GMT
< X-Served-By: cache-lhr7370-LHR, cache-par-lfpg1960057-PAR
< X-Cache: MISS, MISS
< X-Cache-Hits: 0, 0
< X-Timer: S1695701869.999422,VS0,VE594
< Vary: Accept-Encoding
<
{"error":"invalid_client","error_description":"Client Authentication failed"}* Connection #0 to host api-m.sandbox.paypal.com left intact

Steps To Reproduce

See above

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

Windows

What type of browser are you seeing the problem on?

N/A

Screenshots or Videos

No response

Code to produce this issue.

No response

[Feature Request]: Order of events

Suggestion / Feature Request

I have a suggestion to simplify the customer side implementation of subscriptions: now, the events triggered when a user subscribes: BILLING.SUBSCRIPTION.CREATED, BILLING.SUBSCRIPTION.ACTIVATED and PAYMENT.SALE.COMPLETED can be sent in any order which makes processing much harder. Here's an example from my sandbox:

[2023-11-24 08:19:14] DEBUG new event - PAYMENT.SALE.COMPLETED - 1F571360LH117700T
[2023-11-24 08:19:14] WARNING payment sale completed called before activated - I-23A00KCEW0SF
[2023-11-24 08:19:19] DEBUG new event - BILLING.SUBSCRIPTION.CREATED - I-23A00KCEW0SF - status - APPROVAL_PENDING
[2023-11-24 08:19:19] INFO Process 1 pending events...
[2023-11-24 08:19:19] INFO Process pending events - OK
[2023-11-24 08:19:24] DEBUG new event - BILLING.SUBSCRIPTION.ACTIVATED - I-23A00KCEW0SF - status - ACTIVE

It does not make much sense to get a completed payment for a subscription that doesn't yet exist.

It would make implementation a lot easier if the order would be fixed:

  1. BILLING.SUBSCRIPTION.CREATED
  2. BILLING.SUBSCRIPTION.ACTIVATED
  3. PAYMENT.SALE.COMPLETED

[Bug]: REST Api doc curl examples url not always within quotes

Contact Details

[email protected]

Describe the Issue

Some of the curl examples have the destination url not within double quotes which can cause problems. Here's an example:

https://developer.paypal.com/docs/api/subscriptions/v1/#plans_list
$ curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'
[2] 2345
bash: -H: command not found
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

Problem is fixed by enclosing the url within double quotes

$ curl -v -X GET "https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc" \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 199.232.169.35:443...
* Connected to api-m.sandbox.paypal.com (199.232.169.35) port 443
* schannel: disabled automatic use of client certificate
* using HTTP/1.x
> GET /v1/billing/plans?sort_by=create_time&sort_order=desc HTTP/1.1
> Host: api-m.sandbox.paypal.com
> User-Agent: curl/8.2.1
> Authorization: Bearer TOKEN_RETRACTED
> Content-Type: application/json
> Accept: application/json
> Prefer: return=representation
>
< HTTP/1.1 401 Unauthorized
< Connection: keep-alive
< Content-Length: 95
< Content-Type: application/json
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Paypal-Debug-Id: 13cb9c4b4755f
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Accept-Ranges: bytes
< Via: 1.1 varnish, 1.1 varnish
< Edge-Control: max-age=0
< Date: Tue, 26 Sep 2023 04:25:16 GMT
< X-Served-By: cache-lhr7338-LHR, cache-par-lfpg1960022-PAR
< X-Cache: MISS, MISS
< X-Cache-Hits: 0, 0
< X-Timer: S1695702316.041763,VS0,VE202
< Vary: Accept-Encoding
<
{ [95 bytes data]
100    95  100    95    0     0     90      0  0:00:01  0:00:01 --:--:--    90{"error":"invalid_token","error_description":"The token passed in was not found in the system"}
* Connection #0 to host api-m.sandbox.paypal.com left intact

Steps To Reproduce

See above

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

Windows

What type of browser are you seeing the problem on?

No response

Screenshots or Videos

No response

Code to produce this issue.

See above

[Bug]: PayPal REST API list plans fails with internal server error for more than 10 days

Contact Details

[email protected]

Describe the Issue

REST API provides curl exampleto list all existing plans:

https://developer.paypal.com/docs/api/subscriptions/v1/#plans_list

Unfortunately the request doesn't work for more than 10 days. Here's what I get:

$ curl -v -X GET "https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc" \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'
Note: Unnecessary use of -X or --request, GET is already inferred.
* processing: https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 146.75.117.35:443...
* Connected to api-m.sandbox.paypal.com (146.75.117.35) port 443
* schannel: disabled automatic use of client certificate
* using HTTP/1.x
> GET /v1/billing/plans?sort_by=create_time&sort_order=desc HTTP/1.1
> Host: api-m.sandbox.paypal.com
> User-Agent: curl/8.2.1
> Authorization: Bearer TOKEN_RETRACTED
> Content-Type: application/json
> Accept: application/json
> Prefer: return=representation
>
< HTTP/1.1 500 Internal Server Error
< Connection: keep-alive
< Content-Length: 233
< Content-Type: application/json
< Server: nginx
< Cache-Control: max-age=0, no-cache, no-store, must-revalidate
< Paypal-Debug-Id: 9330448c4803d
< X-Slr-Retry: 500
< X-Slr-Retry-Api: /v1/billing/plans
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Edge-Control: max-age=0
< Accept-Ranges: bytes
< Date: Fri, 15 Sep 2023 09:44:32 GMT
< Via: 1.1 varnish
< X-Served-By: cache-fra-eddf8230025-FRA
< X-Cache: MISS
< X-Cache-Hits: 0
< X-Timer: S1694771072.216580,VS0,VE491
< Vary: Accept-Encoding
<
{ [233 bytes data]
100   233  100   233    0     0    202      0  0:00:01  0:00:01 --:--:--   202{"name":"INTERNAL_SERVER_ERROR","message":"An internal server error has occurred.","debug_id":"9330448c4803d","details":[{"issue":"INTERNAL_ERROR","description":"TaskExecutor Reactor Task : CHECKPOINT_FETCH_PLAN Failed"}],"links":[]}
* Connection #0 to host api-m.sandbox.paypal.com left intact

Steps To Reproduce

See above

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

Windows

What type of browser are you seeing the problem on?

N/A

Screenshots or Videos

N/A

Code to produce this issue.

$ curl -v -X GET "https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc" \
-H 'Authorization: Bearer TOKEN_RETRACTED' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Prefer: return=representation'

[Missing feature]: subscription next payment information missing

Suggestion / Feature Request

The subscription next payment date is not available in the event while the PayPal email that I receive shows it.

2024-01-08_082658
2024-01-08_082748

Could you please add this information in the PAYMENT.SALE.COMPLETED event?

Note: The first next payment is visible in the BILLING.SUBSCRIPTION.ACTIVATED event.

inconsistent create date time format

Contact Details

[email protected]

Describe the Issue

All webhook events have inconsistent create date time format as shown in the example below.

  • Event create_time is 2023-09-29T05:31:20.578Z which corresponds to RFC3339_EXTENDED.
  • Event resource.create_time is 2023-09-29T05:31:20Z which corresponds to RFC3339.
{
    "id": "WH-4Y606300TA357863S-3Y259958BU9969527",
    "event_version": "1.0",
    "create_time": "2023-09-29T05:31:20.578Z",
    "resource_type": "subscription",
    "resource_version": "2.0",
    "event_type": "BILLING.SUBSCRIPTION.CREATED",
    "summary": "Subscription created",
    "resource": {
        "start_time": "2023-09-29T05:31:20Z",
        "quantity": "1",
        "create_time": "2023-09-29T05:31:20Z",
        "links": [
            {
                "href": "https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-9T8593239B086700M",
                "rel": "approve",
                "method": "GET"
            },
            {
                "href": "https://api.sandbox.paypal.com/v1/billing/subscriptions/I-FA415DTVC6B9",
                "rel": "edit",
                "method": "PATCH"
            },
            {
                "href": "https://api.sandbox.paypal.com/v1/billing/subscriptions/I-FA415DTVC6B9",
                "rel": "self",
                "method": "GET"
            }
        ],
        "id": "I-FA415DTVC6B9",
        "plan_overridden": false,
        "plan_id": "P-1CF03610GT7629518MUCCY2A",
        "status": "APPROVAL_PENDING"
    },
    "links": [
        {
            "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-4Y606300TA357863S-3Y259958BU9969527",
            "rel": "self",
            "method": "GET"
        },
        {
            "href": "https://api.sandbox.paypal.com/v1/notifications/webhooks-events/WH-4Y606300TA357863S-3Y259958BU9969527/resend",
            "rel": "resend",
            "method": "POST"
        }
    ]
}

Steps To Reproduce

N/A

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.