# Run a custom action when purchase is successful

**URL:** <https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401>\
**Category:** Ask for Help\
**Created:** [December 28, 2020, 10:05pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401 "2020-12-28T22:05:18Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 28, 2020, 10:05pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/1 "2020-12-28T22:05:18Z")

</div>

Is it possible to run an custom action when a buy was successful and set colums in the user profile?

---

<div class="post-metadata">

**Author:** ![eltintero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eltintero/32/76520_2.png) [@eltintero](https://community.glideapps.com/u/eltintero)\
**Post date:** [December 28, 2020, 10:17pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/2 "2020-12-28T22:17:40Z")

</div>

I’ve done it without actions, duplicating the App: Sales tab, and using that do to a relation back to the user.  
I think I have a tutorial for this in [jesusvargas.glideapp.io](http://jesusvargas.glideapp.io)

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 29, 2020, 9:03am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/3 "2020-12-29T09:03:00Z")

</div>

Another Problem.

The user can change the email in the buy button screen.  
So I have no chance to connect the buy with the user profile.

The email field should be locked or the Row-ID of the profile should be written to the app:buy tab.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/1/d1b74762e9e2e2c141281d573781fe554f9aac44.png)

Here the emails in the profile.  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/b/6b04eac9825a3bfad8f5374fb4aea5d35e0283b3.png)

How can I match this when the user edits the mail while buying?

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [December 29, 2020, 10:23am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/4 "2020-12-29T10:23:14Z")

</div>

@Jacktools_Net that is a concern I have that users can change their email address that would return a no match. Be interesting to know if there was a way round this, although not seen an answer to this.

I do put a message on the previous screen to warn users not to change their email address on the buy screen.

Have you actually experienced anyone changing their email address?

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 29, 2020, 11:38am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/5 "2020-12-29T11:38:00Z")

</div>

The app is not published at the moment but while testing i run into this problem.  
Adding a text to inform the user is a good idear, but enable this field by glide would be nicer.

But at the moment I have to wait until the user can purchase recurrent (monthly/ yearly) payments.

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [December 29, 2020, 12:37pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/6 "2020-12-29T12:37:09Z")

</div>

Other community members have worked out how to do membership - maybe this will help?

