Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. const stripe = window['Stripe'](this.configuration.api_key, {
  2. stripeAccount: this.configuration.stripeAccount
  3. });
  4.  
  5. return stripe.retrievePaymentIntent(secret)
  6. .then(result => {
  7. console.log(`Found payment intent with status ${result.paymentIntent.status}`);
  8. return stripe.handleCardAction(secret);
  9. })
  10. .then(({ paymentIntent, error }) => {
  11. return new Promise<TransactionVendorReference>((resolve, reject) => {
  12. if (error) {
  13. reject(error);
  14. return;
  15. }
  16.  
  17. const reference: TransactionVendorReference = {
  18. vendor: this.configuration.vendor,
  19. object: paymentIntent.object,
  20. id: paymentIntent.id
  21. };
  22. resolve(reference);
  23. });
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement