简体   繁体   中英

AWS Lambda process Stripe charge

I'm new to Lambda and trying to figure out how to process Stripe charge in Lambda function.

My app creates token from Stripe API and now I need to send that token to Lambda function to execute Stripe.customers.create and Stripe.charges.create .

Here are the issues I'm having

  1. I'm not sure how to load <script type="text/javascript" src="https://js.stripe.com/v2/"></script> into Lambda function so I can use Stripe function

  2. Would love to get a sample code to charge credit card by token

Thank you.

You don't want to load Stripe.js into Lambda here, as that's meant to be used in the browser; rather, you'll want to use the stripe-node library for this.

You'll find an example here: https://github.com/TaylorBriggs/stripe-lambda

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM