Compropago
This gem helps you integrate ComproPago's API to your ruby app.
Installation
Add this line to your application's Gemfile:
gem 'compropago', '~> 0.1.2'
And then execute:
$ bundle
Or install it yourself as:
$ gem install compropago
Usage
Authentication
We encourage you to set your API keys in an environment variable rather than hardcoding your API keys.
Compropago.api_key = "sk_test_my_api_key"
Once you have created an instance of compropago, you can call the methods described in the api reference on it.
Examples
Create a charge
Creating a charge using only the required params product_price
, product_name
, customer_name
, customer_email
, payment_type
.
Compropago::Charge.create({ product_price: 10000.0,
product_name: "SAMSUNG GOLD CURL",
customer_name: "Roberto Miranda",
customer_email: "[email protected]",
payment_type: "OXXO"})
Verify a charge
Verify a charge previously made.
Compropago::Charge.find("818f2e81-226a-4ff9-88a2-81a577aec380")
SMS payment instructions
Send payment instructions over SMS.
Compropago::SMS.create(payment_id: "818f2e81-226a-4ff9-88a2-81a577aec380", customer_phone: "2221515805", customer_company_phone: "TELCEL")
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request