Skip to main content

Stripe

Stripe Settings

Setting
Test modeCheck this box if you want to enable Stripe's test mode - payments will not actually be processed. See Stripe documentation for more information, such as card numbers that you can use for testing.
Live Publishable keyThis value is from the API keys page in your Stripe dashboard (in live mode). This key is not needed while you are using test mode.
Live Secret keyThis value is from the API keys page in your Stripe dashboard (in live mode). This key is not needed while you are using test mode.
Test Publishable keyThis value is from the API keys page in your Stripe dashboard (in test mode). This key is only needed if you are using test mode.
Test Secret keyThis value is from the API keys page in your Stripe dashboard (in test mode). This key is only needed if you are using test mode.
Webhook signing secretCreate a webhook in your Stripe dashboard (here for live mode, or here for test mode). For the webhook URL, set /?wpz_payments_webhook=stripe. The webhook should be set to listen to the following events: charge.succeeded, charge.failed, and charge.refunded. After creating the webhook, you will have the option to reveal the signing secret - enter that value here.
CurrencyEnter a currency abbreviation (usually 3 or 4 letters) from Stripe's supported currencies list.

Testing Stripe Payments

In order to test stripe payment, the "Test mode" option needs to be enabled at Payments > Settings tab.

See here for test card numbers

Webhook Information

In order for payment statuses to be automatically updated in the WP admin when they change in Stripe (e.g. a payment clears, or a payment is refunded), a webhook needs to be created in the Stripe dashboard (https://dashboard.stripe.com/webhooks or https://dashboard.stripe.com/test/webhooks in test mode) as follows:

Webhook URL: Site homepage + ?dsdpm_webhook=stripe (e.g. https://example.com/?dsdpm_webhook=stripe)

Events: charge.succeeded, charge.failed, charge.refunded (other events that are sent by Stripe to the webhook listener are currently just ignored with a success response code)

The webhook's signing secret needs to be saved in the plugin settings

Currently, only payment status changes (succeeded, failed, refunded) are processed by the webhook. No other types of payment changes are processed (except that the payment failure message is recorded when provided).

If a webhook is sent for a payment that is not registered in the database records of the module, it is ignored with a success response code. This allows for other Stripe integrations to use the same account.

Various HTTP error codes may be sent by the webhook handler:

400: A required field was missing from the webhook data

401: The Stripe webhook signing secret is not specified in the plugin settings or is incorrect, or the webhook signature was not provided or could not be verified, or the webhook signature timestamp is too old

500: The payment could not be updated for some reason