#Damian K-google-pay-auth-capture
1 messages · Page 1 of 1 (latest)
yep, this one
Can you share your code?
code sample:```const paymentRequest = this.stripe.paymentRequest({
country: this.countryCode,
currency: this.currency.toLowerCase(),
total: {
label: 'test-payment',
amount: 600,
},
requestPayerName: true,
requestPayerEmail: true
});
const paymentRequestButton = this.elements.create('paymentRequestButton', {
paymentRequest
});
paymentRequest.canMakePayment().then((result) => {
if (result) {
paymentRequestButton.mount('#payment-request-button');
} else {
document.getElementById('payer-request-button').style.display = 'none';
}
});
paymentRequest.on('paymentmethod', (event) => {
this.service.authorizeAction(
{
paymentMethod: event.paymentMethod.id,
countryCode: this.countryCode,
customerId: this.selectedCustomerId,
persistCustomer: true,
someData: this.someData,
clientEmail: this.email,
locale: this.currentLang
}
).subscribe(setupIntentResponse => {
console.log(setupIntentResponse); // << returns clientSecret example: "pi_3KRFLaLK3ksSjRk11FmTg4L8_secret_RHY1hl8QmhHSFp1jggWMwVAF6"
this.service.authorizeSession().subscribe(
() => this._router.navigate(['charging']),
this.handleError.bind(this)
);
})
}```
I believe event.complete('success') will close the Google Pay dialog