setOption()
The setOption() method is used to set configuration options.
Method signature
public AMSBaseConfiguration setOption(String key, Object value)Parameters
Parameter | Type | Required | Description |
key | String | Yes | The key of the configuration item. Refer to Available keys. |
value | Object | Yes | The value of the configuration item, with the type varying depending on the key. |
Available keys
Key | Type | Description |
sandbox | Boolean | Whether to use the sandbox environment.
|
showLoading | Boolean | Whether to display a loading animation during the request process.
|
notRedirectAfterComplete | Boolean | Used to set whether to redirect back to your page after payment or card binding completion. Valid values are:
|
appearance | String(JSON) | Used for custom appearance configuration. For more information, refer to Appearance customization. It contains the following parameters:
|
Return value
Returns the this() method to support chained invocation.
Best practices
Redirect to the merchant page
The following scenarios describe how redirecting to the merchant page and returning payment or card binding results are handled. Please follow the guidelines below:
notRedirectAfterComplete | Payment or card binding result | Recommended action |
| Success/Failure | If you set notRedirectAfterComplete to |
| Success | After payment or card binding is completed, the redirection happens based on the respective scenario:
|
| Failure | The payment or card binding result will be returned via the |
Notes:
- If the payment method does not support payment or card binding within the SDK, the payment or card binding result will not be returned via
onSubmitPayCallback(). After completing the payment or card binding on the external page, the payment method will determine whether to automatically redirect back to the paymentRedirectUrl you provided in the createPaymentSession (One-time Payments) API or the redirectUrl result page you provided in the createVaultingSession API.- The payment or card binding results returned by the
onSubmitPayCallback()method are only for client-side page navigation and status display. For the final order status, please obtain it through Step 4: Obtain the payment result or Step 4: Obtain the card binding result.