Stripe payment system - client version v3 - Apps Script integration

963 views
Skip to first unread message

Alan Wells

unread,
Dec 5, 2019, 5:01:08 PM12/5/19
to Google Apps Script Community
I am providing an example of the latest Stripe payment code, integrated into Apps Script.

The shared Apps Script file is at:

The published Web App is at:

The Apps Script file uses the client side Stripe example code from GitHub, plus custom server side code to complete the payment.

The GitHub code is only client side HTML, CSS and JavaScript.  The Stripe GitHub example does not include Apps Script server code.
There is GitHub examples of server side stripe code, but that code is not easily convertible to Apps Script.

My example is a complete system including the Apps Script server code to complete the Stripe charge.

Stripe client side code is in version 3.  The server side API for stripe is technically still in version 1, but the API versions are controlled by a date, and not a number.  Which API date version you are using is controlled through your Stripe dashboard.

The code includes 5 different payment form examples.  You can see the original stripe code on GitHub code at:

The payment forms are not prebuilt charge forms, but use the stripe elements.
The example is for an "in-app" payment solution.  The user is not directed to another site, like your web site for payment or payment confirmation.

Alan Wells

unread,
Dec 13, 2019, 8:45:50 PM12/13/19
to Google Apps Script Community
I have uploaded the Stripe version 3 example code to GitHub at link:

--Hyde

unread,
Dec 14, 2019, 4:39:03 PM12/14/19
to Google Apps Script Community
Hi Alan,

Thank you for contributing the code and docs. The readme at Github looks especially helpful.

Cheers --Hyde

KeMonté Jones

unread,
Jan 5, 2020, 12:05:10 AM1/5/20
to Google Apps Script Community
Hello, I have a script that I would like to add in-app payments to, however, not sure how to go about it. If someone could help, I could pay a small fee.

Andrew Roberts

unread,
Jan 5, 2020, 5:35:36 AM1/5/20
to Google Apps Script Community
Hi KeMonté,

I've developed an (open source) subscription management library, - Subs - that I could help you integrate into your Add-on. Drop me a line (and...@roberts.net) if you would like to talk further.

Andrew

Craig Pearce

unread,
May 31, 2020, 11:31:30 PM5/31/20
to Google Apps Script Community
I've copied the project and inserted test keys but I still get the error message that the keys need to be added.  Is there some other step I am missing?

Craig

Andrew Roberts

unread,
Jun 1, 2020, 7:08:04 AM6/1/20
to google-apps-sc...@googlegroups.com
Test keys for what? If you are talking about the payment method, that is managed by a layer of code that sits above the Subs library.

Could you share the code you have so far?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/6050d692-9781-4d36-bcd7-b84dd69e8785%40googlegroups.com.

Alan Wells

unread,
Jun 1, 2020, 7:44:31 AM6/1/20
to Google Apps Script Community
You need to find the line of code that produced the error.  If that line of code is not the real cause of the error, then you need to track back through the code to find where the error is.  To find the line of code that produced the error, you can look at the execution transcript, or if the error handling caught the error, then that should have provided some clues.

Craig Pearce

unread,
Jun 1, 2020, 11:04:06 AM6/1/20
to Google Apps Script Community
@aj.addons found the underbars comment.  Was that added to make sure people were reviewing code?  :)

Craig

Alan Wells

unread,
Jun 1, 2020, 11:15:03 AM6/1/20
to Google Apps Script Community
I can't remember exactly why I put that in, but I probably wanted to avoid an accidental request to Stripe, or something like that.
Glad you found it, and hopefully it's working now.

Craig Pearce

unread,
Jun 1, 2020, 11:17:39 AM6/1/20
to Google Apps Script Community
Are you currently using this in any add-ons in the marketplace?  I'm currently in the middle of approval and honestly I thought G Suite Marketplace would have built in charging ability, but my research tells me that is not true.  I'm wondering if I should pause approval and implement your solution.  Thoughts?

Craig

Alan Wells

unread,
Jun 1, 2020, 11:25:57 AM6/1/20
to Google Apps Script Community
Well, if you want to gain users, you could offer the add-on for free if the payment system isn't in place yet.
The only reason that I'd pause the approval is if you need to change your scopes, or if you find something broken.
There are people who will try out a new add-on, but when your add-on is new, it could have some bugs, and then you're risking getting bad or average reviews and they stay there forever, even after you've made improvements.
Reply all
Reply to author
Forward
0 new messages