Description
The Tempo payment method's built-in HTML script hardcodes the pay button as "Continue with {Tempo SVG logo}" and ignores the text.pay config that the server correctly passes through Html.init.
Current behavior
// src/tempo/server/internal/html/main.ts:76
button.innerHTML = 'Continue with <svg aria-label="Tempo" ...>...</svg>'
Setting text.pay has no effect on the button:
tempo.charge({
html: {
text: { pay: "Buy Now" }
}
})
// Button still shows "Continue with {Tempo logo}"
Expected behavior
The button text should update when text.pay is set, while preserving the default "Continue with {Tempo logo}" when no override is provided.
What works
The data pipeline is correct. Verified each step:
Charge.ts passes text to the html options
Mppx.ts:938 serializes text (including pay) into the page's JSON data
Html.init exposes it as c.text.pay on the context
main.ts ignores c.text.pay entirely
Other text fields work correctly:
text.title > <title> tag
text.paymentRequired > badge label in header
text.expires > expiry prefix
Design question
The tricky part is the default behavior. Right now the default button has the Tempo SVG logo baked in. A few options:
- Always show
{text.pay} {logo} so custom text still gets the logo ("Buy Now {logo}")
- Show logo only for the default, plain text for custom. But there's no clean way to distinguish "user set pay to 'Pay'" from "default 'Pay'" on the client side without adding a flag
- Pass a config flag like
config.customPayText from the server so the client knows whether to use the branded layout or plain text
Would love to hear the thoughts on this. Happy to open a PR once there's alignment on the approach.
Context
Found while building the MPP Playground HTML builder, which lets developers customize the payment page visually. All other text overrides work, only the button text doesn't update.
Description
The Tempo payment method's built-in HTML script hardcodes the pay button as
"Continue with {Tempo SVG logo}"and ignores thetext.payconfig that the server correctly passes throughHtml.init.Current behavior
Setting
text.payhas no effect on the button:Expected behavior
The button text should update when
text.payis set, while preserving the default "Continue with {Tempo logo}" when no override is provided.What works
The data pipeline is correct. Verified each step:
Charge.tspassestextto the html optionsMppx.ts:938serializestext(includingpay) into the page's JSON dataHtml.initexposes it asc.text.payon the contextmain.tsignoresc.text.payentirelyOther text fields work correctly:
text.title><title>tagtext.paymentRequired> badge label in headertext.expires> expiry prefixDesign question
The tricky part is the default behavior. Right now the default button has the Tempo SVG logo baked in. A few options:
{text.pay} {logo}so custom text still gets the logo ("Buy Now {logo}")config.customPayTextfrom the server so the client knows whether to use the branded layout or plain textWould love to hear the thoughts on this. Happy to open a PR once there's alignment on the approach.
Context
Found while building the MPP Playground HTML builder, which lets developers customize the payment page visually. All other text overrides work, only the button text doesn't update.