Skip to content

Commit

Permalink
Updates recurly-js types
Browse files Browse the repository at this point in the history
  • Loading branch information
recurly-integrations authored Apr 16, 2024
1 parent 7f801fd commit e9de7f7
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 11 deletions.
5 changes: 5 additions & 0 deletions types/recurly__recurly-js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// Type definitions for non-npm package @recurly/recurly-js 4.28
// Project: https://github.com/recurly/recurly-js
// Definitions by: Christopher Rogers <https://github.com/chrissrogers>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
import { Recurly } from './lib/recurly';

declare global {
Expand Down
4 changes: 2 additions & 2 deletions types/recurly__recurly-js/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 All @@ -37,4 +37,4 @@ export interface AmazonPayInstance extends Emitter<AmazonPayEvent> {
renderButton: (element: string) => void;
}

export type AmazonPay = (amazonPayOptions?: AmazonPayOptions) => AmazonPayInstance;
export type AmazonPay = (amazonPayOptions?: AmazonPayOptions) => AmazonPayInstance;
5 changes: 0 additions & 5 deletions types/recurly__recurly-js/lib/apple-pay/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@ export type ApplePayConfig = {
* Callbacks for the events emitted by the payment session when a user selects options in the payment sheet.
*/
callbacks?: {
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onPaymentMethodSelected?: (event: ApplePayPaymentMethodSelectedEvent) => Promise<ApplePaySelectionUpdate> | ApplePaySelectionUpdate | void,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onShippingContactSelected?: (event: ApplePayShippingContactSelectedEvent) => Promise<ApplePaySelectionUpdate> | ApplePaySelectionUpdate | void,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onShippingMethodSelected?: (event: ApplePayShippingMethodSelectedEvent) => Promise<ApplePaySelectionUpdate> | ApplePaySelectionUpdate | void,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onCouponCodeChanged?: (event: ApplePayCouponCodeChangedEvent) => Promise<ApplePaySelectionUpdate> | ApplePaySelectionUpdate | void,
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onPaymentAuthorized?: (event: ApplePayPaymentAuthorizedEvent) => Promise<ApplePayErrorUpdate> | ApplePayErrorUpdate | void,
};

Expand Down
1 change: 0 additions & 1 deletion types/recurly__recurly-js/lib/google-pay/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export type GooglePayOptions = {
*/
callbacks?: {
onPaymentDataChanged?: (intermediatePaymentData: GooglePayIntermediatePaymentData) => Promise<GooglePayPaymentDataRequestUpdate>;
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onPaymentAuthorized?: (paymentData: GooglePayPaymentData) => Promise<GooglePayPaymentAuthorizationResult> | void;
},
};
Expand Down
1 change: 0 additions & 1 deletion types/recurly__recurly-js/lib/recurly.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export interface Recurly extends Emitter<RecurlyEvent> {
*/
PayPal: PayPal;


/**
* Use Recurly to process Amazon Pay v2 transactions
*
Expand Down
1 change: 0 additions & 1 deletion types/recurly__recurly-js/test/apple-pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
ApplePaySelectionUpdate,
} from '@recurly/recurly-js';

// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
function getTaxes ({ paymentMethod: { billingContact } }: ApplePayPaymentMethodSelectedEvent): ApplePaySelectionUpdate | void {
if (billingContact?.postalCode === '12345') {
return { newLineItems: [{ label: 'Tax', amount: '1.00' }] };
Expand Down
1 change: 0 additions & 1 deletion types/recurly__recurly-js/test/google-pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export default function googlePay () {
buttonColor: 'black',
},
callbacks: {
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
onPaymentAuthorized: (paymentData: GooglePayPaymentData): Promise<GooglePayPaymentAuthorizationResult> | void => {
if (paymentData.email === '[email protected]') {
return Promise.reject({
Expand Down

0 comments on commit e9de7f7

Please sign in to comment.