Class: FatZebra::Paypal::Capture

Inherits:
APIResource show all
Includes:
APIOperation::Find, APIOperation::Search
Defined in:
lib/fat_zebra/paypal/capture.rb

Constant Summary

Constants included from APIOperation::Search

APIOperation::Search::DEFAULT_PARAMS

Instance Attribute Summary

Attributes inherited from FatZebraObject

#accepted

Attributes included from ObjectHelper

#data, #errors, #raw

Class Method Summary collapse

Methods included from APIOperation::Search

included

Methods included from APIOperation::Find

included

Methods inherited from APIResource

request

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_pathObject



19
20
21
# File 'lib/fat_zebra/paypal/capture.rb', line 19

def base_path
  "#{super}/paypal/"
end

.refund(id, params = {}, options = {}) ⇒ FatZebra::Paypal::Refund

Refund a PayPal Capture

Parameters:

  • Capture (String)

    id

  • params (Hash) (defaults to: {})

    (amount, note_to_payer)

  • options (Hash) (defaults to: {})

    for the request, and configurations (Optional)

Returns:



31
32
33
34
# File 'lib/fat_zebra/paypal/capture.rb', line 31

def refund(id, params = {}, options = {})
  response = request(:post, resource_path("captures/#{id}/refund"), params, options)
  FatZebra::Paypal::Refund.initialize_from(response)
end