Latest 1.1
Homepage https://github.com/smart-side/SSPagarME
License MIT
Platforms ios 9.0, requires ARC
Dependencies SwiftyRSA
Frameworks Foundation
Authors

Usage

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

Requirements

Installation

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

pod "SSPagarME"

Init

Store initial keys

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

Transaction

Card Hash

let pagarME = SSPagarME.sharedInstance

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

// get card hash
SSPagarME.sharedInstance.generateCardHash(success: { (card_hash) in
    print("card_hash: (card_hash)")
}) { (message) in
    print("error message: (message)")
}

Pay

let pagarME = SSPagarME.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 = "[email protected]"
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"

// transition
SSPagarME.sharedInstance.transaction(amount: "1000", success: { (data) in
    print("data transaction: (data)")
})
{ (message) in
    print("error message: (message)")
}

Author

Rodrigo Priolo, [email protected]
Project based TBPagarME

License

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

Latest podspec

{
    "name": "SSPagarME",
    "version": "1.1",
    "summary": "Facilitador do gateway de pagamento pagar.me",
    "description": ""Facilita a transau00e7u00e3o com cartu00e3o de cru00e9dito com o pagar.me, gerando o card_hash necessu00e1rio."",
    "homepage": "https://github.com/smart-side/SSPagarME",
    "license": "MIT",
    "authors": {
        "Rodrigo Priolo": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/smart-side/SSPagarME.git",
        "tag": "1.1"
    },
    "source_files": [
        "Pod",
        "Pod/Classes/*.{swift,h,m}"
    ],
    "requires_arc": true,
    "frameworks": "Foundation",
    "dependencies": {
        "SwiftyRSA": []
    },
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This