Skip to content

asiapay-lib/paysdk-ios-demo

Repository files navigation

PaySDK

iOS SDK which seamlessly integrate PayDollar Payment Gateway

Overview

AsiaPay offers comprehensive and flexible payment services and solutions.Via our state-of the-art secure multi-currency, multi-lingual and multi-channel processing platform, we offer payment acceptance flexibility for Direct Merchant Account or Master Account offerings, with options for credit card and direct debit acceptance, whether online, MOTO or call centre and popular mobile wallets.

How it works

The cardholder inputs their bank account/card details on the PayDollar Checkout form in order to pay for a product/service.The transaction amount is routed via the card networks to PayDollar's acquiring banking partners. Once PayDollar receives the amount, it is settled to your bank account after fees deduction.

Get Started

  1. PaySdk Configuration
  2. Add Security Key
  3. Initialize PaySdk
  4. Initialize Payload
  5. Collect Payment Result

PaySdk Configuration

  • Requirements Swift Version: 4.0 and above iOS Version: 11.0 and above

  • Download the latest sdk from https://github.com/asiapay-lib/paysdk-ios-lib

  • Add AP_PaySDK.framework file into your project by adding the dependencies in Build Phases / Link Binary With Libraries and also add Material.framework file into your project by adding the dependencies in Build Phases / Link Binary With Libraries or add using cocoapods as

      pod 'Material'
      
    
  • Or use CocoaPods. CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit https://guides.cocoapods.org/using/using-cocoapods.html for more detail. To integrate PaySDK into your Xcode project using CocoaPods, specify it in your Podfile:

      pod 'AP_PaySDK', '2.5.08'
      
    

    image

  • Import sdk into the class

    import AP_PaySDK

NOTE - Due to the limitation of App Transport Security(ATS) on http in iOS9.0, we need to add exception for paydollar.com, pesopay.com, siampay.com, alipay.com, alipayobjects.com in info.list

<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>paydollar.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>xecure3d.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>pesopay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>siampay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>alipay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>alipayobjects.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>

Also Merchant can disable ATS by

<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>

Add Security Key

Create the paysdk.plist file in the app with the following attributes

RSA Public Key(SDK_RSA_Publickey) :- Here you need to specify the value of certificate.

URL Domain(Domain):- Here you need to specify the "Domain" URL. Value for the Domain is optional. e.g

Screenshot 2021-01-22 at 1 51 30 AM

Initialize PaySdk

  • Add implementation of PaySDK protocol –

class ViewController: UIViewController , PaySDKDelegate

  • Instantiate PaySDK class with context.

var paySDK = PaySDK.shared (Swift Code) or paySDK = [PaySDK shared]; (Objective C Code)

  • Set paySDK delegate

paySDK.delegate = self

Initialize Payload

  • Use following payment services.
Payment Services Example
Direct Payment Direct Payment
Webview Payment Webview Payment
3Ds 2.0 Extra Paramters 3DS
Alipay Alipay
WeChat Pay WeChat Pay
Apple Pay Apple Pay
Octopus Octopus
Member Pay Member Pay
Installment Pay Installmet Pay
Schedule Pay Schedule Pay
Promo Pay Promo Pay
Transaction Query Transaction Query
Payment Methods Query Payment Methods Query
EVoucher EVoucher

Collect Payment Result

    func paymentResult(result: PayResult) {
     //process result here
     
    }
    

Related Sample

DeepLink Demo

Support

Asiapay is a tech company. All our engineers handle support too. You can write to us at it@pesopay.com ,it@paydollar.com , it@siampy.com and expect a response from the devs from the iOS SDK.

License

MIT Licensed. LICENSE file added to repo.

About

private repo demo iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5