WebElementGroup Methods
Update Method
Our SDK allows you to update certain configurations of the Web Elements Group. Just call the update method on the previously initialized WebElementsGroup and pass the the options that you want to update.
webElementsGroup.update(options);
Parameters
Parameter | Required/Optional | Type | Description |
---|---|---|---|
options | optional | object | Update Options |
options
Parameter | Required/Optional | Type | Description |
---|---|---|---|
mode | optional | string | Options are |
currency | optional | string | The three-letter ISO currency code in lowercase. E.g. |
amount | optional | decimal | This amount is shown in Apple Pay and Google Pay Payment Sheets when enabling digital wallets. |
setupFutureUsage | optional | string | Options are
|
paymentMethodTypes | optional | array | Payment methods to be shown. Options for the array are: |
Update Examples
// Assuming a Web Elements Group was created and saved in the webElementsGroup variable
// as done below on lines 4-9
const webElementGroup = gettrx.webElements({
mode: 'payment',
currency: 'usd',
amount: 10.99,
paymentMethodTypes: ['card','us_bank_account']
});
// To perform the update operation, just call the update Method on the variable where you
// initialized the Web Elements group (e.g. webElementsGroup)
webElementGroup.update({
mode: 'setup',
amount: 10.00,
setupFutureUsage: "off_session"
});
Updated about 1 month ago