)}
);
}
function ButtonsSection(): VNode {
if (payResult) {
if (payResult.type === ConfirmPayResultType.Pending) {
return (
Processing...
);
}
return ;
}
if (payStatus.status === PreparePayResultType.PaymentPossible) {
return (
{i18n.str`Pay`} {amountToString(payStatus.amountEffective)}
);
}
if (payStatus.status === PreparePayResultType.InsufficientBalance) {
return (
{balance ? (
Your balance of {amountToString(balance)} is not enough to pay
for this purchase
) : (
Your balance is not enough to pay for this purchase.
)}
{i18n.str`Withdraw digital cash`}
);
}
if (payStatus.status === PreparePayResultType.AlreadyConfirmed) {
return (
{payStatus.paid && contractTerms.fulfillment_message && (
)}
{!payStatus.paid && }
);
}
return ;
}
return (
{i18n.str`Digital cash payment`}
{payStatus.status === PreparePayResultType.AlreadyConfirmed &&
(payStatus.paid ? (
payStatus.contractTerms.fulfillment_url ? (
Already paid, you are going to be redirected to{" "}
{payStatus.contractTerms.fulfillment_url}
) : (
Already paid
)
) : (
Already claimed
))}
{payResult && payResult.type === ConfirmPayResultType.Done && (
Payment complete
{!payResult.contractTerms.fulfillment_message
? "You will now be sent back to the merchant you came from."
: payResult.contractTerms.fulfillment_message}