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 (https://developer.gocardless.com/api-reference/#core-endpoints-creditors).

GoCardless will notify you via a webhook (https://developer.gocardless.com/api-reference/#appendix-webhooks) when the status of the outbound payment changes (https://developer.gocardless.com/api-reference/#event-types-outbound-payment).

####Rate limiting

Two rate limits apply to the Outbound Payments APIs:

  • All POST Outbound Payment endpoints (create, withdraw, approve, cancel and etc.) share a single rate-limit group of 300 requests per minute. As initiating a payment typically requires two API calls (one to create the payment and one to approve it), this allows you to add approximately 150 outbound payments per minute.
  • All remaining Outbound Payment endpoints are limited to 500 requests per minute.

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



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 48

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.



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

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



34
35
36
# File 'lib/gocardless_pro/resources/outbound_payment.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.rb', line 35

def currency
  @currency
end

#descriptionObject (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#execution_dateObject (readonly)

Returns the value of attribute execution_date.



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

def execution_date
  @execution_date
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#is_withdrawalObject (readonly)

Returns the value of attribute is_withdrawal.



39
40
41
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 39

def is_withdrawal
  @is_withdrawal
end

#metadataObject (readonly)

Returns the value of attribute metadata.



40
41
42
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 40

def 
  @metadata
end

#referenceObject (readonly)

Returns the value of attribute reference.



41
42
43
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 41

def reference
  @reference
end

#schemeObject (readonly)

Returns the value of attribute scheme.



42
43
44
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 42

def scheme
  @scheme
end

#statusObject (readonly)

Returns the value of attribute status.



43
44
45
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 43

def status
  @status
end

#verificationsObject (readonly)

Returns the value of attribute verifications.



44
45
46
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 44

def verifications
  @verifications
end

Instance Method Details

#api_responseObject



67
68
69
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 67

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



72
73
74
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 72

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

#to_hObject

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



77
78
79
# File 'lib/gocardless_pro/resources/outbound_payment.rb', line 77

def to_h
  @object
end