Class: AlphaCard::Sale
- Inherits:
-
Transaction
- Object
- Resource
- Transaction
- AlphaCard::Sale
- Defined in:
- lib/alpha_card/transactions/sale.rb
Overview
Implementation of Alpha Card Services Sale transaction. Contains all the information about Customer Credit Card, such as CVV, number, expiration date, etc. Process the Alpha Card Services payment.
Constant Summary collapse
- ORIGIN_TRANSACTION_VARIABLES =
Original AlphaCard transaction variables names
{ card_expiration_date: :ccexp, card_number: :ccnumber, check_name: :checkname, check_aba: :checkaba, check_account: :checkaccount }.freeze
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Transaction type (default is ‘sale’).
Instance Method Summary collapse
-
#payment ⇒ Object
Payment type.
-
#process(order, credentials = Account.credentials) ⇒ AlphaCard::Response
(also: #create)
Creates the sale transaction for the specified
AlphaCard::Order
.
Methods inherited from Resource
Methods included from Attribute
Instance Attribute Details
#type ⇒ Object (readonly)
Transaction type (default is ‘sale’)
34 |
# File 'lib/alpha_card/transactions/sale.rb', line 34 attribute :type, default: 'sale', writeable: false |
Instance Method Details
#payment ⇒ Object
Payment type. Values: ‘creditcard’ or ‘check’
28 |
# File 'lib/alpha_card/transactions/sale.rb', line 28 attribute :payment, default: 'creditcard', values: %w(creditcard check).freeze |
#process(order, credentials = Account.credentials) ⇒ AlphaCard::Response Also known as: create
Creates the sale transaction for the specified AlphaCard::Order
.
67 68 69 70 71 |
# File 'lib/alpha_card/transactions/sale.rb', line 67 def process(order, credentials = Account.credentials) validate_required_attributes! AlphaCard.request(params_for_sale(order), credentials) end |