AMSPaymentElementConfiguration
AMSPaymentElementConfiguration is used to configure SDK parameters before initializing Payment Element.
Declaration
@interface AMSPaymentElementConfiguration : AMSConfiguration
- (instancetype)init;
@endProperty
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, Valid values are:
|
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.
|
showLoading | Bool | Whether to display a loading animation during the request process.
|
notRedirectAfterComplete | Bool | Used to set whether to redirect back to your page after payment completion. Valid values are:
|
appearance | String(JSON) | Used for custom appearance configuration. For more information, refer to Appearance customization. It contains the following parameters:
|
Best practices
Redirect to the merchant page
The following scenarios describe how redirecting to the merchant page and returning payment results are handled. Please follow the guidelines below:
notRedirectAfterComplete | Payment result | Recommended action |
| Success/Failure | If you set notRedirectAfterComplete to |
| Success | After payment is completed, Payment Element will automatically redirect to the paymentRedirectUrl result page you provided in the createPaymentSession (One-time Payments) API. |
| Failure | The payment result will be returned via the |
Notes:
- If the payment method does not support payment within the SDK, the payment result will not be returned via
onSubmitPayCallback(). After completing the payment on the external payment page, the payment method will determine whether to automatically redirect back to the paymentRedirectUrl you provided.- The payment 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.