class FirstGiving::Donation

Public Class Methods

new() click to toggle source
# File lib/firstgiving/donation.rb, line 13
def initialize
  @api_endpoint = DONATION_PRODUCTION_ENDPOINT
  @api_endpoint = DONATION_SANDBOX_ENDPOINT if FirstGiving.configuration.options[:use_staging]
end

Public Instance Methods

creditcard(params) click to toggle source
# File lib/firstgiving/donation.rb, line 22
def creditcard(params)
  response = post_call(@api_endpoint, Actions::CREDITCARD, params, headers)
  parse(response.body)
end
headers() click to toggle source
# File lib/firstgiving/donation.rb, line 18
def headers
  headers_json.merge!(headers_security)
end
parse(body) click to toggle source
# File lib/firstgiving/donation.rb, line 36
def parse(body)
  Crack::XML.parse(body)
end
recurring_creditcard_profile(params) click to toggle source
# File lib/firstgiving/donation.rb, line 32
def recurring_creditcard_profile(params)
  call(Actions::RECURRING_CREDITCARD_PROFILE, params, headers)
end
verify(params) click to toggle source
# File lib/firstgiving/donation.rb, line 27
def verify(params)
  response = get_call(@api_endpoint, Actions::VERIFY, params, headers)
  parse(response.body)
end