At the moment we do not resend webhooks if your application responds with an error or fails to respond within 10 seconds.
Find X-RiotModels-Signature in the headers:
Then compare signature with the HEX digest of MD5 HMAC signed request body (the JSON string you receive from us) using your webhook's secret:
request.headers['X-RiotModels-Signature'] == OpenSSL::HMAC.hexdigest("MD5", secret, request.body)
Where secret is taken from your Profile Settings -> Webhooks section on the site. Request body is a JSON string.
EVENT TYPES (see below, payload key is "event"):
{ "payload": { "subscription": { "id": 10059451, "tier_id": 129388, # Unique identifier of the tier (same across all subscribers in the current tier) "cost": 10000, # ALWAYS IN CENTS (IN THIS CASE == $100.00) "last_payment_amount": 10000, # CAN BE NULL OR NOT EQUAL TO SUBSCRIPTION PRICE IN CASE IF THE LAST PAYMENT IS UNDER REVIEW OR TIER HAS BEEN DOWNGRADED! "last_payment_settlement_amount": 10000, # CAN BE NULL OR NOT EQUAL TO SUBSCRIPTION PRICE IN CASE IF THE LAST PAYMENT IS UNDER REVIEW OR TIER HAS BEEN DOWNGRADED! "subscriber_id": 91953, "created_at_timestamp": 1573138322, "charged_at_timestamp": 1573138322, "extended_at_timestamp": 1573138322, # THE DATE FROM WHICH WE COUNT NEXT RECURRING BILLING DATE (USUALLY EQUAL TO CHARGED_AT) "profile_id": 1, # YOUR STAR PROFILE ID "billing_failed": false, "billing_failed_at_timestamp": null, "cancelled": false, "cancelled_at_timestamp": null, "paused": false, "paused_at_timestamp": null, "restored_at": null, "trusted": false # PASSED TRUSTED PERIOD (SEE PROFILE SETTINGS) }, "subscriber": { "email": "[email protected]", "nickname": "John Doe", "id": 91953 } }, "event": "new_subscription", # CAB BE: "email_shared", "email_unshared", "shipping_address_shared", "shipping_address_unshared", "recurring_pledge_increased", "recurring_pledge_decreased", "subscription_billing_failed", "new_subscription", "subscription_cancelled" "project": "riot", "timestamp": 1573138322 }
EVENT TYPES (see below, payload key is "event"):
PAYLOAD
{ "payload": { "payment": { "id": 1239168, "amount": 10000, "settlement_amount": 9820, # HOW MUCH STAR EARNS FROM THIS TRANSACTION "authorized_at_timestamp": 1573138322, # ALWAYS RELY ON THIS DATE OF THE ACTUAL TRANSACTION "captured_at_timestamp": 0, "subscriber_id": 91953, "subscription_id": 59451, "tip_id": null, # NOT NULL IF TIP "comment": "Thank you!", # A USER MESSAGE FROM THE TIPPING FORM "profile_id": 1, "type": "subscription_fee" # CAN BE: "subscription_fee", "contribution", "tip" }, "pledger": { "email": "[email protected]", "nickname": "John Doe", "id": 91953, "pledger_type": "subscriber" } }, "event": "payment_succeed", # CAN BE: "payment_disputed", "payment_succeed" "project": "r", "timestamp": 1573138672
Please test it out using http://webhook.site/ before going fully live.