If you don't already have SecurionPay account you can create it here.
Add this line to your application's Gemfile:
gem 'securionpay'
And then execute:
$ bundle
Or install it yourself as:
$ gem install securionpay
Unit tests:
$ bundle exec rake spec:unit
Integration tests:
$ SECRET_KEY='pr_test_id' bundle exec rake spec:integration
Mutation tests:
$ SPEC_OPTS="--pattern spec/unit/**/*_spec.rb" bundle exec mutant --include lib --require securionpay --use rspec SecurionPay*
Configuration:
SecurionPay::Configuration.secret_key = 'pr_test_id'
If you want connect do different backent:
SecurionPay::Configuration.service_url = 'https://api.chuck.norris.com'
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 object.
customer_id = 'cust_id'
card_id = 'card_id'
SecurionPay::Cards.retrieve(customer_id, card_id)
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)
Deletes an existing card object.
customer_id = 'cust_id'
card_id = 'card_id'
SecurionPay::Cards.delete(customer_id, card_id)
List card objects for given customer.
customer_id = 'cust_id'
SecurionPay::Cards.list(customer_id)
blacklist_rule = {
ruleType: 'fingerprint',
fingerprint: '123abc456efg'
}
SecurionPay::Blacklist.create(blacklist_rule)
blacklist_rule_id = 'blr_number'
SecurionPay::Blacklist.retrieve(blacklist_rule_id)
blacklist_rule_id = 'blr_number'
SecurionPay::Blacklist.delete(blacklist_rule_id)
SecurionPay::Blacklist.list
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.
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.
Bug reports and pull requests are welcome on GitHub at https://github.com/securionpay/securionpay-ruby