Stripe Elements

How to accept card payments with Stripe Elements

Take card payments on your booking page with Stripe Elements.

Countries

  • Australia
  • Austria
  • Belgium
  • Brazil
  • Bulgaria

Currencies

  • AED
  • AFN
  • ALL
  • AMD
  • ANG
  • AOA
  • ARS
DocumentationContact
API credentials
  • API key
  • Publishable key
  • Webhook secret

Stripe Elements puts Stripe's card fields on your booking page, so travellers pay by card without leaving it. You need a Stripe account that takes live payments: the Stripe guide shows how to open one.

Copy your keys from Stripe


  1. 1

    Open your API keys in live mode

    Open dashboard.stripe.com/apikeys and check that you are in live mode, not a sandbox. A test key does not fail: it marks bookings paid with money that does not exist.

  2. 2

    Copy the publishable key

    Under Standard keys, copy the Publishable key. It starts with pk_live_.

  3. 3

    Copy the secret key

    Copy the Secret key (click Reveal live key if it is hidden). It starts with sk_live_. Keep it private: it can charge cards in your name.

Add the webhook in Stripe


The webhook marks bookings paid

Without it, travellers are charged and their bookings stay unconfirmed.

Your TourTask webhook address for Stripe Elements

https://api.tourtask.com/v1/payments/stripe-elements/notifications/booking
  1. 1

    Create an event destination

    Open dashboard.stripe.com/webhooks, still in live mode, and click Create an event destination.

  2. 2

    Choose your account and Snapshot

    Select Your account and the Snapshot payload format: TourTask cannot read the Thin events Stripe recommends.

  3. 3

    Select the event

    Select payment_intent.succeeded and no other event.

  4. 4

    Choose a webhook endpoint

    Click Continue and select Webhook endpoint as the destination type.

  5. 5

    Enter the TourTask address

    Click Continue, paste the TourTask address above into Endpoint URL and click Create destination.

  6. 6

    Copy the signing secret

    On the destination's page, click Reveal secret and copy the signing secret. It starts with whsec_.

One endpoint for each gateway

Already have an endpoint for the Stripe gateway? Add a new one anyway: each gateway needs its own.

Add Stripe Elements in TourTask


  1. 1

    Open the Stripe Elements card

    Go to Configuration → Payment options and click the Stripe Elements card under Online payments → Payment gateways. Not there? Choose Show all gateways under the cards.

  2. 2

    Choose the country and currency

    Pick the Country where your Stripe Elements account and its bank account are, and the Currency travellers pay in. Click Add. To change either later, remove Stripe Elements with Remove and add it again.

  3. 3

    Fill in your API credentials

    Under Authentication, the card has a field for each:
    API key
    Publishable key
    Webhook secret

    Each field saves when you click out of it.

  4. 4

    Activate Stripe Elements

    Click Activate once every field is filled in. The card turns Active, and travellers can pay with Stripe Elements on your booking page. Every payment goes straight into your own Stripe Elements account: TourTask never holds your money.

API key: your sk_live_… secret key
Publishable key: your pk_live_… key
Webhook secret: your whsec_… signing secret

Open it by default (optional)

Click Open by default on the card to show the card form open at the top of your booking page.

Check that Stripe Elements works


TourTask has no test mode for Stripe Elements, and Stripe's terms forbid test payments with real cards.

  1. 1

    Open the card form

    On your own booking page, book a tour and choose to pay by card: Stripe's card form shows. Close the page without paying.

  2. 2

    Cancel the test booking

    Open the booking in TourTask and click Cancel booking.

  3. 3

    Check your first payment

    When a traveller pays by card, the booking shows as paid and the payment appears in your Stripe Dashboard.

  4. 4

    Check the webhook

    In Stripe, open the destination's Event deliveries tab: payment_intent.succeeded shows as Delivered.

Charged, but not paid in TourTask?

Check the webhook in Stripe: live mode, Snapshot format, the event payment_intent.succeeded and the exact address. In TourTask, Webhook secret must hold this endpoint's signing secret. The destination's Event deliveries tab in Stripe shows each failed attempt.

Add Apple Pay and Google Pay


Apple Pay and Google Pay are gateways of their own, set up like Stripe Elements with the same two keys. Each needs its own webhook endpoint at its own address, and that endpoint's signing secret goes in its Webhook secret.

Apple Pay

https://api.tourtask.com/v1/payments/apple-pay/notifications/booking

Google Pay

https://api.tourtask.com/v1/payments/google-pay/notifications/booking
Register your web addresses in Stripe

Unlike the card form, wallet buttons show only on addresses registered in Stripe under Settings → Payment method domains. Register every address travellers book on: your own website, yourname.tourtask.com and your TourTask website (yourname.tourtask.site or its own domain). example.com and www.example.com are two entries.

Questions we get asked


No. The card goes straight from the traveller's browser to Stripe.

Stripe Elements keeps travellers on your booking page; Stripe sends them to Stripe's own page and back. You can run both.

The ones switched on in your Stripe Dashboard's payment methods settings. Cards are on by default.

No. TourTask converts the booking total into the currency you chose for the gateway.

Was this page helpful?