Class: ModernTreasury::Resources::PaymentActions

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/payment_actions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PaymentActions

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PaymentActions.

Parameters:



132
133
134
# File 'lib/modern_treasury/resources/payment_actions.rb', line 132

def initialize(client:)
  @client = client
end

Instance Method Details

#create(type: , actionable_id: nil, actionable_type: nil, details: nil, internal_account_id: nil, request_options: {}) ⇒ ModernTreasury::Models::PaymentActionCreateResponse

Some parameter documentations has been truncated, see Models::PaymentActionCreateParams for more details.

Create a payment action.

Parameters:

  • type (String)

    Required. The type of the payment action. Determines the action to be taken.

  • actionable_id (String)

    Optional. The ID of the associated actionable object.

  • actionable_type (String)

    Optional. The type of the associated actionable object. One of ‘payment_order`,

  • details (Object)

    Optional. The specifc details of the payment action based on type.

  • internal_account_id (String)

    Optional. The ID of one of your organization’s internal accounts. Required if ‘a

  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/modern_treasury/resources/payment_actions.rb', line 28

def create(params)
  parsed, options = ModernTreasury::PaymentActionCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/payment_actions",
    body: parsed,
    model: ModernTreasury::Models::PaymentActionCreateResponse,
    options: options
  )
end

#list(actionable_id: nil, actionable_type: nil, after_cursor: nil, created_at: nil, internal_account_id: nil, metadata: nil, per_page: nil, status: nil, type: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::PaymentActionListResponse>

Some parameter documentations has been truncated, see Models::PaymentActionListParams for more details.

Get a list of all payment actions.

‘expected_

Parameters:

Returns:

See Also:



117
118
119
120
121
122
123
124
125
126
127
# File 'lib/modern_treasury/resources/payment_actions.rb', line 117

def list(params = {})
  parsed, options = ModernTreasury::PaymentActionListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/payment_actions",
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::Models::PaymentActionListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::PaymentActionRetrieveResponse

Get details on a single payment action.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
# File 'lib/modern_treasury/resources/payment_actions.rb', line 50

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/payment_actions/%1$s", id],
    model: ModernTreasury::Models::PaymentActionRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, status: , request_options: {}) ⇒ ModernTreasury::Models::PaymentActionUpdateResponse

Some parameter documentations has been truncated, see Models::PaymentActionUpdateParams for more details.

Update a single payment action.

Parameters:

Returns:

See Also:



75
76
77
78
79
80
81
82
83
84
# File 'lib/modern_treasury/resources/payment_actions.rb', line 75

def update(id, params)
  parsed, options = ModernTreasury::PaymentActionUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/payment_actions/%1$s", id],
    body: parsed,
    model: ModernTreasury::Models::PaymentActionUpdateResponse,
    options: options
  )
end