SecurionPay ruby gem

Build Status Code Climate Test Coverage Issue Count Dependency Status

If you don't already have SecurionPay account you can create it here.

Installation

Add this line to your application's Gemfile:

gem 'securionpay'

And then execute:

$ bundle

Or install it yourself as:

$ gem install securionpay

Usage

Configuration:

SecurionPay::Configuration.private_key = 'private_key'

If you want connect do different backent:

SecurionPay::Configuration.service_url = 'https://api.chuck.norris.com'

Create a new Card

Creates a new card object.

customer_id = 'cust_id'
card = {
  number: '4242424242424242',
  expMonth: '11',
  expYear: '2022',
  cvc: '123',
  cardholderName: 'John Doe',
}

SecurionPay::Cards.create(customer_id, card)

Retrieve an existing Card

Retrieve an existing card object.

customer_id = 'cust_id'
card_id = 'card_id'

SecurionPay::Cards.retrieve(customer_id, card_id)

Update an existing Card

Update an existing card object.

customer_id = 'cust_id'
card_id = 'card_id'
card = {
  cardholderName: 'Mr Bean'
}
SecurionPay::Cards.update(customer_id, card_id, card)

Delete a Card

Deletes an existing card object.

customer_id = 'cust_id'
card_id = 'card_id'
SecurionPay::Cards.delete(customer_id, card_id)

List Cards

List card objects for given customer.

customer_id = 'cust_id'
SecurionPay::Cards.list(customer_id)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

For mutation testing, run mutant --include lib --require securionpay --use rspec SecurionPay*

If you want to run integration tests: ``

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/securionpay/securionpay-ruby