ao link
Affino

How to Setup Stripe

Overview

Stripe is one of several payment gateways that you can setup in Affino.

 

Stripe is the only payment gateway we recommend for continuous credit and debit card payments.

 

In this guide, you will learn how to set up Stripe as one of the many payment options available.

 

When this is done, your clients will be able to purchase products using Stripe.

 

Note:

There are three levels of integration with Stripe:

  1. Simple one off payments
  2. Simple continuous and ongoing payments
  3. Advanced continuous and ongoing payments, with accounts, discounts, tax reports and more

All of these will need varying levels of setup within Stripe itself.

Begin Set Up

To setup your Stripe payment gateway (or view your current payment gateways) access the Payment Gateway screen:

  • Control > Commerce > Payment Gateways

Add Payment Gateway

  • To add the new Stripe payment gateway, click the +Add button:

Payment Gateway Selection

  • From the Payment Gateway Selection screen, choose Stripe.

Payment Gateway Edit

  • After this, you will be shown the Payment Gateway Edit screen.

Step 1.- Name the Payment Gateway

  • This could be simply “Stripe” or whichever you prefer.

Step 2.- Select which Run Mode is operational on this Payment Gateway

  • Choose between Live or Test Mode
  • Live makes for genuine transactions
  • Until the gateway goes Live, Test Mode should be selected

Stripe Help: stripe.com/docs/keys#test-live-modes

Step 3.- Insert the Publishable Key

  • This key comes from Stripe
  • Your publishable API key identifies your website to Stripe during communications.

Stripe Help: stripe.com/docs/stripe-js/v2#setting-publishable-key

Step 4.- Insert the Secret Key

  • This key comes from Stripe
  • Secret API keys should be kept confidential and only stored on your own servers.
  • Your account’s secret API key can perform any API request to Stripe without restriction.

Help on API Keys: stripe.com/docs/keys

Step 5.- Webhook URL

  • This is auto generated by Affino
  • The webhook URL is placed in Stripe

Copy-paste the Webhook URL into Stripe so that it generates the Webhook Signing Secret. After this, place the Stripe Webhook Signing Secret and save.

 

Stripe Help: stripe.com/docs/webhooks

 

Further notes >

 

Orders will be cancelled for the following events:

  • failed / subscription_schedule.canceled / customer.subscription.deleted

On Stripe, set the following Event Types:

  • subscription_schedule.created / charge.succeeded / subscription_schedule.canceled
  • customer.source.expiring / charge.failed / customer.subscription.deleted

 

Step 6.- Webhook Signing Secret

  • This is generated by Stripe
  • You need this to verify signatures

 

You can retrieve your endpoint’s secret from your Stripe Dashboard by going to Developer > Webhooks:

 

 

Add a new Endpoint:

 

 

Insert the Webhook URL into the Endpoint URL field:

 

 

Insert the Stripe generated endpoint’s secret

 

- into the Webhook Signing Secret field:

 

 

Stripe Help: stripe.com/docs/webhooks/signatures

Step 7.- Use Tax Rate For Subscription checkbox

  • When ticked, Affino will pass the Tax Rules External ID to Stripe
  • This ID needs to be same as the Tax Rate ID in Stripe

Stripe Tax Rate ID and Affino Tax Rule External ID

 

Stripe: Dashboard > Tax Rates

Affino: Control > Commerce > Tax Rules

 

If you are setting up a Subscription, then please bear in mind that you need to create a new Tax Rate in Stripe (dashboard.stripe.com/tax-rates):

 

 

- and subsequently copy and paste the Tax Rate ID from Stripe:

 

 

 - to the Tax Rule External ID in Affino:

 

 

Note: Tax in Stripe must be set up as Exclusive to match Affino.

Currently, Affino does not support Inclusive tax rates.

 

Stripe help: stripe.com/docs/billing/taxes/tax-rates

 

 

Affino Catalogue Item and Stripe Product integration

  • Affino: Control > Commerce > Catalogue Items
  • Stripe: Dashboard > Products

In order for you to sell a subscription in Affino with Stripe, you must first create a product in your Stripe dashboard:

 

 

After it has been created, copy and paste the product API Price ID:

 

 

- and place it in the catalogue item External ID field:

 

 

Please note: If you have catalogue items with several prices (and currencies) you will need to:

  • Use a single price/currency
  • or
  • Create a catalogue item, one for each price/currency

Currently, you will need to create a separate catalogue item, one for each price/currency (with a matching Stripe price plan) as we do not have an External ID field in the Catalogue Item for each row within the price matrix to match each Stripe Price ID.

 

Stripe help: stripe.com/docs/billing/prices-guide

Step 8. Use Coupons For Subscriptions checkbox

  • When ticked , Affino will pass the Coupon External ID to Stripe
  • This ID needs to be same as the Coupon ID in Stripe

Step 9: Use Renewal Catalogue Item Price And Tax

Select to pass the Renewal Catalogue Item's External ID and Tax Rule External ID to Stripe if a Renewal Catalogue Item exists.

 

If not selected, the Renewal Catalogue Item will still be used to generate the renewal order but Stripe will continue to renew on the existing price and tax rule.

 

NOTE: These ID's need to match the ones in Stripe.

Step 10.- Webhook Integration Script

You have two Integration Script Options:

  • Cookie Integration Script
  • Login Integration Script

Select one of the above if you wish to run custom code / functionality.

Step 11.- Start Renewal Automation (checkbox)

  • Select to initiate the renewal automation scheduled task which will check for and generate subscription renewals

Step 12.- Start Cancellation Automation

  • Select to initiate the cancellation automation scheduled task which will check for subscription cancellations and cancel the payment at the payment gateway.

Step 13.- Live (checkbox)

  • Tick this option if you wish to make this payment gateway active

Step 14.- Save the new Stripe Payment Gateway

  • After this, press the Save button:

Conclusion:

You have now added Stripe as a payment gateway in Affino.

Did you find this content useful?

Thank you for your input

Thank you for your feedback

Driving business at some of the world's most forward thinking companies

Our Chosen Charity

Humanity Direct