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: pay now button text & theme based changes #223

Merged
merged 8 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion src/Components/PayNowButton.res
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ let make = (
Utils.handlePostMessage([("handleSdkConfirm", confirmPayload)])
}

let buttonText =
sdkHandleConfirmPayment.buttonText->String.length > 0
? sdkHandleConfirmPayment.buttonText
: localeString.payNowButton

React.useEffect4(() => {
if showFields {
if selectedOption === Card {
Expand Down Expand Up @@ -104,7 +109,7 @@ let make = (
{if showLoader {
<Loader />
} else {
localeString.payNowButton->React.string
buttonText->React.string
}}
</span>
</button>
Expand Down
3 changes: 3 additions & 0 deletions src/Types/PaymentType.res
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ type billingAddress = {

type sdkHandleConfirmPayment = {
handleConfirm: bool,
buttonText: string,
confirmParams: ConfirmType.confirmParams,
}

Expand Down Expand Up @@ -259,6 +260,7 @@ let defaultBillingAddress = {

let defaultSdkHandleConfirmPayment = {
handleConfirm: false,
buttonText: "",
confirmParams: ConfirmType.defaultConfirm,
}

Expand Down Expand Up @@ -896,6 +898,7 @@ let getConfirmParams = dict => {

let getSdkHandleConfirmPaymentProps = dict => {
handleConfirm: dict->getBool("handleConfirm", false),
buttonText: dict->getString("buttonText", ""),
confirmParams: dict->getDictfromDict("confirmParams")->getConfirmParams,
}

Expand Down
Loading