Update record after stripe payment / checkout

Hey All,

Here’s the situation I’m trying to acheive:

  1. the users fill out a form, which creates a record in airtable. (wich checkbox ‘payment complete’ unchecked)
  2. users pays the corresponding amount via Stripe
  3. After payment is complete, find the record in airtable and check the checkbox ‘payment complete’.

I’ve created the form for step one. But I don’t know how to connect the stipe payment to the record. For example, is there a way to pass metadata (recordid) to stripe or something? That way, I could use Zapier to update the record in Airtable.

Thanks

Ok. I’m a bit further, but not completely there yet.

So let me rephrase my question: Is there a way to pass the Record ID to stripe checkout?

Hi edwinvdg, any progress on this issue? I am interested in implementing something similar so any advice you have or resources you can point me to would be much appreciated.

Hi @siyu , nope. Did not find a fitting solution, so I had to create a workaround. And that workaround is as follows:

  • Someone needs to fill out a form (with email address) which goes into a record in airtable
  • pay in stripe (hopefully with same email address)
  • Using Zapier, I check whether the email address matches. Then I update that record.
1 Like

Thanks for sharing the workaround you figured! What site is this? Is there a live version I can check out? I wonder what it’s like as far as user experience goes. Thanks either way!

Hi @siyu. The site is in dutch, but here it is: https://niet-niks.nl. And the specific experience, you can find here: https://www.niet-niks.nl/kist-detail?recordId=recpkQX9g6ofAZwod

1 Like

Hey @edwinvdg I have a situation quite similar to yours. I realize you faced this issue some time ago, I was wondering if you figured out a more seamless way to update a record after stripe payment. In my case, users might have multiple records and they might need to pay for and update one of them, so the email matching might not work, the actual record ID might be needed. thanks

@edwinvdg email is indeed one option. How do you generate stripe payment links? If it’s in Airtable can’t you attach metadata like it’s mentioned here ? Attaching metadata to Stripe Payment Link - Stack Overflow

Hey @TJ-Pitchstr , for now this solutions works quite ok. So didn’t search for a better one. Did you find one in the meantime?

Adding metadata in the Stripe link would be awesome, but how can we do that in Softr?

1 Like

Hi,
I found a way to achieve this. Basically you want to pass the metadata to stripe using the payment link. There is a functionality in Stripe, in the edit payment link page that allows you to generate the URL including an email or a client ID (record ID).

Once you have the right URL, you create a column in your airtable base with a formula that includes the payment link URL+the parameters you want to pass to stripe. For example, I’m passing the email adress of the user and the record ID.

Finally, in Softr you need to include an action button that will be the one the user will click to pay. This action button should open a URL. You can select to obtain the URL from airtable, so you select the one in your cell that contains the payment link with the metadata.

Then in Make or Zappier, you create the automation that when the payment in stripe is done, the corresponding record is updated. You will have the record informationa and email as part of the payment metadata.

I hope this is understandable and useful for your use case, I have tested and is working for me.

2 Likes

Hey there! I have followed your steps, however when I get to the “include a button with URL created in Airtable (that includes the variable)” I don’t see how we can do that:

There is no way in the pricing tables or any other button to call for a variable in airtable, right? At least I cannot see it :sweat:

Thanks for your help!

You can actually create a webhook in airtable and stripe to cut out zapier in this case

Do you have an example on how to do that? I would be very interested

The way I currently have it setup is I make a URL using a calculated field iin Airtable and adding the parameters I want to get back in a combined string.

EG: Variable1 & “-” & Variable2 & “-” & Variable3
Note: Its important to separate them by ‘-’ as no other character will work

Then my second calculate field is the stripe url

EG: “https://yourstripegateway/yourpayment?client_reference_id=stringfromothercalculatedfield

Now in softr, I use a modal to show my payment gateway, but this will also work as long as you display the URL you just made, once a payment is made, it will track the string you’ve created

To get the data back to Airtable after the payment is complete you need to do 3 things;

  1. Setup the listener in Stripe, in your stripe in you products there will be an option to add webhooks to the payment, I’m using checkout.session to track mine, but there are heaps you can use to trigger the webhook.

  2. Create a new automation in Airtable and have the trigger as a webhook, copy this url and paste it into the stripe endpoint from the previous step.

  3. Below the webhook, run a script that does whatever you want with the data you’re parsing through.

For step 3, depending on how much coding experience you have, I’m more than happy to help write something for you, but the general structure would be something like this (my code):

Here, price and data are parsed in via input variables which are taken from the webhook

let {data, price} = input.config();
// Split the input string
let [property, requestedBy] = data.split('_');

// Determine the report type based on the price
let reportType;
if (price === 15000) {
    reportType = 'Preliminary Site Investigation';
} else if (price === 40000) {
    reportType = 'Detailed Site Investigation';
} else if (price === 90000) {
    reportType = 'Comprehensive Site Investigation';
} else {
    throw new Error('Invalid price');
}

// Reference to the tables
let table = base.getTable('Property Reports');

// Create a record in the table
await table.createRecordAsync({
    'My Properties': [{ id: property }],
    'Requested by': [{ id: requestedBy }],
    'Report Type': {name: reportType},
});

If that all makes sense give it a go, if not let me know where you got lost and I’ll provide screenshots of stuff.

Hey Harry I am very interested in the solution that you had shared. It seems it is possible to bypass Make/Zapier to accept payments before updating Airtable. I have some questions though such as how to show the stripe checkout page based on the unique form information. Can I DM you about them?

Yeh sure sent me a DM and I’ll see what I can do

1 Like