Class: GoCardlessPro::Resources::OutboundPaymentImport

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/outbound_payment_import.rb

Overview

Outbound Payment Imports allow you to create multiple payments via a single API call.

The Workflow:

  1. Create the outbound payment import.
  2. Retrieve an authorisation link from the response.
  3. Redirect the user to the link to authorise the import.
  4. Once the user authorises the import, the individual outbound payments are automatically submitted.

Import entries are not processed as actual payments until they are reviewed and authorised in GoCardless Dashboard. Upon approval, a unique outbound payment is generated for every entry in the import.

Outbound Payment Imports are capped at 1000 entries. If you expect to exceed this limit, please create multiple smaller imports.

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ OutboundPaymentImport

Initialize a outbound_payment_import resource instance

Parameters:

  • object (Hash)

    an object returned from the API



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 42

def initialize(object, response = nil)
  @object = object

  @amount_sum = object['amount_sum']
  @authorisation_url = object['authorisation_url']
  @created_at = object['created_at']
  @currency = object['currency']
  @entry_counts = object['entry_counts']
  @id = object['id']
  @links = object['links']
  @status = object['status']
  @response = response
end

Instance Attribute Details

#amount_sumObject (readonly)

Returns the value of attribute amount_sum.



32
33
34
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 32

def amount_sum
  @amount_sum
end

#authorisation_urlObject (readonly)

Returns the value of attribute authorisation_url.



33
34
35
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 33

def authorisation_url
  @authorisation_url
end

#created_atObject (readonly)

Returns the value of attribute created_at.



34
35
36
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 34

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



35
36
37
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 35

def currency
  @currency
end

#entry_countsObject (readonly)

Returns the value of attribute entry_counts.



36
37
38
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 36

def entry_counts
  @entry_counts
end

#idObject (readonly)

Returns the value of attribute id.



37
38
39
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 37

def id
  @id
end

#statusObject (readonly)

Returns the value of attribute status.



38
39
40
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 38

def status
  @status
end

Instance Method Details

#api_responseObject



56
57
58
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 56

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



61
62
63
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 61

def links
  @outbound_payment_import_links ||= Links.new(@links)
end

#to_hObject

Provides the outbound_payment_import resource as a hash of all its readable attributes



66
67
68
# File 'lib/gocardless_pro/resources/outbound_payment_import.rb', line 66

def to_h
  @object
end