docs/paypal.md
curl <https://api.paypal.com/v1/oauth2/token> \\
-H "Accept: application/json" \\
-H "Accept-Language: en_US" \\
-u "<client_id>:<client_secret>" \\
-d "grant_type=client_credentials"
curl -v -X GET <https://api.paypal.com/v1/notifications/webhooks> \\
-H "Content-Type:application/json" \\
-H "Authorization: Bearer <access_token>"
curl -v -X POST <https://api.paypal.com/v1/notifications/webhooks> \\
-H "Content-Type:application/json" \\
-H "Authorization: Bearer <access_token>" \\
-d '{
"url": "https://<URL>/paypal-webhook",
"event_types": [
{
"name": "CHECKOUT.ORDER.PROCESSED"
}
]
}'
List of all the required Paypal webhooks is maintained here.
curl -v -X PATCH <https://api.paypal.com/v1/notifications/webhooks/><webhook-id> \\
-H "Content-Type:application/json" \\
-H "Authorization: Bearer <access_token>" \\
-d '[
{
"op": "replace",
"path": "/event_types",
"value": [
{
"name": "CHECKOUT.ORDER.PROCESSED"
},
{
"name":"CUSTOMER.DISPUTE.CREATED"
},
{
"name":"CUSTOMER.DISPUTE.RESOLVED"
},
{
"name":"CUSTOMER.DISPUTE.UPDATED"
},
{
"name": "MERCHANT.PARTNER-CONSENT.REVOKED"
},
{
"name": "PAYMENT.CAPTURE.COMPLETED"
},
{
"name": "PAYMENT.CAPTURE.DENIED"
},
{
"name":"PAYMENT.CAPTURE.PENDING"
},
{
"name": "PAYMENT.CAPTURE.REFUNDED"
},
{
"name":"PAYMENT.CAPTURE.REVERSED"
},
{
"name":"PAYMENT.ORDER.CREATED"
},
{
"name": "PAYMENT.REFERENCED-PAYOUT-ITEM.COMPLETED"
}
]
}
]'
curl -v -X DELETE <https://api.paypal.com/v1/notifications/webhooks/><webhook-id> \\
-H "Content-Type:application/json" \\
-H "Authorization: Bearer <access_token>"
IPN simulator Guide
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNSimulator/
(IPN) settings (Live)
https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-ipn-notify
IPN Simulator
https://developer.paypal.com/developer/ipnSimulator/
Site to view sample webhook data
IPN history
https://www.paypal.com/us/cgi-bin/webscr?cmd=_display-ipns-history
paypal.rb in config/initializers/My Apps & CredentialsREST API apps section Click on Gumroad Application.Sandbox Webhooks section Add webhook URL of your application.paypal.rb
PAYPAL_ENDPOINT = "<https://api-3t.sandbox.paypal.com/nvp>"
PAYPAL_REST_ENDPOINT = "<https://api.sandbox.paypal.com>"
PAYPAL_ENV = "sandbox"
PAYPAL_CLIENT_ID = "AQiKjZAqXGcN_oU8wh-RKelv6Nf3IrWVY9J9rrhz1pF7aqiyZjutSdG75I6ahd3zJe1ThpklFp5jNman"
PAYPAL_CLIENT_SECRET = "EPnNdtAW6jsUleHWQmjsFNef37f1GGWLwtJx3uO2PRdbENAFxTgW1WA1V83MVYvSrRrkH0tXNevE0CJ_"
PAYPAL_LIB_MODE = "sandbox"
PAYPAL_URL = "<https://www.sandbox.paypal.com>"
PAYPAL_MERCHANT_ID = "5SCHBGJUCTP2U"
PAYPAL_USER_EMAIL = "[email protected]"
PAYPAL_USER = "paypal-facilitator_api1.gumroad.com"
PAYPAL_PASS = "1383112423"
PAYPAL_SIGNATURE = "AFcWxV21C7fd0v3bYYYRCpSSRl31A9TRhGDrqj7x7lF9P6NGOruW.7ak"
PayPal::SDK.configure(
:mode => PAYPAL_ENV,
:client_id => PAYPAL_CLIENT_ID,
:client_secret => PAYPAL_CLIENT_SECRET,
:username => PAYPAL_USER,
:password => PAYPAL_PASS,
:signature => PAYPAL_SIGNATURE
)