Class: ActiveMerchant::Billing::FirstGivingGateway
- Defined in:
- lib/active_merchant/billing/gateways/first_giving.rb
Constant Summary
Constants inherited from Gateway
Gateway::CREDIT_DEPRECATION_MESSAGE, Gateway::RECURRING_DEPRECATION_MESSAGE, Gateway::STANDARD_ERROR_CODE
Instance Attribute Summary
Attributes inherited from Gateway
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ FirstGivingGateway
constructor
A new instance of FirstGivingGateway.
- #purchase(money, creditcard, options = {}) ⇒ Object
- #refund(money, identifier, options = {}) ⇒ Object
Methods inherited from Gateway
#add_field_to_post_if_present, #add_fields_to_post_if_present, #card_brand, card_brand, #generate_unique_id, inherited, #scrub, #supported_countries, supported_countries, supported_countries=, supports?, #supports_network_tokenization?, #supports_scrubbing?, #test?
Methods included from CreditCardFormatting
Methods included from PostsData
included, #raw_ssl_request, #ssl_get, #ssl_post, #ssl_request
Constructor Details
#initialize(options = {}) ⇒ FirstGivingGateway
Returns a new instance of FirstGivingGateway.
15 16 17 18 |
# File 'lib/active_merchant/billing/gateways/first_giving.rb', line 15 def initialize( = {}) requires!(, :application_key, :security_token, :charity_id) super end |
Instance Method Details
#purchase(money, creditcard, options = {}) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/active_merchant/billing/gateways/first_giving.rb', line 20 def purchase(money, creditcard, = {}) post = {} add_invoice(post, ) add_creditcard(post, creditcard) add_address(post, ) add_customer_data(post, ) add_donation_data(post, money, ) commit('/donation/creditcard', post) end |
#refund(money, identifier, options = {}) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/active_merchant/billing/gateways/first_giving.rb', line 30 def refund(money, identifier, = {}) get = {} get[:transactionId] = identifier get[:tranType] = 'REFUNDREQUEST' commit('/transaction/refundrequest?' + encode(get)) end |