tiagobbraga / TBPagarME

Facilitador do gateway de pagamento pagar.me

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TBPagarME

CI Status Version License Platform

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(apiKey: "api_key", encryptionKey: "credential_key")

Transaction

Pay

let pagarME = TBPagarME.sharedInstance
        
// card
pagarME.card.cardNumber = "xxxxxxxxxxxxxxxx"
pagarME.card.cardHolderName = "Name Owner Card"
pagarME.card.cardExpirationMonth = "12"
pagarME.card.cardExpirationYear = "17"
pagarME.card.cardCVV = "111"

// customer
pagarME.customer.name = "Onwer Card"
pagarME.customer.document_number = "09809889011"
pagarME.customer.email = "owner@card.com"
pagarME.customer.street = "Street"
pagarME.customer.neighborhood = "Neightborhood"
pagarME.customer.zipcode = "00000"
pagarME.customer.street_number = "1"
pagarME.customer.complementary = "Apt 805"
pagarME.customer.ddd = "031"
pagarME.customer.number = "986932196"

TBPagarME.sharedInstance.transaction("1000", success: { (data) in
    print("data transaction \(data)")
})
{ (message) in
    print("error message \(message)")
}

//get card_hash
TBPagarME.sharedInstance.generateCardHash(success: { (card_hash) in
    debugPrint("card_hash: \(card_hash)")
    
}) { (message) in
    debugPrint("error: \(message)")
}

Author

Tiago Braga, contato@tiagobraga.cc

License

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

About

Facilitador do gateway de pagamento pagar.me

License:MIT License


Languages

Language:Swift 76.2%Language:Shell 19.2%Language:Objective-C 2.4%Language:Ruby 2.2%