Class: FatZebra::Paypal::BillingAgreement
- Inherits:
-
APIResource
- Object
- FatZebraObject
- APIResource
- FatZebra::Paypal::BillingAgreement
- Includes:
- APIOperation::Find, APIOperation::Search
- Defined in:
- lib/fat_zebra/paypal/billing_agreement.rb
Constant Summary
Constants included from APIOperation::Search
APIOperation::Search::DEFAULT_PARAMS
Instance Attribute Summary
Attributes inherited from FatZebraObject
Attributes included from ObjectHelper
Class Method Summary collapse
- .base_path ⇒ Object
-
.cancel(id, options = {}) ⇒ FatZebra::BillingAgreement
Cancel a PayPal Billing Agreement.
-
.charge(id, params, options = {}) ⇒ FatZebra::Paypal::Order
Charge a PayPal Billing Agreement.
Methods included from APIOperation::Search
Methods included from APIOperation::Find
Methods inherited from APIResource
Methods included from APIHelper
included, #request, #resource_name, #resource_path
Methods inherited from FatZebraObject
initialize_from, #load_response_api, #update_from
Methods included from Validation
#errors, #valid!, #valid?, #validates
Methods included from ObjectHelper
#[], #[]=, #add_accessor, #add_accessors, #add_data, #initialize, #inspect, #keys, #method_missing, #remove_accessor, #to_hash, #to_json, #update_attributes
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FatZebra::ObjectHelper
Class Method Details
.base_path ⇒ Object
25 26 27 |
# File 'lib/fat_zebra/paypal/billing_agreement.rb', line 25 def base_path "#{super}/paypal/" end |
.cancel(id, options = {}) ⇒ FatZebra::BillingAgreement
Cancel a PayPal Billing Agreement
51 52 53 54 |
# File 'lib/fat_zebra/paypal/billing_agreement.rb', line 51 def cancel(id, = {}) response = request(:post, resource_path("billing_agreements/#{id}/cancel"), {}, ) initialize_from(response) end |
.charge(id, params, options = {}) ⇒ FatZebra::Paypal::Order
Charge a PayPal Billing Agreement
37 38 39 40 41 42 |
# File 'lib/fat_zebra/paypal/billing_agreement.rb', line 37 def charge(id, params, = {}) valid!(params, :charge) if respond_to?(:valid!) response = request(:post, resource_path("billing_agreements/#{id}/charge"), params, ) FatZebra::Paypal::Order.initialize_from(response) end |