@@ -169,7 +169,7 @@ const CheckoutFormElements = ({
169169 < PaymentSourceMethods
170170 checkout = { checkout }
171171 paymentSources = { paymentSources }
172- totalDueNow = { checkout . totals . totalDueNow || checkout . totals . grandTotal }
172+ totalDueNow = { checkout . totals . totalDueNow }
173173 onPaymentSourceSubmit = { onPaymentSourceSubmit }
174174 isSubmitting = { isSubmitting }
175175 />
@@ -192,12 +192,17 @@ const CheckoutFormElements = ({
192192 < AddPaymentSource
193193 checkout = { checkout }
194194 onSuccess = { onAddPaymentSourceSuccess }
195- submitLabel = { localizationKeys (
196- 'userProfile.__experimental_billingPage.paymentSourcesSection.formButtonPrimary__pay' ,
197- {
198- amount : `${ ( checkout . totals . totalDueNow || checkout . totals . grandTotal ) . currencySymbol } ${ ( checkout . totals . totalDueNow || checkout . totals . grandTotal ) . amountFormatted } ` ,
199- } ,
200- ) }
195+ // @ts -ignore TODO(@COMMERCE): needs localization
196+ submitLabel = {
197+ checkout . totals . totalDueNow . amount > 0
198+ ? localizationKeys (
199+ 'userProfile.__experimental_billingPage.paymentSourcesSection.formButtonPrimary__pay' ,
200+ {
201+ amount : `${ checkout . totals . totalDueNow . currencySymbol } ${ checkout . totals . totalDueNow . amountFormatted } ` ,
202+ } ,
203+ )
204+ : 'Subscribe'
205+ }
201206 />
202207 </ __experimental_PaymentSourcesContext . Provider >
203208 </ Disclosure . Content >
@@ -283,9 +288,15 @@ const PaymentSourceMethods = ({
283288 } }
284289 isLoading = { isSubmitting }
285290 >
286- { /* TODO(@COMMERCE): needs localization */ }
287- Pay { totalDueNow . currencySymbol }
288- { totalDueNow . amountFormatted }
291+ { totalDueNow . amount > 0 ? (
292+ < >
293+ { /* TODO(@COMMERCE): needs localization */ }
294+ Pay { totalDueNow . currencySymbol }
295+ { totalDueNow . amountFormatted }
296+ </ >
297+ ) : (
298+ 'Subscribe'
299+ ) }
289300 </ Button >
290301 </ Form >
291302 ) ;
0 commit comments