Class: Flutterwave::BIN
- Inherits:
-
Object
- Object
- Flutterwave::BIN
- Includes:
- Helpers
- Defined in:
- lib/flutterwave/bin.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#check(options = {}) ⇒ Object
www.flutterwave.com/documentation/compliance/ - Verify Card BIN API.
- #encrypt(key) ⇒ Object
-
#initialize(client) ⇒ BIN
constructor
A new instance of BIN.
Methods included from Helpers
Constructor Details
#initialize(client) ⇒ BIN
Returns a new instance of BIN.
6 7 8 |
# File 'lib/flutterwave/bin.rb', line 6 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
4 5 6 |
# File 'lib/flutterwave/bin.rb', line 4 def client @client end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/flutterwave/bin.rb', line 4 def @options end |
Instance Method Details
#check(options = {}) ⇒ Object
www.flutterwave.com/documentation/compliance/ - Verify Card BIN API
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/flutterwave/bin.rb', line 11 def check( = {}) @options = request_params = { card6: encrypt(:card6) } response = post( Flutterwave::Utils::Constants::BIN[:check_url], request_params ) Flutterwave::Response.new(response) end |
#encrypt(key) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/flutterwave/bin.rb', line 26 def encrypt(key) plain_text = [key].to_s raise Flutterwave::Utils::MissingKeyError.new( "#{key.capitalize} key required!" ) if plain_text.empty? encrypt_data(plain_text, client.api_key) end |