> [@Tutorial for paid memberships with Zapier & Memberful](https://community.glideapps.com/t/tutorial-for-paid-memberships-with-zapier-memberful/7877):
>
> Just finished a video tutorial on how to monetize your app with paid memberships using using Glide, Zapier, and Memberful which I noticed a lot of people were asking for here in the community. The tutorial is for a recipe app, but you could use this logic for any type of app with premium content. There are 6 lessons and it takes about an hour to go through. [You can access the tutorial here at nocode.mba/courses/allrecipes](https://www.nocode.mba/courses/allrecipes) The tutorial includes: Building a recipe app Adding the ability to off…

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 29, 2020, 12:43pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/7 "2020-12-29T12:43:30Z")

</div>

Thank you for the link. I will check it out. Unfortunately my no code stack is a little bit different. Let’s see what i can do with integromat and stripe or paypal.

---

<div class="post-metadata">

**Author:** ![Rosewebstudio](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rosewebstudio/32/12261_2.png) [@Rosewebstudio](https://community.glideapps.com/u/Rosewebstudio)\
**Post date:** [December 29, 2020, 1:10pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/8 "2020-12-29T13:10:13Z")

</div>

@Jacktools_Net you can do it 😉

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 29, 2020, 2:53pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/9 "2020-12-29T14:53:05Z")

</div>

Step One:  
Create a Business Profile whre the user can add the business information.

Step Two:  
Let’s create Integromat a new Customer when a new line is added to the Business Profile.

Sounds like a challange.

---

<div class="post-metadata">

**Author:** ![Steven](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/steven/32/15309_2.png) [@Steven](https://community.glideapps.com/u/Steven)\
**Post date:** [December 29, 2020, 2:54pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/10 "2020-12-29T14:54:42Z")

</div>

I have done it without an action in the past using a unique id value. I am sure you can do the same with an action as well. Best of luck.

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [December 30, 2020, 4:13pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/12 "2020-12-30T16:13:05Z")

</div>

So after some research the Stripe Customerportal looks prommising.

This is how my [Integromat](https://www.integromat.com/?pc=jacktoolsnet) scenario looks like. It works for stripe test and productive environment.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/d/fd5c66580e905512655db7781527005600ce63bf.png)

If the user has no customer Id in his profile the scenario creates a user, saves the new id in the profile sheet and open the customer portal.  
If the user has a customer id then the scenario opens the customer portal.

On the glide site it is a simple button with open url as action.

![customer_portal](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/8/58915dc1df3c690dc588b2dfe65c9c4e3a240aa6.gif)

Now the customer has a nice place where he can manage his plans and bills i guess.

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [January 1, 2021, 7:37pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/13 "2021-01-01T19:37:09Z")

</div>

Ok after a few days of learning I have to say it is straight forward to use glide and integromat with the customer portal of stripe.

Checkout:  
 ![checkout (1)](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/9/f9e19bc209649dede20fddf0965b1f9ae8795edc.gif)

Upgrade:  
 ![upgrade](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/4/74a34e803583ca4e0633ca45e5bdaff0f1cf07dd.gif)

Cancle:  
 ![cancle](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/5/f/5f4f77b449ec474970a4c3e86d2a8b4daffd26e8.gif)

---

<div class="post-metadata">

**Author:** ![George\_Lewis1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_lewis1/32/5517_2.png) [@George\_Lewis1](https://community.glideapps.com/u/George_Lewis1)\
**Post date:** [January 18, 2021, 12:06am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/14 "2021-01-18T00:06:08Z")

</div>

This looks great, any thoughts on using this to make one off payments?

I just set up the new webhooks action to trigger a charge to a customer set up on Stripe through integromat, I’m then thinking to send the successful payments to gsheets and then use some logic to show payment successful.

I’m keeping stripe customer ID and card ID outside of gsheets and glide, just using lookups in integromat data. But I’m not a developer and still a little concerned with security with this method though…

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [January 18, 2021, 3:01am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/15 "2021-01-18T03:01:53Z")

</div>

I think, when I get you right, for one time payment you can use the buy button component from glide.  
I only have the customer id in my g sheet but with row owner column.  
Oh and I have the price ids in the product sheets.

---

<div class="post-metadata">

**Author:** ![George\_Lewis1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_lewis1/32/5517_2.png) [@George\_Lewis1](https://community.glideapps.com/u/George_Lewis1)\
**Post date:** [January 18, 2021, 3:42am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/16 "2021-01-18T03:42:12Z")

</div>

Thanks Jack, sounds like a good set up.

I have been using the normal buy button, but running into some issues… hence the experimentation!

> [@Using Math column for Price in Stripe buy button](https://community.glideapps.com/t/using-math-column-for-price-in-stripe-buy-button/8926/13):
>
> Hey @Mark
> 
> Given limitations with row owners and computed columns, I’m using a formula in a separate google sheet to calculate the price. Which I thought was ok.
> 
> However, because of the lag (~10 seconds) if the user changes something (in my case time duration), they can then click through to pay before the price has updated.
> 
> I tried an ‘if statement’ to check value matches the same calc done in a glide computed column before allowing them to proceed. However, even when it updates in gsheets and then the data editor (where the checks are made allowing them to proceed), there’s still a delay to the app and the user can click through to buy before the price is updated.
> 
> I can’t think of any other ways to get the correct amount. Any thoughts? Or any roadmap timelines or priorities on buy button functionality?
> 
> Thanks,  
> George

---

<div class="post-metadata">

**Author:** ![Jacktools\_Net](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jacktools_net/32/18500_2.png) [@Jacktools\_Net](https://community.glideapps.com/u/Jacktools_Net)\
**Post date:** [January 18, 2021, 4:43am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/17 "2021-01-18T04:43:26Z")

</div>

Perhaps this is a posible solution for you:

> [@Easily create payment links in a lot of countries](https://community.glideapps.com/t/easily-create-payment-links-in-a-lot-of-countries/20638):
>
> This looks like an interesting option to make payment links. And you can do that automatically as well with a template. In our Dashboard, you can create payment links, but with your own personal payment page, you can create payment requests without creating, just via a custom URL. Save time with creating payment links, just use dynamic links like: [payrequest.me/name/12,50](http://payrequest.me/name/12,50) or even [payrequest.me/12,50/title/email](http://payrequest.me/12,50/title/email) Examples Dynamic Payment Links [payrequest.me/name/$3,40](http://payrequest.me/name/%243,40)[payrequest.me/nam…](http://payrequest.me/name/3,40/invoice-3494)

---

<div class="post-metadata">

**Author:** ![George\_Lewis1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/george_lewis1/32/5517_2.png) [@George\_Lewis1](https://community.glideapps.com/u/George_Lewis1)\
**Post date:** [January 18, 2021, 9:23am UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/18 "2021-01-18T09:23:31Z")

</div>

Ah thanks for your help, appreciate it. I tried this, but didn’t like the user could update the amount in the URL.

I’m using Stripe connect for transfer payments and billing for subscriptions. So may keep testing this option or just do a stripe checkout each time. Or hopefully Glides payment functionality is updated or I can find a workaround to keep it in the app.

---

<div class="post-metadata">

**Author:** ![Mark\_Turrell](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/mark_turrell/32/26605_2.png) [@Mark\_Turrell](https://community.glideapps.com/u/Mark_Turrell)\
**Post date:** [April 9, 2021, 9:27pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/19 "2021-04-09T21:27:13Z")

</div>

I saw this complaint about PayRequest - this makes it a no-no!

[  
George\_Lewis1](https://community.glideapps.com/u/George_Lewis1)

[Jan 18](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/18)

"Ah thanks for your help, appreciate it. I tried this, but didn’t like the user could update the amount in the URL.

I’m using Stripe connect for transfer payments and billing for subscriptions. So may keep testing this option or just do a stripe checkout each time. Or hopefully Glides payment functionality is updated or I can find a workaround to keep it in the app."

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [April 9, 2021, 11:19pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/20 "2021-04-09T23:19:54Z")

</div>

Not sure if this is still a problem, but in my agency apps I have used PayHere’s URL method recently and has no problems with that. Very reliable.

---

<div class="post-metadata">

**Author:** ![Wim\_De\_Coninck](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/wim_de_coninck/32/28179_2.png) [@Wim\_De\_Coninck](https://community.glideapps.com/u/Wim_De_Coninck)\
**Post date:** [March 31, 2022, 1:02pm UTC](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401/21 "2022-03-31T13:02:28Z")

</div>

Hi,

I checked the 3th lesson in [Glide Lessons](https://jesusvargas.glideapp.io/dl/ewAiAHQAIgA6ADQALAAiAHMAIgA6ACIAYwBsAGEAcwBzAC0ATABlAHMAcwBvAG4AcwAiACwAIgByACIAOgAiADAAVQBQAEUAZQBLAGUAMwBUAFkARwBSADEARAA0ADgAMwBOAGgATQBVAEEAIgAsACIAbgAiADoAIgBMAGUAcwBzAG8AbgAgADMAIgB9AA%3D%3D) to send mail when a new row is added.  
But is it also possible to use this method for sending an email if a certain column XY has one particular value? The value in my app depends on several calculations when users change something in other fields, but I want to send an email if the cell has a value "WARNING.

So as long as the column has a value different from “warning”, nothing has to be done, but if a user changes some fields whereby the value in column XY automatically changes to “warning”, I want a mail to be sent.

Thanks for helping.

Wim

[Next page](https://community.glideapps.com/t/run-a-custom-action-when-purchase-is-successful/20401.md?page=2)
