This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #828 from mirumee/refactor/gateways-hoisting
Hoist payment gateways for the whole checkout
- Loading branch information
Showing
13 changed files
with
190 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,15 @@ | ||
import { ICardData, IFormError, IPaymentGateway } from "@types"; | ||
import { IFormError } from "@types"; | ||
|
||
export interface IPromoCodeDiscount { | ||
voucherCode?: string | null; | ||
} | ||
|
||
export interface IProps { | ||
gatewayErrors?: IFormError[]; | ||
promoCodeErrors?: IFormError[]; | ||
paymentGateways: IPaymentGateway[]; | ||
promoCodeDiscount?: IPromoCodeDiscount; | ||
promoCodeDiscountFormRef?: React.RefObject<HTMLFormElement>; | ||
promoCodeDiscountFormId?: string; | ||
addPromoCode: (promoCode: string) => void; | ||
removeVoucherCode: (voucherCode: string) => void; | ||
submitUnchangedDiscount: () => void; | ||
/** | ||
* Selected payment gateway. | ||
*/ | ||
selectedPaymentGateway?: string; | ||
/** | ||
* Selected payment gateway token. | ||
*/ | ||
selectedPaymentGatewayToken?: string; | ||
/** | ||
* Called when selected payment gateway is changed. | ||
*/ | ||
selectPaymentGateway: (paymentGateway: string) => void; | ||
/** | ||
* Gateway form reference on which payment might be submitted. | ||
*/ | ||
gatewayFormRef?: React.RefObject<HTMLFormElement>; | ||
gatewayFormId?: string; | ||
/** | ||
* Method called after the form is submitted. Passed gateway id and token attribute will be used to create payment. | ||
*/ | ||
processPayment: ( | ||
gateway: string, | ||
token: string, | ||
cardData?: ICardData | ||
) => void; | ||
/** | ||
* Method called when gateway error occured. | ||
*/ | ||
onGatewayError: (errors: IFormError[]) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.