nomadreservations / ngx-stripe

Angular 8.x wrapper for StripeJS
41 stars 32 forks source link

Create card for customer #40

Open kkozlowski89 opened 4 years ago

kkozlowski89 commented 4 years ago

Hello,

how to create credit card for customer?

I tried something like this:

this.stripeService.createToken(this.card, {}).subscribe(result => {
            if (result.token) {
                // Use the token to create a charge or a customer
                // https://stripe.com/docs/charges
                console.log('token', result.token);
                console.log('card', this.card);

                this.stripeService.createPaymentMethod('card', this.card, null )
                .subscribe((result) => {

                })

            } else if (result.error) {
                // Error creating the token
                console.log(result.error.message);
            }
        });

but I dont know how to pass third argument? this.stripeService.createPaymentMethod('card', this.card, null )

Perfect would be if I will be able to use this method:

image