Skip to content

Commit

Permalink
chore: added suport for adding email address in paze (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakksham7 authored Nov 19, 2024
1 parent ac8c98a commit 530b202
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Payments/PazeTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ type complete = {
transactionValue: transactionValue,
}

type canCheckoutReturnType = {consumerPresent: bool}
type digitalWalletSdk = {
canCheckout: canCheckout => promise<JSON.t>,
canCheckout: canCheckout => promise<canCheckoutReturnType>,
checkout: checkout => promise<JSON.t>,
complete: complete => promise<JSON.t>,
initialize: initialize => promise<JSON.t>,
Expand Down
6 changes: 3 additions & 3 deletions src/Payments/PazeWallet.res
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ let make = () => {

Console.log2("PAZE --- init completed", val)

let consumerPresent = await digitalWalletSdk.canCheckout({
let canCheckout = await digitalWalletSdk.canCheckout({
emailAddress: emailAddress,
})

Console.log("PAZE --- canCheckout completed")
Console.log2("PAZE --- consumerPresent: ", consumerPresent)
Console.log2("PAZE --- canCheckout: ", canCheckout.consumerPresent)

let transactionValue = {
transactionAmount,
Expand All @@ -61,7 +61,7 @@ let make = () => {

let checkoutResponse = await digitalWalletSdk.checkout({
acceptedPaymentCardNetworks: ["VISA", "MASTERCARD"],
emailAddress,
emailAddress: canCheckout.consumerPresent ? emailAddress : "",
sessionId,
actionCode: "START_FLOW",
transactionValue,
Expand Down

0 comments on commit 530b202

Please sign in to comment.