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]: Simulate BILLING.SUBSCRIPTION.EXPIRED webhook validation error #8

Open
8ctopus opened this issue Sep 25, 2023 · 4 comments
Open
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@8ctopus
Copy link

8ctopus commented Sep 25, 2023

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

@8ctopus 8ctopus added the bug Something isn't working label Sep 25, 2023
@devchristina devchristina self-assigned this Sep 25, 2023
@devchristina
Copy link
Contributor

@8ctopus Sent this to the team to triage, will let you know when I hear back.

@devchristina
Copy link
Contributor

Hi @8ctopus -- We believe that this may be an issue with outdated documentation. We recreated this experience using Postman. When we change from version 1.0 to 2.0, this fixed the issue. I'm going to confirm with the product team the correct version and ask them to update their documentation.

@8ctopus
Copy link
Author

8ctopus commented Sep 26, 2023

I confirm that setting resource type to 2.0 fixes the problem on my side as well.

@devchristina devchristina added the documentation Improvements or additions to documentation label Sep 26, 2023
@devchristina
Copy link
Contributor

@8ctopus Sent this issue to our engineering teams to update their documentation.

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

No branches or pull requests

2 participants