Skip to content

Direct Payment Gateways (Stripe & PayPal)

Direct payment gateways let you sell credits straight through Stripe Checkout or PayPal without running a separate e-commerce plugin. The Wbcom Credits SDK that powers the credit system bundles both gateways, so all you do is paste your keys and a webhook URL.

History: the 1.0.x releases shipped a built-in Stripe integration with its own API-key fields and a /wcb/v1/stripe/webhook endpoint. That was removed in 1.1.0 - the old Stripe options are deleted automatically on upgrade. Since 1.2.0 the credit system uses the Wbcom Credits SDK, which exposes Stripe and PayPal as Direct Payment Gateways under a single webhook namespace. This guide covers the current (1.2.0+) gateway model. If you already sell through WooCommerce or a membership plugin, use the adapter guides instead - you do not need a direct gateway as well.

  • You do not run WooCommerce or a membership plugin and don’t want to install one just to sell credits.
  • You want a one-click hosted checkout (Stripe Checkout or PayPal) where cardholder data never touches your site.

If you already have WooCommerce, PMPro, or MemberPress, the adapter path is simpler - skip this page.

  1. Go to WP Career Board -> Settings -> Credits.
  2. Scroll to the Direct Payment Gateways card.
  3. Expand the Stripe or PayPal block.

Each gateway block renders inline on this card - there is no separate Stripe tab and no publishable/secret-key field outside this block. All gateway settings save to a single option (wbcom_credits_gateway_settings_wp-career-board).

Stripe uses Stripe Checkout (hosted by Stripe), so cardholder data never reaches your server.

Field Notes
Enable Stripe Turns the gateway on. Until this is on and a secret key is set, Stripe is reported as unavailable.
Mode Test or Live.
Publishable key (active mode) From Stripe -> Developers -> API keys.
Secret key (active mode) From the same screen.
Webhook signing secret The whsec_... value Stripe shows after you add the webhook endpoint (below).
Post-purchase redirect Where the buyer lands after a successful payment. Optional - defaults to your site home with a success flag.
Cancel-redirect URL Where the buyer lands if they cancel. Optional.

The Credits card shows the exact webhook URL to paste into Stripe. It looks like this:

https://yourdomain.com/wp-json/wbcom-credits/v1/wp-career-board/webhook/stripe

In your Stripe Dashboard go to Developers -> Webhooks -> Add endpoint, paste that URL, and subscribe to exactly these two events:

  • checkout.session.completed
  • charge.refunded

Copy the endpoint’s signing secret (whsec_...) into the Webhook signing secret field. Without the webhook, employers can pay but never receive credits, and refunds will not credit back.

Field Notes
Enable PayPal Turns the gateway on.
Client ID From developer.paypal.com -> Apps & Credentials (Merchant REST app).
Client secret From the same app.
Webhook ID The ID of the webhook you create in the PayPal app settings (below).
  1. Create a Merchant REST app at developer.paypal.com -> Apps & Credentials. Copy the Client ID and secret into the fields above.
  2. In App settings -> Features, tick Accept payments and Refund. No other scopes are needed.
  3. In App settings -> Webhooks, add a webhook endpoint and copy its Webhook ID into the Webhook ID field.

The Credits card shows the PayPal webhook URL:

https://yourdomain.com/wp-json/wbcom-credits/v1/wp-career-board/webhook/paypal

Subscribe the webhook to exactly these two events:

  • PAYMENT.CAPTURE.COMPLETED
  • PAYMENT.CAPTURE.REFUNDED
  1. The buyer starts a credit checkout. The SDK calls the gateway and redirects to the hosted checkout page (Stripe Checkout or PayPal).
  2. After payment, the gateway sends a webhook to the URL above.
  3. The SDK verifies the signature, cross-checks the amount, and writes a topup row to the credit ledger - the balance updates automatically.
  4. A refund issued from the provider dashboard fires the refund event, and the SDK writes a matching deduct row, returning the credits.

Every webhook is processed once. Duplicate deliveries do not double-credit.

For Stripe, set Mode to Test, use test-mode keys, and pay with Stripe’s test card 4242 4242 4242 4242 (any future expiry, any CVC). Confirm a topup row appears in the employer’s credit ledger.

For PayPal, use a sandbox app and a sandbox buyer account.

Note: keep test and live credentials separate. Switching Mode to Live (Stripe) or swapping in live app credentials (PayPal) makes the next purchase a real charge.