Before initializing the transfer page, you need to install the SDK in your mobile application.
Instructions for launching the translation page in the SDK
After configuring the SDK in your mobile application, proceed to setting up the translation itself.
You have the option to launch several types of translation:
- P2P
- OCT
- AFT
- Translation to a mobile phone
To use these types of translations, you need to contact your manager.
1. Initialization of the Invoice instance
Before going to the payment page, initialize an instance of the Invoice model.
Description of general fields
Field name | Required | Description |
---|---|---|
id (invoiceId) | Yes | Order number, generated by the merchant, must be unique for each new order, from 6 to 15 digits. If your order number contains more than 6 characters, uniqueness must also be maintained for the last 6 characters. |
amount | Yes | Order Amoount |
currency | Yes | Currency |
postLink | Yes | Payment notification |
failurePostLink | Yes | Failed payment notification, if not filled out, the information will be sent to the address specified in postLink |
backLink | Yes | Return link to the store in case of successful payment |
failureBackLink | Yes | Return link to the store in case of unsuccessful payment |
description | No | Order description, maximum 125 bytes |
isRecurrent | No | true to set up a recurring payment, otherwise false. By default, we recommend using false |
autoPaymentFrequency | No | Payment frequency: WEEKLY, MONTHLY, QUARTERLY |
homebankToken | No | For the possibility of payment with cards saved in the Homebank |
accountId | No | Optional field for specifying the customer's store identifier |
transferType | Yes | P2P, AFT, OCT, byPhone. cardID → If you have saved recipient or sender card data in ePay, you can use this type of transfer so that you do not have to re-enter card details |
senderCard | No | cardID → If you have saved recipient or sender card data in ePay, you can use this type of transfer so that you do not have to re-enter card details |
receiverCard | No | cardID → If you have saved recipient or sender card data in ePay, you can use this type of transfer so that you do not have to re-enter card details |
Example of initializing an Invoice instance in iOS
import EpaySDK
let invoice = Invoice(
id: invoiceId,
amount: amount,
currency: "KZT",
accountId: "1",
description: "",
postLink: "https://testmerchant/order/1123",
failurePostLink: "https://testmerchant/order/1123/fail",
isRecurrent: false,
autoPaymentFrequency: .weekly,
transferType: .P2P
)
// Transfer Types
public enum TransferType: String, CaseIterable {
case P2P, AFT, OCT, CardId, byPhone}
Example of initializing an Invoice instance in Android
import com.ss.halykepay.data.model.Invoice
val invoice = Invoice(
id = invoiceId,
amount = amount,
currency = "KZT",
accountID = "1",
description = "",
postLink = "https://testmerchant/order/1123",
failurePostLink = "https://testmerchant/order/1123/fail",
isRecurrent = false,
autoPaymentFrequency = Invoice.AutoPaymentFrequency.WEEKLY,
isP2P = true,
)
2. Launching payment page
iOS Example
import EpaySDK
let pm = PaymentModel(authConfig: <Previously configured AuthConfig>, invoice: <Invoice instance created by paragraph above>)
let launchScreenVC = LaunchScreenViewController(paymentModel: pm)
launchScreenVC.setEnvironmetType(type: .prod) //for the test, use .dev
navigationController?.pushViewController(launchScreenVC, animated: true)
Android Example
Using the previously created instance of HalykEpaySDK, launch the payment page by passing the instance of Invoice.
halykEpaySdk.launchEpay(invoice)
3. Response Processing
The response processing settings are described in the SDK Installation Instructions