TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2016 |
SPMSupports SPM | ✗ |
Maintained by Tiago Braga.
Depends on: | |
SwiftyRSA | ~> 0.2 |
SwiftLuhn | ~> 0.1 |
To run the example project, clone the repo, and run pod install
from the Example directory first.
TBPagarME is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TBPagarME"
Store initial keys
// https://dashboard.pagar.me/#/myaccount/apikeys
TBPagarME.storeKeys("api_key", encryptionKey: "credential_key")
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
Tiago Braga, [email protected]
TBPagarME is available under the MIT license. See the LICENSE file for more info.