# \[SOLVED\] Charge a user using saved CC with Stripe?

**URL:** <https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993>\
**Category:** Need help\
**Created:** [June 29, 2016, 12:43am UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993 "2016-06-29T00:43:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [June 29, 2016, 12:43am UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/1 "2016-06-29T00:43:08Z")

</div>

I’m creating a crowd funding app and I’m trying to get the credit cards charged.

The flow of my app consists of:

1. Multiple users pledge an amount that they will pay and I collect their CC information, but don’t charge.  
1.1. A separate record is created in a pledge data type capturing how much each user pledged to pay.
2. Once the item that they are committing to pay for is completed, then the users need to be charged.

I think I should use the “Charge a user using saved CC”, but I’m not sure how to setup the fields in the below screenshot and how to charge all users that have a record(s) in the pledge data type.

![](https://us1.discourse-cdn.com/bubble/original/2X/7/74b0c1a8ba209afc0ce3ef9539be2aab21e80c6a.png)

---

<div class="post-metadata">

**Author:** ![natedogg](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/natedogg/32/79328_2.png) [@natedogg](https://forum.bubble.io/u/natedogg)\
**Post date:** [June 29, 2016, 12:53am UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/2 "2016-06-29T00:53:41Z")

</div>

One option could be to authorize the charge, not just save the CC info.

If you authorize the charge, you can collect the amount using either the Stripe dashboard or an API call. You also won’t have to worry about cards being declined after you’ve collected them. Granted, you’ll need to collect them within 7 days after authorization, or they’ll drop off.

Not sure how this fits into the scope of your app, but just an option.

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [June 29, 2016, 12:56am UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/3 "2016-06-29T00:56:17Z")

</div>

Thanks natedogg, but it could be 30+ days before the users are charged.

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [June 29, 2016, 9:19pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/4 "2016-06-29T21:19:57Z")

</div>

@emmanuel, is this something that the Bubble API could handle? Maybe loop through the Pledge table and charge each user until it finds no more records to charge?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [June 30, 2016, 12:34pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/5 "2016-06-30T12:34:37Z")

</div>

You could schedule a workflow and have a condition on the workflow thing to see if it could actually get ran at the end of the crowdfunding period. Then, it would charge each user. There is a little bit of work but I think it’s doable.

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [June 30, 2016, 12:38pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/6 "2016-06-30T12:38:34Z")

</div>

So you think it’s possible to have it loop through the table and charge each user one-by-one? Just having a hard time figuring out how to loop and setup the “Charge a user using saved CC” with the correct parameters.

I think I may need to hire someone for this – it’s getting a little too complex for my abilities. 🙂

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [June 30, 2016, 12:39pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/7 "2016-06-30T12:39:40Z")

</div>

We have an action to schedule an API workflow on a list of things. That would be useful here

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [June 30, 2016, 12:54pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/8 "2016-06-30T12:54:01Z")

</div>

Yeah, that’s what I’m trying to use, but I don’t quite understand how to set it up, or all of the properties. Like what should the Key be?

Do I need to use the “API Connector” plugin in addition to setting up the “Schedule an API workflow”?

---

<div class="post-metadata">

**Author:** ![emmanuel](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/emmanuel/32/27657_2.png) [@emmanuel](https://forum.bubble.io/u/emmanuel)\
**Post date:** [June 30, 2016, 1:01pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/9 "2016-06-30T13:01:49Z")

</div>

Not sure I see what the API connector has to do with this. You’d be using a stripe action. And the key would be the stripe key. It’s simpler than you think.

---

<div class="post-metadata">

**Author:** ![levon](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/levon/32/89793_2.png) [@levon](https://forum.bubble.io/u/levon)\
**Post date:** [July 5, 2016, 4:55am UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/10 "2016-07-05T04:55:09Z")

</div>

Hi Keith,  
you asked for a private session to help with this, but since it’s not too complicated I will simply mention the solution here:

1. enable APIs for your app
2. Navigate to API workflows (from the page navigation menu)
3. create a new endpoint
4. add amount and user parameters to it as shown on the screenshot  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/a/a12ea819e942512eab6b7079bac03ba3324b5f76.png)
5. create an action for that API workflow as shown on this screenshot (basically user and amount fields will be populated with API workflows’ parameters)  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/3/32d0627d44968a0b127583b707f9aa913fabc7ea.png)
6. now in your main workflow when you schedule the charge you should create an action that’s called "schedule an API workflow on a list of things (see the next screenshot)  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/6/69b1bc951aa7fed53d852ee63f5b56dcbe46344b.png)
7. you will need to define the list of users that have to be charged. Also you need to pass the amount parameter (Which can be static or dynamic). The only thing that I’m not sure of what to pass as a user parameter here. I thought maybe we should remove it but then the charge CC action cannot refer to a user. Maybe @emmanuel could help here?  
Hope this is helpful, if not feel free to let me know.  
Thanks,  
Levon.  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/f/f640ba41a848d396e71eb2c937e8c88295c22b07.png)  
Founder at Bubblewits - Bubble Certified Partner  
[http://bubblewits.com](http://bubblewits.com)  
[http://iambubble.com](http://iambubble.com) - one page Bubble demo  
[http://builtonbubble.com](http://builtonbubble.com) - Collection of apps built on Bubble  
[Dev.zeroqode.com - Reach out if you need help creating something on Bubble](http://forum.bubble.io/t/bubblewits-com-bubble-certified-partner-reach-out-if-you-need-help-creating-something-on-bubble/1834)

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [July 5, 2016, 12:32pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/11 "2016-07-05T12:32:46Z")

</div>

Thanks Levon! I am storing all of the Amounts in another table, different from the user table – let’s call it the “pledges” table. One user could have multiple pledges for one product. So could the “List to run on” search for the sum of all pledges submitted by the user being charged?

I think it would be useful to walk through all of this on a Skype call. What do you think?

---

<div class="post-metadata">

**Author:** ![levon](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/levon/32/89793_2.png) [@levon](https://forum.bubble.io/u/levon)\
**Post date:** [July 5, 2016, 12:49pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/12 "2016-07-05T12:49:56Z")

</div>

Hi Keith, seems like I figured what should be in the user parameter - it should be “this user” and yes, I guess we could sum up all the amounts for each user. I’ll send you a DM now to schedule a skype call.

Thanks,  
Levon.  
 ![](https://us1.discourse-cdn.com/bubble/original/2X/f/f640ba41a848d396e71eb2c937e8c88295c22b07.png)  
Founder at Bubblewits - Bubble Certified Partner

> **[Zeroqode is a suite of no-code products and services for launching your ideas...](https://zeroqode.com)**
>
> No-code apps, plugins for Bubble, native apps builder and more. Now you can build apps without code even faster

[http://iambubble.com](http://iambubble.com) - one page Bubble demo  
[http://builtonbubble.com](http://builtonbubble.com) - Collection of apps built on Bubble

---

<div class="post-metadata">

**Author:** ![nomadkelley](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nomadkelley/32/4986_2.png) [@nomadkelley](https://forum.bubble.io/u/nomadkelley)\
**Post date:** [September 24, 2016, 5:54pm UTC](https://forum.bubble.io/t/solved-charge-a-user-using-saved-cc-with-stripe/3993/13 "2016-09-24T17:54:13Z")

</div>

So I’m trying to do the same thing but when the workflow runs I get this in Stripe.

![](https://us1.discourse-cdn.com/bubble/original/2X/5/5768b51ba7b184291905d323ecf4eb0303f4ecce.png)

What do I need to do to fix this? I can mark as safe in Stripe but what triggered this?
