Documentation - Khoros Flow
  • Getting started
  • Triggers & Replies
  • Actions
  • Integrations
  • Guides
  • API

›Payments

Actions

  • Overview
  • When and why
  • Code actions

    • Overview
    • Payload
    • Toolbelt
    • API Calls
    • Configuration
    • Triggering Events
    • Sending Replies
    • Params
    • Managing State
    • Debugging

    Webhook actions

    • Overview
    • Receiving calls
    • Sending Replies

    Zapier actions

    • Overview

    Payments

    • Overview
    • Stripe Single Purchase
    • Stripe Prepared Product Purchase
    • Examples of Stripe Purchases

    Webviews

    • Overview
    • Article
    • Date Picker
    • Radio select
    • Multiple Select
    • Terms

Stripe Prepared Product Purchase

This function allows you to use an existing Stripe product's SKUs that could be purchased inside your flow.

Notes

This method does not support metadata.

Prerequisites

Enabling Checkout

You need to enable the Checkout client-only integration within the Stripe Checkout settings.

One-time purchase products

Flow.ai supports only One-time purchase products. Double check you have chosen the proper option when creating a new Stripe product.

Usage example

async payload => { 
  const url = await payments.preparedPurchase.stripe({
    key: 'your_stripe_publishable_key',
    locale: 'nl',
    collectAddress: true,
    submitType: 'donate',
    items: [
      {
        sku: 'sku_of_your_product', quantity: 1
      },
      {
        sku: 'sku_of_your_another_product', quantity: 3
      }
      ],
    onSuccess: {
      eventName: 'bought',
      params: [
        new Param('category', 'clothes')
        ]
    },
    onFailure: {
      eventName: 'not bought',
      params: [
        new Param('category', 'clothes')
        ]
    }
  })
  
  const buttons = new Buttons('Purchase my items')
  buttons.addButton(new Button({
    label: 'Click to purchase',
    type: 'payment',
    value: url
  }))

  const message = new Message(`Purchase items here ${url}`)
  message.addResponse(buttons)

  return message
}

Properties

PropertyTypeExampleDescriptionRequired
keystringpk_test_XXXXXXXXXXXYour Stripe Publishable KeyYes
collectAddressbooleantrueWhether Checkout should collect customer's address
localestringnlBy default, Checkout detects the locale of the customer’s browser and displays a translated version of the page in their language, if it is supported. You can also provide a specific locale for Checkout to use instead
submitTypestringdonateSubmit type of payment session
button.labelstringClick to purchaseLabel of the confirmation button

Success and Failure params

You can include onSuccess and onFailure configuration which will be used in corresponding situations.

PropertyTypeExampleDescriptionRequired
eventNamestringboughtEvent name to trigger when items are successfully bought / purchase is rejected
paramsarraynew Param('productiId', 112234)Parameters that are set when the items are bought / purchase is rejected

Items

The multiple select is based on a number of items. Each individual item should contain sku and quantity properties.

Properties

PropertyTypeExampleDescriptionRequired
skustringsku_XXXXXXXXXXXSKU of your productYes
quantitynumber1Amount of items to be purchasedYes
← Stripe Single PurchaseExamples of Stripe Purchases →
  • Notes
  • Prerequisites
    • Enabling Checkout
    • One-time purchase products
  • Usage example
  • Properties
  • Success and Failure params
  • Items
    • Properties
Docs
Getting StartedBasic conceptsGuides
Platform
StatusSlack community
Resources
Blog
Copyright © 2021 Khoros Flow