Skip to content

Commit 9201848

Browse files
authored
fix: token retrieval fix and margin (#1082)
1 parent 16b857c commit 9201848

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/Payments/CardPayment.res

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ let make = (
77
~expiryProps: CardUtils.expiryProps,
88
~cvcProps: CardUtils.cvcProps,
99
~isBancontact=false,
10+
~isVault=None,
1011
) => {
1112
open PaymentType
1213
open PaymentModeType
@@ -438,10 +439,14 @@ let make = (
438439

439440
let compressedLayoutStyleForCvcError =
440441
innerLayout === Compressed && cvcError->String.length > 0 ? "!border-l-0" : ""
442+
let vaultClass = switch isVault {
443+
| Some(_) => "mb-[4px] mr-[4px] ml-[4px] mt-[4px]"
444+
| None => ""
445+
}
441446

442447
<div className="animate-slowShow">
443448
<RenderIf condition={showFields || isBancontact}>
444-
<div className="flex flex-col" style={gridGap: themeObj.spacingGridColumn}>
449+
<div className={`flex flex-col ${vaultClass}`} style={gridGap: themeObj.spacingGridColumn}>
445450
<div className="flex flex-col w-full" style={gridGap: themeObj.spacingGridColumn}>
446451
<RenderIf condition={innerLayout === Compressed}>
447452
<div

src/Payments/CardVault.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ let make = () => {
165165
let dict = res->getDictFromJson
166166
let sessionResponse = dict->getStrArray("associated_payment_methods")
167167
let paymentToken = sessionResponse->Array.get(0)
168-
if paymentToken->Option.isNone {
168+
if paymentToken->Option.isSome {
169169
let msg =
170170
[("paymentToken", paymentToken->Option.getOr("")->JSON.Encode.string)]->Dict.fromArray
171171

@@ -226,7 +226,7 @@ let make = () => {
226226
}, (cardNumber, cardExpiry, cvcNumber))
227227

228228
<div ref={contentRef->ReactDOM.Ref.domRef}>
229-
<CardPayment cardProps expiryProps cvcProps />
229+
<CardPayment cardProps expiryProps cvcProps isVault=Some(true) />
230230
</div>
231231
}
232232

0 commit comments

Comments
 (0)