api-lambda-stripe-charge
api-lambda-stripe-charge copied to clipboard
Tutorial on how to use this API for beginners
Hi, I'm fairly new to AWS cloud services and I'm using Stripe for the first time to make a Checkout with Subscription. It would be lovely if you could share a tutorial for beginners, or a YouTube link like you mentioned in ReadMe.
I am planning to use this api-lambda-stripe-charge for backend, and ngx-stripe-checkout for the front-end (Angular/Ionic).
I completed the first 3 setup steps. And for 4 and 5(note that the integration part in this link https://stripe.com/docs/checkout#integration is no longer there) I believe this ngx-stripe-checkout has a different way of calling the checkout, but I'm guessing the functionality should be the same:
// For Recurring Payments
// Invoke this function on button click
openSubscriptionCheckout() {
var checkoutOptions: RecurringCheckoutOptions = {
items: [{
plan: 'your plan id',
quantity: 'quantity'
}],
successUrl: 'https://example.com/payment/success',
cancelUrl: 'https://example.com/payment/failure'
}
this.stripe.openRecurringCheckout(checkoutOptions);
}
Now I cannot test the functionality, because our company account is not yet activated. I'm guessing Stripe doesn't let us call Checkout with TEST products, because I get the following error:
IntegrationError: No such plan: '<my TEST plan id here>'
But I'm trying to set the code-base until the account is ready, as we are close on our deadline. I am kind of confused about how the lambda function will be triggered, after I make a checkout call to Stripe. Shouldn't there be a connection between Stripe and our backend to handle charges/refunds etc.? Should I call the lambda API from frontend in success/cancel pages? I would appreciate it one can enlighten me.