Repository URL to install this package:
|
Version:
0.2.8 ▾
|
| bin |
| lib |
| .gitignore |
| .rspec |
| .travis.yml |
| CHANGELOG |
| Gemfile |
| LICENSE.txt |
| README.md |
| Rakefile |
| paysimple.gemspec |
Ruby client to interact with PaySimple API. Detailed API documentation can be found here: documentation
Execute this command:
gem install 'paysimple-ruby'
If you're using Rails, simply add this to your Gemfile :
gem 'paysimple-ruby'
Initialize Paysimple client with user id and access token:
require 'paysimple' Paysimple.api_user = '<your api username>' Paysimple.api_key = '<your api key>'
By default the library will try to connect to a 'live' mode that is production endpoint. You can customize this behavior by specifying API mode explicitly that is 'test'.
Paysimple.mode = 'live'
This will make library to connect to production endpoint.
or
Paysimple.mode = 'test'
This will make library to connect to sandbox endpoint.
customer = Paysimple::Customer.create( first_name: 'John', last_name: 'Doe' )
updated_customer = Paysimple::Customer.update( id: customer[:id], first_name: 'John', last_name: 'Smith' )
customer = Paysimple::Customer.get(customer[:id])
customers = Paysimple::Customer.find( page: 1, page_size: 10, company: 'ABC company' )
payments = Paysimple::Customer.payments( customer[:id], { page_size: 5 } ) payment_schedules = Paysimple::Customer.payment_schedules( customer[:id], { page_size: 5 } )
Paysimple::Customer.delete(customer[:id])
credit_card = Paysimple::CreditCard.create( customer_id: customer[:id], credit_card_number: '4111111111111111', expiration_date: '12/2021', billing_zip_code: '80202', issuer: Paysimple::Issuer::VISA, is_default: true )
updated_credit_card = Paysimple::CreditCard.update( id: credit_card[:id], ... )
Paysimple::CreditCard.delete(credit_card[:id])
ach = Paysimple::ACH.create( customer_id: customer[:id], account_number: '751111111', routing_number: '131111114', bank_name: 'PaySimple Bank', is_checking_account: true, is_default: true )
updated_ach = Paysimple::ACH.update({ id: ach[:id], ... })
Paysimple::ACH.delete(ach[:id])
payment = Paysimple::Payment.create( amount: 100, account_id: credit_card[:id] )
payment = Paysimple::Payment.get(payment[:id])
Paysimple::Payment.void(payment[:id])
Paysimple::Payment.refund(payment[:id])
payments = Paysimple::Payment.find( status: 'authorized', page_size: 10 )
recurring_payment = Paysimple::RecurringPayment.create( account_id: credit_card[:id], payment_amount: 10, start_date: Date.today, execution_frequency_type: Paysimple::ExecutionFrequencyType::DAILY )
recurring_payment = Paysimple::RecurringPayment.get(recurring_payment[:id])
Paysimple::RecurringPayment.suspend(recurring_payment[:id])
Paysimple::RecurringPayment.resume(recurring_payment[:id])
payments = Paysimple::RecurringPayment.payments(recurring_payment[:id])
recurring_payments = Paysimple::RecurringPayment.find(page_size: 10)
Paysimple::RecurringPayment.delete(payment[:id])
payment_plan = Paysimple::PaymentPlan.create( account_id: credit_card[:id], total_due_amount: 10, total_number_of_payments: 3, start_date: Date.today, execution_frequency_type: Paysimple::ExecutionFrequencyType::DAILY )
payment_plan = Paysimple::PaymentPlan.get(payment_plan[:id])
Paysimple::PaymentPlan.suspend(payment_plan[:id])
Paysimple::PaymentPlan.resume(payment_plan[:id])
payments = Paysimple::PaymentPlan.payments(payment_plan[:id])
payment_plans = Paysimple::PaymentPlan.find(page_size: 10)
Paysimple::PaymentPlan.delete(payment_plan[:id])