-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close button on the save credit card frame #105
Comments
Thanks for issue.
This is unknown trouble. What is this platform? (iOS, Android, Web), and What is method??(PaymentSheet, PaymentFlow, GooglePay, ApplePay) Thanks. |
I use PaymentFlow method on Android device. My StripeService : export class StripeService {
processFlow: 'willReady' | 'Ready' | 'canConfirm' = 'willReady';
constructor(
private paymentService: PaymentService
) {
}
async _initializer(): Promise<void> {
Stripe.addListener(PaymentFlowEventsEnum.Loaded, () => {
this.processFlow = 'Ready';
console.log('PaymentFlowEventsEnum.Loaded');
});
Stripe.addListener(PaymentFlowEventsEnum.FailedToLoad, () => {
console.log('PaymentFlowEventsEnum.FailedToLoad');
});
Stripe.addListener(PaymentFlowEventsEnum.Completed, () => {
this.processFlow = 'willReady';
console.log('PaymentFlowEventsEnum.Completed');
});
Stripe.addListener(PaymentFlowEventsEnum.Canceled, () => {
this.processFlow = 'willReady';
console.log('PaymentFlowEventsEnum.Canceled');
});
Stripe.addListener(PaymentFlowEventsEnum.Failed, () => {
this.processFlow = 'willReady';
console.log('PaymentFlowEventsEnum.Failed');
});
Stripe.addListener(PaymentFlowEventsEnum.Created, (info) => {
console.log(info);
this.processFlow = 'canConfirm';
});
await Stripe.initialize({
publishableKey: environment.stripePK,
});
}
async createPaymentFlow(firebaseId: string, productID: number): Promise<void> {
const paymentSheetData = await
this.paymentService
.createStripePaymentFlow(firebaseId, productID);
await Stripe.createPaymentFlow({
paymentIntentClientSecret: paymentSheetData.paymentIntent,
customerId: paymentSheetData.stripeCustomerID,
customerEphemeralKeySecret: paymentSheetData.ephemeralKey,
merchantDisplayName: 'Saveurs application mobile',
});
}
async showCreditCardForm(): Promise<void> {
await Stripe.presentPaymentFlow();
}
async confirmPaymentSuccess(): Promise<boolean> {
const result = await Stripe.confirmPaymentFlow();
console.log('===== 1 Confirm paymentFlow');
console.log('===== 2 result paymentFlow => ' + JSON.stringify(result));
return (result.paymentResult === 'paymentFlowCompleted');
}
} And the method of my angular component : async subscriptionProcess() {
await
this.stripeService
.createPaymentFlow(this.user.uid, environment.subscriptionProductID)
.then(async () => {
await
this.stripeService
.showCreditCardForm()
.then(async () => {
await this.stripeService.confirmPaymentSuccess();
});
});
} |
This is not plugin issue, your code issue. You must create flow:
Please check demo work . Thanks. |
Sorry it's my fault. |
Thanks for this great plugin.
I implemented on IONIC application and it work perfectly.
However when i process a new payment with a credit card i registered before, and i change my mind and want to cancel, the button "close" launch payment anyway.
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: