Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

securionpay/securionpay-ruby

Repository files navigation

Deprecation

This library is deprecated. Please use Shift4 ruby gem.

SecurionPay ruby gem

Build Gem Version

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.secret_key = 'pr_test_id'

If you want connect to different backend:

SecurionPay::Configuration.api_url = 'https://api.mysecurionpay.env'
SecurionPay::Configuration.uploads_url = 'https://uploads.mysecurionpay.env'

Examples

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)

Create a Blacklist Rule

blacklist_rule = {
  ruleType: 'fingerprint',
  fingerprint: '123abc456efg'
}
SecurionPay::Blacklist.create(blacklist_rule)

Retrieve an existing Blacklist Rule

blacklist_rule_id = 'blr_number'
SecurionPay::Blacklist.retrieve(blacklist_rule_id)

Delete a Blacklist Rule

blacklist_rule_id = 'blr_number'
SecurionPay::Blacklist.delete(blacklist_rule_id)

List Blacklist Rules

SecurionPay::Blacklist.list(deleted: true, limit: 100)

API reference

Please refer to detailed API docs (linked) for all available fields

For further information, please refer to our official documentation at https://securionpay.com/docs.

Contributing

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

Development

After checking out the repo, run bundle setup to install dependencies.

To run integration tests:

SECRET_KEY='sk_test_id' bundle exec rake spec:integration

To run style checks execute:

bundle exec rubocop

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages