-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added paypal tabs flow support for billing details (#792)
Co-authored-by: Pritish Budhiraja <[email protected]>
- Loading branch information
1 parent
5b05ed2
commit a7c7d19
Showing
9 changed files
with
197 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
@react.component | ||
let default: unit => React.element | ||
let default: (~paymentType: CardThemeType.mode, ~walletOptions: array<string>) => React.element |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
open PaymentMethodsRecord | ||
open SessionsType | ||
|
||
type paypalExperienceData = { | ||
paypalToken: optionalTokenType, | ||
isPaypalSDKFlow: bool, | ||
isPaypalRedirectFlow: bool, | ||
} | ||
|
||
let usePaymentMethodExperience = (~paymentMethodListValue, ~sessionObj: sessions) => { | ||
let paypalPaymentMethodExperience = React.useMemo(() => { | ||
getPaymentExperienceTypeFromPML( | ||
~paymentMethodList=paymentMethodListValue, | ||
~paymentMethodName="wallet", | ||
~paymentMethodType="paypal", | ||
) | ||
}, [paymentMethodListValue]) | ||
|
||
let paypalToken = React.useMemo( | ||
() => getPaymentSessionObj(sessionObj.sessionsToken, Paypal), | ||
[sessionObj], | ||
) | ||
let isPaypalSDKFlow = paypalPaymentMethodExperience->Array.includes(InvokeSDK) | ||
let isPaypalRedirectFlow = paypalPaymentMethodExperience->Array.includes(RedirectToURL) | ||
|
||
{ | ||
paypalToken, | ||
isPaypalSDKFlow, | ||
isPaypalRedirectFlow, | ||
} | ||
} |
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
Oops, something went wrong.