https://github.com/freedompay-global/merchant-sdk-ios.gitPackage.swift file:create method of the FreedomAPI class. This method requires three parameters:| Enum Constant | Description |
|---|---|
kz | Kazakhstan region. |
uz | Uzbekistan region. |
kg | Kyrgyzstan region. |
PaymentView shows the payment page, the card form and 3DS. It is required for createPaymentPage, createPaymentFrame, addNewCard and confirmCardPayment; other methods work without it.onLoadingStateChanged listener:SdkConfiguration struct. This struct acts as a central container, encapsulating two key components: UserConfiguration for customer-specific settings and OperationalConfiguration for general operational parameters.SdkConfiguration is passed to the SDK via freedomApi.setConfiguration().| Property | Type | Description | Default Value |
|---|---|---|---|
userPhone | String? | Customer's phone number. If provided, it will be displayed on the payment page. If nil, the user will be prompted to enter it. | nil |
userContactEmail | String? | Customer's contact email. | nil |
userEmail | String? | Customer's email address. If provided, it will be displayed on the payment page. If nil, the user will be prompted to enter it. | nil |
| Property | Type | Description | Default Value |
|---|---|---|---|
testingMode | Bool | Enables or disables test mode. Test mode is on by default: pass false to accept real payments. | true |
language | Language | Sets the language of the payment page. See Language enum for available options. | .RU |
lifetime | Int | Duration, in seconds, for which the payment page remains valid for completing a payment. | 300 |
autoClearing | Bool? | Activates automatic clearing of payments. | nil |
checkUrl | String? | URL to which the payment check will be sent. | nil |
resultUrl | String? | URL to which the payment result will be sent. | nil |
requestMethod | HttpMethod? | HTTP method used for requests to checkUrl or resultUrl. See HttpMethod enum. Defaults to GET if checkUrl or resultUrl is set. | HttpMethod.GET (if checkUrl or resultUrl is not nil, otherwise nil) |
| Enum Constant | Description |
|---|---|
KZ | SDK uses the Kazakh language. |
RU | SDK uses the Russian language. |
EN | SDK uses the English language. |
| Enum Constant | Description |
|---|---|
GET | SDK uses the HTTP GET method. |
POST | SDK uses the HTTP POST method. |
SdkConfiguration and pass it to the freedomApi.setConfiguration() method:onResult on the main thread.createPaymentPage or createPaymentFrame method on your FreedomAPI instance. This method handles the presentation of the payment page/frame within the previously configured PaymentView.PaymentView has been set using freedomApi.setPaymentView() prior to calling them.| Parameter | Type | Description |
|---|---|---|
paymentRequest | StandardPaymentRequest | Essential details required to initiate a new payment. See StandardPaymentRequest model. |
onResult | (FreedomResult<PaymentResponse>) -> Void | Callback function that will be invoked upon the completion of the payment process. See PaymentResponse model. |
FreedomResult<PaymentResponse> object, which can be either:PaymentResponse object.getPaymentStatus method.| Parameter | Type | Description | Constraints/Notes |
|---|---|---|---|
paymentId | Int64 | Unique identifier of the payment you want to check. | |
includeLastTransactionInfo | Bool? | Optional. When true, includes details of the most recent transaction in the response. | |
onResult | @escaping (FreedomResult<Status>) -> Void | Callback function that will be invoked with the result of the payment status. See Status model. |
FreedomResult<Status> object, which can be either:Status object.autoClearing property within the OperationalConfiguration of your SdkConfiguration.makeClearingPayment method to explicitly initiate the clearing (final capture) of funds for a previously authorized payment. This method gives you the flexibility to clear an amount that may be different from the original amount specified when the payment was created (e.g., for partial captures).| Parameter | Type | Description | Constraints/Notes |
|---|---|---|---|
paymentId | Int64 | Unique identifier of the payment you want to clear. | |
amount | Decimal? | Amount to be cleared. If nil, the full amount of the original authorized payment will be cleared. | Optional. Defaults to nil. Must be between 0.01 and 99999999.00 if provided. Cannot exceed the authorized amount. |
onResult | @escaping (FreedomResult<ClearingStatus>) -> Void | Callback function that will be invoked with the result of the clearing operation. See ClearingStatus model. |
FreedomResult<ClearingStatus> object, which can be either:ClearingStatus object.autoClearing property within the OperationalConfiguration of your SdkConfiguration.makeCancelPayment method to reverse an authorized payment, effectively unblocking the amount on the customer's card. This ensures that the funds will not be charged.| Parameter | Type | Description | Constraints/Notes |
|---|---|---|---|
paymentId | Int64 | Unique identifier of the payment you want to cancel. | |
onResult | @escaping (FreedomResult<PaymentResponse>) -> Void | Callback function that will be invoked with the result of the cancellation attempt. See PaymentResponse model. |
FreedomResult<PaymentResponse> object, which can be either:PaymentResponse object.makeRevokePayment method allows you to process a full or partial refund for a completed payment.