Extra Horizon
GitHub
  • Extra Horizon Documentation
  • Getting Started
    • Start familiarizing yourself
  • Tutorials
    • Medical Device Tutorial
      • Preparation
      • Build your first prototype
        • Define a data model
        • Configure your workflows
          • Workflow 1: Analyze a measurement
          • Workflow 2: Create & store a PDF report
          • Workflow 3: Send an e-mail
        • Define your permissions
          • Update your schema with user permissions
          • Update your schema with group permissions
        • Build the Front-End
          • Set up oAuth in your backend
          • Demo login page
      • Summary & Wrap up
    • Polysomnography (PSG) Tutorial
    • Retool - Building dashboards Tutorial
  • FAQ
    • General
  • Services
    • Identity and Access Management
      • User service
        • Users
        • Groups
        • Global roles
        • Configuration
      • Auth Service
        • Applications
        • OAuth2
        • OAuth1
        • MFA
        • OpenID Connect
          • Google Cloud
          • Azure ADFS
    • Data Management
      • File Service
      • Data Service
        • Schemas
        • Documents
        • FAQ Data Service
    • Automation
      • Task Service
        • Functions
        • Tasks
        • API Functions
        • Examples
          • Hello world (JS)
          • Hello world (Py)
          • Hello world (Docker)
        • FAQ
      • Dispatchers Service
      • Event Service
        • System Events
    • Communication
      • Notification Service
        • Notifications
        • Settings
      • Mail Service
    • Other
      • Localization Service
        • Language Codes
      • Template Service
        • Localizations
      • Payments Service
        • Subscriptions
        • Stripe
        • iOS App Store
      • Configurations Service
  • API Reference
    • OpenAPI Specifications
    • 📦Changelog
      • Per-service Changelog
    • Postman Reference Collection
  • Tools
    • SDK
    • CLI
    • Control Center
  • Additional Resources
    • Resource Query Language (RQL)
    • Handling Errors
    • GitHub
    • API interaction (Python)
    • Migration guide: Enabling verification request limiting
  • ExH Platform
    • 🙋Support
    • ⏱️Usage and Performance
    • 🔓Security
    • 🗺️Regions
    • ⚖️Cloud Subscription Agreement
    • 🇺🇸CFR 21 Part 11
Powered by GitBook
On this page

Was this helpful?

  1. Services
  2. Other
  3. Payments Service

Stripe

PreviousSubscriptionsNextiOS App Store

Last updated 3 years ago

Was this helpful?

Stripe.com offers 2 different APIs for payments :

    • Charge

In our code base we have implemented both APIs. The preferred is the payment intent API.

As of September 2019, a regulation called (SCA) requires businesses in Europe to request additional authentication for online payments. Businesses in Europe must start building their Stripe integrations with the and APIs instead of the Sources API to be ready for these rule changes.

Usage guide

Complete a basic payment for a basic order

  1. Make a product (when no product exist in your environment) POST /products

  2. Create an order linked to a payment intent POST /stripe/paymentIntents with in the body the property productId with the value from the product of step 1

  3. In the response body from the request, in step 2, will be the property stripeClientSecret store its value as well as the orderId

  4. Make sure you can

  5. Use the "stripeClientSecret" (from step 3) in the

  6. Poll the order page with the id (from step 3) GET /orders?id=... until the response contains the property status with value task_started (if it never changes to task_started, contact the Extra Horizon team)

  7. You have now successfully completed a payment for an order

Payment in a currency different from the default (EUR)

  1. Make a product POST /products with the body containing "prices": { "eur": { "amount": 1000 }, "usd": { "amount": 1500 } }

  2. Create an order linked to a payment intent POST /stripe/paymentIntents with the body containing "productId": ...(from step1), "currency": "usd"

  3. Follow step 3, 4, 5 and 6 from "Complete a basic payment for a basic order"

  4. You have now successfully completed a payment with a currency different from the default (EUR)

Payment method type different from the default (card)

In this service we have implemented 4 different payment method types from the stripe.com api: The default payment method type is card (visa, mastercard, ...). The other 3 supported types are: bancontact, giropay and ideal.

  1. Follow step 1 from "Complete a basic payment for a basic order"

  2. Create an order linked to a payment intent POST /stripe/paymentIntents with the body containing "productId": ...(from step1), "paymentMethodType": "bancontact"

  3. Follow step 3 and 4 from "Complete a basic payment for a basic order"

  4. Follow step 6 from "Complete a basic payment for a basic order"

  5. You have now successfully completed a payment with a different payment method type (bancontact) than the default (card)

You can repeat the process above but instead of specifying bancontact as the paymentMethodType (in step 2) specify giropay or ideal. You'll need to use the respective confirm...Payment method in step 4.

Recurring payments

First create a payment intent with the setupPaymentMethodReuse option set to offSession:

POST /stripe/paymentIntent

{
  "productId": "5ce26e7a2b9e674d0c7fd3d6",
  "setupPaymentMethodReuse": "offSession"
}

Use the returned stripeClientSecret to complete the payment with Stripe.

Then the payment_method returned by Stripe can be submitted reuse it later on:

POST /stripe/users/5d3f321b59080100065b2ee7/paymentMethods

{
  "stripeId": "pm_1FPngmI6N8mPcPA74shsTsmP"
}

Now that the payment method is saved it can be used for future payments.

The saved payment method can be specified during the creation of a payment intent. Adding the paymentMethodId and offSession: true to the request make the API try to automatically complete the payment intent:

POST /stripe/paymentIntent

{
  "productId": "5ce26e7a2b9e674d0c7fd3d6",
  "paymentMethodId": "5d961cd8adf66e0402c188ca",
  "offSession": true
}

Setup payment details without initial payment

First create a setup intent with the setupPaymentMethodReuse option set to offSession:

POST /stripe/setupIntents

{
  "setupPaymentMethodReuse": "offSession"
}

Use the returned stripeClientSecret to complete the setup with Stripe using the confirmCardSetup method in stripe.js.

Use the "stripeClientSecret" (from step 3) in the

See stripe.com documentation for more information about the confirm..Payment method:

Payment intent (API)
Legacy API
Source
Strong Customer Authentication
Payment Intents
Payment Methods
handle the payment method details on your frontend
stripe.confirmCardPayment method to complete the payment on the stripe.com service
stripe.confirmBancontactPayment method to complete the payment on the stripe.com service
bancontact
giropay
ideal