Module: AstroPay
- Defined in:
- lib/astro_pay/card.rb,
lib/astro_pay.rb,
lib/astro_pay/curl.rb,
lib/astro_pay/model.rb,
lib/astro_pay/direct.rb,
lib/astro_pay/version.rb,
lib/astro_pay/configuration.rb
Overview
Class of AstroPay Direct
@author Luis Galaviz ([email protected])
Defined Under Namespace
Classes: Card, Configuration, Curl, Direct, Model
Constant Summary collapse
- VERSION =
"0.0.3"
Class Attribute Summary collapse
-
.configuration ⇒ AstroPay::Configuration
Gets the configuration attribute.
Class Method Summary collapse
-
.card(*args) ⇒ AstroPay::Card
Gets a new [AstroPay::Card] instance with the given arguments.
-
.configure {|configuration| ... } ⇒ Object
Allows to set the configuration passing a block where the values are set.
-
.create_card(number, ccv, exp_date, amount, unique_id, invoice_num, additional_params = {}) ⇒ AstroPay::Card
Gets a new [AstroPay::Card] instance with the given arguments and some optional values.
-
.create_direct(invoice, amount, iduser, country, bank = '', sub_code = 1, args = {}) ⇒ AstroPay::Direct
Gets a new [AstroPay::Direct] instance with the given arguments and some optional values.
-
.direct(*args) ⇒ AstroPay::Direct
Gets a new [AstroPay::Direct] instance with the given arguments.
Class Attribute Details
.configuration ⇒ AstroPay::Configuration
Gets the configuration attribute.
29 30 31 |
# File 'lib/astro_pay.rb', line 29 def self.configuration @configuration ||= Configuration.new end |
Class Method Details
.card(*args) ⇒ AstroPay::Card
Gets a new [AstroPay::Card] instance with the given arguments.
50 51 52 |
# File 'lib/astro_pay.rb', line 50 def self.card(*args) Card.new(*args) end |
.configure {|configuration| ... } ⇒ Object
Allows to set the configuration passing a block where the values are set.
34 35 36 |
# File 'lib/astro_pay.rb', line 34 def self.configure yield(configuration) end |
.create_card(number, ccv, exp_date, amount, unique_id, invoice_num, additional_params = {}) ⇒ AstroPay::Card
Gets a new [AstroPay::Card] instance with the given arguments and some optional values. See the AstroPay Card Manual.
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/astro_pay.rb', line 91 def self.create_card(number, ccv, exp_date, amount, unique_id, invoice_num, additional_params={}) card( number: number, ccv: ccv, exp_date: exp_date, amount: amount, unique_id: unique_id, invoice_num: invoice_num, additional_params: additional_params ).auth_capture_transaction end |
.create_direct(invoice, amount, iduser, country, bank = '', sub_code = 1, args = {}) ⇒ AstroPay::Direct
Gets a new [AstroPay::Direct] instance with the given arguments and some optional values. See the AstroPay Direct Manual.
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/astro_pay.rb', line 65 def self.create_direct(invoice, amount, iduser, country, bank='', sub_code=1, args={}) direct( args.merge( invoice: invoice, amount: amount, iduser: iduser, bank: bank, country: country, sub_code: sub_code ) ).create end |
.direct(*args) ⇒ AstroPay::Direct
Gets a new [AstroPay::Direct] instance with the given arguments.
42 43 44 |
# File 'lib/astro_pay.rb', line 42 def self.direct(*args) Direct.new(*args) end |