how to get source id from stripe using angular 9

227 Views Asked by At

i have used ngx stripe but this source id is wrong

@ViewChild(StripeCardComponent) card: StripeCardComponent;

cardOptions: StripeCardElementOptions = { hidePostalCode:true, style: { base: { iconColor: '#666EE8', color: '#31325F', fontWeight: '300', fontFamily: '"Helvetica Neue", Helvetica, sans-serif', fontSize: '18px', '::placeholder': { color: '#CFD7E0' } } } };

CREATE TOKEN

elementsOptions: StripeElementsOptions = { locale: 'es' };

createToken(): void {
const name = this.stripeTest.get('name').value;
this.stripeService
  .createSource(this.card.element, {  })
  .subscribe((result) => {
    console.log(result)
    this.sourceId=result.source.id;

   
    
  });

}strong text

0

There are 0 best solutions below