Module: AlphaCard
- Defined in:
- lib/alpha_card.rb,
lib/alpha_card/sale.rb,
lib/alpha_card/order.rb,
lib/alpha_card/account.rb,
lib/alpha_card/billing.rb,
lib/alpha_card/shipping.rb,
lib/alpha_card/alpha_card_error.rb,
lib/alpha_card/alpha_card_object.rb,
lib/alpha_card/alpha_card_response.rb
Defined Under Namespace
Classes: Account, AlphaCardError, AlphaCardObject, AlphaCardResponse, Billing, Order, Sale, Shipping
Constant Summary collapse
- CREDIT_CARD_CODES =
YAML.load_file(File.('../alpha_card/data/codes.yml', __FILE__))
Class Attribute Summary collapse
-
.api_base ⇒ Object
Returns the value of attribute api_base.
Class Method Summary collapse
Class Attribute Details
.api_base ⇒ Object
Returns the value of attribute api_base.
23 24 25 |
# File 'lib/alpha_card.rb', line 23 def api_base @api_base end |
Class Method Details
.request(params = {}, account) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/alpha_card.rb', line 26 def self.request(params = {}, account) unless account.filled? raise AlphaCardError.new('You must set credentials to create the sale!') end response = RestClient.post(@api_base, params.merge(account.attributes)) alpha_card_response = AlphaCardResponse.new(response.to_str) handle_errors(alpha_card_response) alpha_card_response end |