Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.3.2
- Add `HostedFields.updateStyles(styles)` to apply new custom styles at runtime without reloading the iframes (requires hosted fields 1.1.9+)

### 1.3.1
- Remove hostedpages domain support
- Update readme
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ HostedFields in turn will expose these functions
* setup
* get
* reset
* updateStyles
* setClickToPayTransactionAmount
* clickToPayCheckout

Expand Down Expand Up @@ -226,6 +227,18 @@ var container = document.querySelector(el);
Lastly eventListener are registered to the iframe so that it picks up postMessage events.


**updateStyles**

If you want to change the custom styles of already rendered hosted fields you can call
```js
HostedFields.updateStyles('any custom styles you wish to include')
```
It takes the same styles string as the `styles` property of the setup config and applies it to all rendered fields at runtime, without reloading the iframes. Works for both `single` and `multiple` renderMode.

> [!NOTE]
> Runtime style updates require hosted fields version 1.1.9 or above (the `hostedfieldsurl` version). On older versions the update is ignored and the styles from setup remain.


**setClickToPayTransactionAmount** *(used for ClickToPay integration)*

It's used when the transaction amount should be dynamically changed.
Expand Down
2 changes: 1 addition & 1 deletion dist/esm/sdk/api/actions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading