Requirements Requirements

  1. You must be a client of ePay.
  2. You must obtain integration data:
TerminalIDMerchant payment terminal ID
ClientIDMerchant ID
ClientSecretMerchant Secret Key
  1. The deployment target of your project should be iOS 11 or higher.

Test data

ClientIDtest
ClientSecretyF587AV9Ms94qN2QShFzVR3vFnWkhjbAK3sG
TerminalID67e34d63-102f-4bd1-898e-370781d0074d

Setup

1. Import SDK

  1. __EBay SDK жүктеп алыңыз.framework _ _ сілтеме бойынша https://github.com/HFSEpayment/EpaySDK

  2. Мұрағатты ашыңыз

  3. __EBay sdk қосыңыз.framework _ _ өз жобасына.

  4. Бағдарламаның мақсатты Embed frameworks нысанына EpaySDK кітапханасын импорттау және қосу қажет.framework.

  5. Жобаның түбірлік қалтасында кеңейтілген SDK пайдаланыңыз.

![Скриншот 2023-08-10 19.08.19] [1]

  1. Қолданбаның жалпы санатына өтіңіз. "Жақтаулар, кітапханалар және кіріктірілген мазмұн" бөлімін тауып, оған назар аударыңыз.

![Скриншот 2023-08-10 21.08.54] [2]

  1. Басынан бастаңыз "және басқалар" = "файлдарды қосу".

![Скриншот 2023-08-10 22.08.18] [3]

  1. Жобаның жаңа нұсқасында "__Ebay SDK.framework _ _ " және оны жобада жасаңыз

![Скриншот 2023-08-10 24.08.15] [4]

  1. Embed = кірістіру және қол қою арқылы SDK пайда болғанына көз жеткізіңіз

![Скриншот 2023-08-10 24.08.2014] [5]

2. Setup Auth Configs

Create an instance of authentication configs. You can store the instance in constants or create it during direct initialization of the Payment Page or Transfer Page

Import the EpaySDK module.

    import EpaySDK

Create an AuthConfig instance

    let config = AuthConfig(
     merchantId: <The store's TerminalID identifier received from epay>,
     merchantName: <Store Name>,
     clientId: <Client identifier ClientID received from epay>,
     clientSecret: <clientSecret secret key received from epay>
    )

3. Response handling from EpaySDK.

Add an observer to handle the response from EpaySDK.

    NotificationCenter.default.addObserver(
			self,
			selector: #selector(handleSdkResponse),
			name: Notification.Name("sdk_response"),
			object: nil)

Note: The notification type must be sdk_response, but you can change the name of the handler method handleSdkResponse

4. Response handling

Create a function to handle the notification for the result of the payment/transfer processing (function handleSdkResponse from the previous step).

Response format:

    isSuccessful: Bool,
    paymentReference: String,
    errorCode: Int,
    errorMessage: String

Example handler:

    @objc func handleSdkResponse(_ notification: Notification) {
      navigationController?.popToViewController(self, animated: true) // 1
      let isSuccessful = notification.userInfo?["isSuccessful"] as? Bool // 2
      if isSuccessful == true { // 3
         let reference = notification.userInfo?["paymentReference"] as? String
      } else { // 4
         let errorCode = notification.userInfo?["errorCode"] as? Int
         let errorMessage = notification.userInfo?["errorMessage"] as? String
      }       

Where the steps are:

  1. Exit from SDK
  2. Determine the payment status
  3. If successful, get the payment reference
  4. Otherwise, get the error code and message

5. Setting up payment or transfer

Next, to make a direct operation, you need to prepare a payment model and launch the type of operation you need. Learn more on the Payment Pages and Transfer Pages pages.