Class: MerbMerchant::Billing::UsaEpayGateway
- Defined in:
- lib/merb_merchant/billing/gateways/usa_epay.rb
Constant Summary collapse
- URL =
'https://www.usaepay.com/gate.php'
- TRANSACTIONS =
{ :authorization => 'authonly', :purchase => 'sale', :capture => 'capture' }
Constants inherited from Gateway
Constants included from PostsData
PostsData::MAX_RETRIES, PostsData::OPEN_TIMEOUT, PostsData::READ_TIMEOUT
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
- #authorize(money, credit_card, options = {}) ⇒ Object
- #capture(money, authorization, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ UsaEpayGateway
constructor
A new instance of UsaEpayGateway.
- #purchase(money, credit_card, options = {}) ⇒ Object
Methods inherited from Gateway
#card_brand, card_brand, inherited, supports?, #test?
Methods included from Utils
Methods included from CreditCardFormatting
Methods included from RequiresParameters
Methods included from PostsData
Constructor Details
#initialize(options = {}) ⇒ UsaEpayGateway
Returns a new instance of UsaEpayGateway.
18 19 20 21 22 |
# File 'lib/merb_merchant/billing/gateways/usa_epay.rb', line 18 def initialize( = {}) requires!(, :login) @options = super end |
Instance Method Details
#authorize(money, credit_card, options = {}) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/merb_merchant/billing/gateways/usa_epay.rb', line 24 def (money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, credit_card, ) add_customer_data(post, ) commit(:authorization, post) end |
#capture(money, authorization, options = {}) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/merb_merchant/billing/gateways/usa_epay.rb', line 48 def capture(money, , = {}) post = { :refNum => } add_amount(post, money) commit(:capture, post) end |
#purchase(money, credit_card, options = {}) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/merb_merchant/billing/gateways/usa_epay.rb', line 36 def purchase(money, credit_card, = {}) post = {} add_amount(post, money) add_invoice(post, ) add_credit_card(post, credit_card) add_address(post, credit_card, ) add_customer_data(post, ) commit(:purchase, post) end |