TBPagarME 1.2.0

TBPagarME 1.2.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2016
SPMSupports SPM

Maintained by Tiago Braga.



 
Depends on:
SwiftyRSA~> 0.2
SwiftLuhn~> 0.1
 

TBPagarME 1.2.0

TBPagarME

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

TBPagarME is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "TBPagarME"

Init

Store initial keys

// https://dashboard.pagar.me/#/myaccount/apikeys
TBPagarME.storeKeys("api_key", encryptionKey: "credential_key")

Transaction

Pay

// card info
TBPagarME.sharedInstance.cardNumber = "xxxxxxxxxxxxxxxx"
TBPagarME.sharedInstance.cardHolderName = "Swift Code"
TBPagarME.sharedInstance.cardExpirationMonth = "02"
TBPagarME.sharedInstance.cardExpirationYear = "22"
TBPagarME.sharedInstance.cardCVV = "123"

// owner of card
var customer = TBCustomer()
customer.name = "Swift"
customer.document_number = "07660770912"
customer.email = "[email protected]"
customer.street = "Rua Júlio de Castilho"
customer.neighborhood = "Centro"
customer.zipcode = "30456789"
customer.street_number = "123"
customer.complementary = "Apt 102"
customer.ddd = "031"
customer.number = "89990909"

TBPagarME.sharedInstance.transaction("1000", customCustomer: customer) // 10,00

Author

Tiago Braga, [email protected]

License

TBPagarME is available under the MIT license. See the LICENSE file for more info.