AMSVaultElementConfiguration

AMSVaultElementConfiguration is used to configure SDK parameters before initializing Vaulting Element.

Declaration

copy
public class AMSVaultElementConfiguration : AMSConfiguration {
    public init()
}

Property

Parameter

Type

Required

Description

locale

String?

No

Preferred language. Composed of a language code (ISO-639) and country code (ISO-3166) connected by an underscore, for example, new Locale("en", "US").

Valid values are:

  • en_US: Default value. English
  • pt_BR: Portuguese (Brazil)
  • pt_PT: Portuguese
  • es_ES: Spanish
  • ko_KR: Korean
  • zh_CN: Simplified Chinese
  • zh_HK: Traditional Chinese
  • ms_MY: Malay
  • in_ID: Indonesian
  • th_TH: Thai
  • vi_VN: Vietnamese
  • tl_PH: Filipino
  • it_IT: Italian
  • de_DE: German
  • fr_FR: French
  • nl_NL: Dutch
  • ja_JP: Japanese
  • ro: Romanian
  • pl_PL: Polish
  • ar_SA: Arabic
  • tr_TR: Turkish
  • hi_IN: Hindi

Note: If no value is passed or the language value passed is not within the above range, the system will default to using English.

options

[String: Any]?

No

Configuration options dictionary, used to pass additional configuration parameters. See Available keys.

Available keys

Key

Data type

Description

sandbox

Bool

Whether to use the sandbox environment.

  • true: sandbox environment.
  • false: Default value. Production environment.

showLoading

Bool

Whether to display a loading animation during the request process.

  • true: Default value. The default loading mode is used.
  • false: The default loading mode is not used. When set to false, it is recommended to customize your own loading event callbacks.

notRedirectAfterComplete

Bool

Used to set whether to redirect back to your page after binding completion. Valid values are:

  • false: Default value. Redirects to your page after successful binding. Automatic redirection does not occur in cases of binding failure or other scenarios, and you need to handle those situations manually. The same applies if the value is empty.
  • true: No redirection after binding. You need to manually control the subsequent binding flow based on client-side event codes.

Notes:

  • For best practices on redirecting back to the merchant page upon binding success or failure, please refer to Redirect to the merchant page.
  • The binding result event codes returned on the client-side are for reference only in page navigation. Binding status updates must be based on the results returned by the server-side notifyVaulting or inquireVaulting API.
  • This parameter only takes effect for payment methods that complete binding within the Vaulting Element.

appearance

String(JSON)

Used for custom appearance configuration. For more information, refer to Appearance customization. It contains the following parameters:

  • theme: String type, theme color.
  • layout: String type, layout configuration.
  • variables: Object type, override underlying CSS custom properties using CSS design tokens (e.g., content-primary) to implement theme customization.

Best practices

Redirect to the merchant page

The following scenarios describe how redirecting to the merchant page and returning binding results are handled. Please follow the guidelines below:

notRedirectAfterComplete

Binding result

Recommended action

true

Success/Failure

If you set notRedirectAfterComplete to true when creating the Vaulting Element instance and the payment method supports completing binding within the SDK, the binding result will be returned via the onSubmitPayCallback() method. You need to handle the redirect logic based on the binding result event codes returned by the onSubmitPayCallback() method in the corresponding scenario.

false

Success

After binding is completed, Vaulting Element will automatically redirect to the redirectUrl you provided in the createVaultingSession API.

false

Failure

The binding result will be returned via the onSubmitPayCallback() method. You need to handle the redirect logic based on the binding result event codes returned by the onSubmitPayCallback() method in the corresponding scenario.

Notes:

  • If the payment method does not support binding within the SDK, the binding result will not be returned via onSubmitPayCallback(). After completing the binding on the external payment method page, the payment method will determine whether to automatically redirect back to the redirectUrl you provided.
  • The binding results returned by the onSubmitPayCallback() method are only for client-side page navigation and status display. For the final binding status, please obtain it through Step 4: Obtain the binding result.