Class: GoCardlessPro::Resources::OutboundPayment

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

Overview

Outbound Payments represent payments sent from [creditors](#core-endpoints-creditors).

GoCardless will notify you via a [webhook](#appendix-webhooks) when the status of the outbound payment [changes](#event-actions-outbound-payment).

<p class=“restricted-notice”><strong>Restricted</strong>: Outbound Payments are currently in Early Access and available only to a limited list of organisations. If you are interested in using this feature, please stay tuned for our public launch announcement. We are actively testing and refining our API to ensure it meets your needs and provides the best experience.</p>

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ OutboundPayment

Initialize a outbound_payment resource instance

Parameters:

  • object (Hash)

    an object returned from the API



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 31

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

  @amount = object['amount']
  @created_at = object['created_at']
  @currency = object['currency']
  @description = object['description']
  @execution_date = object['execution_date']
  @id = object['id']
  @is_withdrawal = object['is_withdrawal']
  @links = object['links']
  @metadata = object['metadata']
  @reference = object['reference']
  @scheme = object['scheme']
  @status = object['status']
  @verifications = object['verifications']
  @response = response
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def description
  @description
end

#execution_dateObject (readonly)

Returns the value of attribute execution_date.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def execution_date
  @execution_date
end

#idObject (readonly)

Returns the value of attribute id.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def id
  @id
end

#is_withdrawalObject (readonly)

Returns the value of attribute is_withdrawal.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def is_withdrawal
  @is_withdrawal
end

#metadataObject (readonly)

Returns the value of attribute metadata.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def 
  @metadata
end

#referenceObject (readonly)

Returns the value of attribute reference.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def reference
  @reference
end

#schemeObject (readonly)

Returns the value of attribute scheme.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def scheme
  @scheme
end

#statusObject (readonly)

Returns the value of attribute status.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def status
  @status
end

#verificationsObject (readonly)

Returns the value of attribute verifications.



26
27
28
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 26

def verifications
  @verifications
end

Instance Method Details

#api_responseObject



50
51
52
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 50

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



55
56
57
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 55

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

#to_hObject

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



60
61
62
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 60

def to_h
  @object
end