Skip to content
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

fix: Amazon Pay should be emitting the 'cancel' event when the window is manually closed #879

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/recurly/amazon/amazon-pay.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AmazonPay extends Emitter {
type: Frame.TYPES.WINDOW,
defaultEventName
}).on('error', cause => this.emit('error', cause)) // Emitted by js/v1/amazon_pay/cancel
.on('close', () => this.emit('error', 'closed')) // Emitted by RJS Frame when the window is manually closed
.on('close', () => this.emit('cancel')) // Emitted by RJS Frame when the window is manually closed
.on('done', results => this.emit('token', results)); // Emitted by js/v1/amazon_pay/finish
}

Expand Down
2 changes: 1 addition & 1 deletion types/lib/amazon-pay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type AmazonPayOptions = {
sandbox?: boolean;
};

export type AmazonPayEvent = 'ready' | 'token' | 'error' | 'close' | 'done';
export type AmazonPayEvent = 'ready' | 'token' | 'error' | 'cancel' | 'done';

export interface AmazonPayInstance extends Emitter<AmazonPayEvent> {
/**
Expand Down
Loading