Saving down details of a transaction
Last updated
Last updated
In order to save down details of a transaction, I suggest creating the following fields in a "transaction" data type in your database:
checkout session id (text)
currency (text)
customer (text)
payment status (text)
total amount (number)
There are also several other fields that I would consider optional (depending on what data you want to retain):
payment intent id (text)
payment method (text)
last 4 digits (text)
You can see an example of such a database setup in this demo app.
You can use the "checkout session id" and the "Retrieve Checkout Session Details" API call to save down details of a transaction.
You'll first need to identify the transaction being processed in the "Success URL" and "Cancel URL" fields when creating the Stripe Checkout Session
You can do this by referencing the unique ID of the transaction as a Page URL Parameter
In the above example, the unique ID of the transaction is being referenced in the "?transaction=Result of step 1 (Create a new Tran...)'s unique id
This means that when you are on the Success URL or Cancel URL page, you can use the unique id of the transaction in the page URL to save down data
You can run a workflow on "page load" that only runs when the "transaction" parameter int the page URL is not empty
You can then use the "Stripe - Retrieve Checkout Session Details" call to update the "payment status" and "currency"
You can see an example of how to do this in the below tutorial video (from 22:36 on)
Saving down data for optional fields
As mentioned above, you may also wish to save down data for fields such as:
payment intent id
You can use the "Stripe - Get Checkout Session Details" call to save down the payment intent id
payment intent method
You can use the "Get Payment Details" call (will require you input the payment intent id) to get the payment intent method
last 4 digits
You can use the "Stripe - Retrieve a Payment Method" call (will require you input the payment intent method) to get the last 4 digits of the card used in the Checkout Session