Class: SBF::Client::RecurringGiftEndpoint

Inherits:
EntityEndpoint show all
Defined in:
lib/stbaldricks/endpoints/recurring_gift.rb

Instance Attribute Summary

Attributes inherited from EntityEndpoint

#orig_target_class

Instance Method Summary collapse

Methods inherited from EntityEndpoint

#aggregate, #create, #delete, #find, #find_first, #get, #initialize, #save, #update

Constructor Details

This class inherits a constructor from SBF::Client::EntityEndpoint

Instance Method Details

#change_amount(data) ⇒ Object



28
29
30
31
32
33
34
35
36
37
# File 'lib/stbaldricks/endpoints/recurring_gift.rb', line 28

def change_amount(data)
  response = SBF::Client::Api::Request.post_request("#{base_uri}/change_amount", data)

  unless ok?(response)
    parsed_response_body = JSON.parse(response.body).symbolize!
    error = SBF::Client::ErrorEntity.new(parsed_response_body)
  end

  SBF::Client::Api::Response.new(http_code: response.code, data: response, error: error)
end

#change_billing_day(data) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/stbaldricks/endpoints/recurring_gift.rb', line 17

def change_billing_day(data)
  response = SBF::Client::Api::Request.post_request("#{base_uri}/change_billing_day", data)

  unless ok?(response)
    parsed_response_body = JSON.parse(response.body).symbolize!
    error = SBF::Client::ErrorEntity.new(parsed_response_body)
  end

  SBF::Client::Api::Response.new(http_code: response.code, data: response, error: error)
end

#sync(data) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/stbaldricks/endpoints/recurring_gift.rb', line 6

def sync(data)
  response = SBF::Client::Api::Request.post_request("#{base_uri}/sync", data)

  unless ok?(response)
    parsed_response_body = JSON.parse(response.body).symbolize!
    error = SBF::Client::ErrorEntity.new(parsed_response_body)
  end

  SBF::Client::Api::Response.new(http_code: response.code, data: response, error: error)
end