Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. checkoutHandler.open({
  2.         name: 'Lienzo',
  3.         description: 'Vincula tu tarjeta de crédito.',
  4.         panelLabel: 'Guardar',
  5.         email: billingEmailAddress,//« So that Stripe doesn't prompt for an email address
  6.         locale: 'auto',
  7.         zipCode: false,
  8.         allowRememberMe: false,
  9.         closed: ()=>{
  10.           // If the Checkout dialog was cancelled, resolve undefined.
  11.           if (!hasTriggeredTokenCallback) {
  12.             resolve();
  13.           }
  14.         },
  15.         token: (stripeData)=>{
  16.  
  17.           // After payment info has been successfully added, and a token
  18.           // was obtained...
  19.           hasTriggeredTokenCallback = true;
  20.  
  21.           // Normalize token and billing card info from Stripe and resolve
  22.           // with that.
  23.           let stripeToken = stripeData.id;
  24.           let billingCardLast4 = stripeData.card.last4;
  25.           let billingCardBrand = stripeData.card.brand;
  26.           let billingCardExpMonth = String(stripeData.card.exp_month);
  27.           let billingCardExpYear = String(stripeData.card.exp_year);
  28.  
  29.           resolve({
  30.             stripeToken,
  31.             billingCardLast4,
  32.             billingCardBrand,
  33.             billingCardExpMonth,
  34.             billingCardExpYear
  35.           });
  36.         }
  37.       });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement