CocoaPods trunk is moving to be read-only. Read more on the blog, there are 17 months to go.

AP_PaySDK 2.6.24

AP_PaySDK 2.6.24

Maintained by Vaibhav Meshram, Priyanka Gore, AP Felix Mo.



AP_PaySDK 2.6.24

  • By
  • Asiapay Limited

paydollar2

PayDollar is a global payment gateway that accepts payments from more than 200 countries.The PaySDK ensures payment is authorised by 3DS 2.0

Features

  • Direct Client Side Connection
  • WebView Payment - Client Post through Browser Side Connection
  • Payment via Alipay

Requirements

  • iOS 10.0+
  • Xcode 10.0+
  • Swift version 4+

Pre-requisites

Merchant need to integrate certificate. This certificate is provided in PayDollar Dashboard.

Add paysdk.plist and set value of certificate.

Screenshot 2019-11-07 at 7 01 41 PM

Installation

Framework file

Add AP_PaySDK.framework file into your project by adding the dependencies in Build Phases / Link Binary With Libraries.

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate PayDollarSDK into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'AP_PaySDK'

Implementation

Add implementation of PaySDK

#import AP_PaySDK

class ViewController: UIViewController {
    let paySDK = PaySDK.shared
    paySDK.delegate = self
    .
    .
    .

Payment Channel Types

Creating PayData for payment and process.

WebView Payment

paySDK.paymentDetails = PayData(channelType: PayChannel.WEBVIEW,
                                envType: EnvType.SANDBOX,
                                amount : "10",
                                payGate: PayGate.PAYDOLLAR,
                                currCode: currencyCode.HKD, 
                                payType: payType.NORMAL_PAYMENT, 
                                orderRef: "abcde12345", 
                                payMethod: payMethod.VISA,
                                lang: Language.ENGLISH,
                                merchantId: "1",
                                remark: "",
                                extraData :[:])

paySDK.process()

Direct Payment

paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT,
                                envType: EnvType.SANDBOX,
                                amount : "10",
                                payGate: PayGate.PAYDOLLAR,
                                currCode: currencyCode.HKD, 
                                payType: payType.NORMAL_PAYMENT, 
                                orderRef: "abcde12345", 
                                payMethod: payMethod.VISA,
                                lang: Language.ENGLISH,
                                merchantId: "1",
                                remark: "",
                                extraData :[:])

paySDK. paymentDetails.cardDetails = CardDetails(cardHolderName: "abc abc",
                                                 cardNo: "1234567890123456”,
                                                 expMonth: "11",
                                                 expYear: "2011",
                                                 securityCode: "123")
paySDK.process()

Payment via AliPay and other value added services.

paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT,
                                envType: EnvType.SANDBOX,
                                amount : “10”,
                                payGate: PayGate.PAYDOLLAR,
                                currCode: currencyCode.HKD, 
                                payType: payType.NORMAL_PAYMENT, 
                                orderRef: "abcde12345”, 
                                payMethod: payMethod.ALIPAYHKAPP,
                                //payMethod: payMethod.ALIPAYCNAPP
                                //payMethod: payMethod.ALIPAYAPP                                
                                lang: Language.ENGLISH,
                                merchantId: "1",
                                remark: "",
                                extraData :[:])

paySDK.process()

Payment response

extension ViewController : PaySDKDelegate {
    func paymentResult(result: PayResult) {

    }
}

For detailed description kindly follow PayDollar Guide.