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

Bongloy 0.5.0

Bongloy 0.5.0

Maintained by khomsovon.



Bongloy 0.5.0

  • By
  • khomsovon

Bongloy

CocoaPods License Platform

This is the Unofficial iOS library for Bongloy Payment Gateway.

Installation

Install and configure the SDK

  • If you haven't already, install the latest version of CocoaPods
  • Add this line to your Podfile
    pod 'Bongloy'
    
  • Run the following command
    pod install
    
  • Don't forget to use the .xcworkspace file to open your project in Xcode, instead of the .xcodeproj file, from here on out.
  • In the future, to update to the latest version of the SDK, just run:
    pod update Bongloy
    

Configure your Bongloy integration in your App Delegate

After you're done installing the SDK, configure it with your Bongloy publishable key in AppDelegate.swift.

import UIKit
import Bongloy

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

  func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
      Stripe.setDefaultPublishableKey("pk_test_69bf785ab0e264c9b6b081040ea460eaf79833ae2219e57f1cc3379c26955c1a")
      return true
  }
}

Usage

import Bongloy

let cardParam  = STPCardParams()
cardParam.number = "6200000000000005"
cardParam.expMonth = "12"
cardParam.expYear = "30"
cardParam.cvc = "123"
BongloyAPIClient.shared().createToken(withCard: cardParam){ (token: STPToken?, error: Error?) in
    guard let token = token, error == nil else { return }
    
    // do anything
}

Documentation

See the API docs.