Class: Lithic::Resources::Payments
- Inherits:
-
Object
- Object
- Lithic::Resources::Payments
- Defined in:
- lib/lithic/resources/payments.rb
Instance Method Summary collapse
-
#create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, memo: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
-
#initialize(client:) ⇒ Payments
constructor
private
A new instance of Payments.
-
#list(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Payment>
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
-
#retrieve(payment_token, request_options: {}) ⇒ Lithic::Models::Payment
Get the payment by token.
-
#retry_(payment_token, request_options: {}) ⇒ Lithic::Models::PaymentRetryResponse
Retry an origination which has been returned.
-
#return_(payment_token, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::Payment
Some parameter documentations has been truncated, see Models::PaymentReturnParams for more details.
-
#simulate_action(payment_token, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateActionResponse
Simulate payment lifecycle event.
-
#simulate_receipt(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReceiptResponse
Some parameter documentations has been truncated, see Models::PaymentSimulateReceiptParams for more details.
-
#simulate_release(payment_token:, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReleaseResponse
Simulates a release of a Payment.
-
#simulate_return(payment_token:, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReturnResponse
Simulates a return of a Payment.
Constructor Details
#initialize(client:) ⇒ Payments
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 Payments.
293 294 295 |
# File 'lib/lithic/resources/payments.rb', line 293 def initialize(client:) @client = client end |
Instance Method Details
#create(amount:, external_bank_account_token:, financial_account_token:, method_:, method_attributes:, type:, token: nil, memo: nil, user_defined_id: nil, request_options: {}) ⇒ Lithic::Models::PaymentCreateResponse
Some parameter documentations has been truncated, see Models::PaymentCreateParams for more details.
Initiates a payment between a financial account and an external bank account.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/lithic/resources/payments.rb', line 36 def create(params) parsed, = Lithic::PaymentCreateParams.dump_request(params) @client.request( method: :post, path: "v1/payments", body: parsed, model: Lithic::Models::PaymentCreateResponse, options: ) end |
#list(account_token: nil, begin_: nil, business_account_token: nil, category: nil, end_: nil, ending_before: nil, financial_account_token: nil, page_size: nil, result: nil, starting_after: nil, status: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::Payment>
Some parameter documentations has been truncated, see Models::PaymentListParams for more details.
List all the payments for the provided search criteria.
100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/lithic/resources/payments.rb', line 100 def list(params = {}) parsed, = Lithic::PaymentListParams.dump_request(params) @client.request( method: :get, path: "v1/payments", query: parsed.transform_keys(begin_: "begin", end_: "end"), page: Lithic::Internal::CursorPage, model: Lithic::Payment, options: ) end |
#retrieve(payment_token, request_options: {}) ⇒ Lithic::Models::Payment
Get the payment by token.
57 58 59 60 61 62 63 64 |
# File 'lib/lithic/resources/payments.rb', line 57 def retrieve(payment_token, params = {}) @client.request( method: :get, path: ["v1/payments/%1$s", payment_token], model: Lithic::Payment, options: params[:request_options] ) end |
#retry_(payment_token, request_options: {}) ⇒ Lithic::Models::PaymentRetryResponse
Retry an origination which has been returned.
122 123 124 125 126 127 128 129 |
# File 'lib/lithic/resources/payments.rb', line 122 def retry_(payment_token, params = {}) @client.request( method: :post, path: ["v1/payments/%1$s/retry", payment_token], model: Lithic::Models::PaymentRetryResponse, options: params[:request_options] ) end |
#return_(payment_token, financial_account_token:, return_reason_code:, addenda: nil, date_of_death: nil, memo: nil, request_options: {}) ⇒ Lithic::Models::Payment
Some parameter documentations has been truncated, see Models::PaymentReturnParams for more details.
Return an ACH payment with a specified return reason code. Returns must be initiated within the time window specified by NACHA rules for each return code (typically 2 banking days for most codes, 60 calendar days for unauthorized debits). For a complete list of return codes and their meanings, see the [ACH Return Reasons documentation](docs.lithic.com/docs/ach-overview#ach-return-reasons).
Note:
-
This endpoint does not modify the state of the financial account associated with the payment. If you would like to change the account state, use the [Update financial account status](docs.lithic.com/reference/updatefinancialaccountstatus) endpoint.
-
By default this endpoint is not enabled for your account. Please contact your implementations manager to enable this feature.
168 169 170 171 172 173 174 175 176 177 |
# File 'lib/lithic/resources/payments.rb', line 168 def return_(payment_token, params) parsed, = Lithic::PaymentReturnParams.dump_request(params) @client.request( method: :post, path: ["v1/payments/%1$s/return", payment_token], body: parsed, model: Lithic::Payment, options: ) end |
#simulate_action(payment_token, event_type:, date_of_death: nil, decline_reason: nil, return_addenda: nil, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateActionResponse
Simulate payment lifecycle event
200 201 202 203 204 205 206 207 208 209 |
# File 'lib/lithic/resources/payments.rb', line 200 def simulate_action(payment_token, params) parsed, = Lithic::PaymentSimulateActionParams.dump_request(params) @client.request( method: :post, path: ["v1/simulate/payments/%1$s/action", payment_token], body: parsed, model: Lithic::Models::PaymentSimulateActionResponse, options: ) end |
#simulate_receipt(token:, amount:, financial_account_token:, receipt_type:, memo: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReceiptResponse
Some parameter documentations has been truncated, see Models::PaymentSimulateReceiptParams for more details.
Simulates a receipt of a Payment.
233 234 235 236 237 238 239 240 241 242 |
# File 'lib/lithic/resources/payments.rb', line 233 def simulate_receipt(params) parsed, = Lithic::PaymentSimulateReceiptParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/receipt", body: parsed, model: Lithic::Models::PaymentSimulateReceiptResponse, options: ) end |
#simulate_release(payment_token:, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReleaseResponse
Simulates a release of a Payment.
255 256 257 258 259 260 261 262 263 264 |
# File 'lib/lithic/resources/payments.rb', line 255 def simulate_release(params) parsed, = Lithic::PaymentSimulateReleaseParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/release", body: parsed, model: Lithic::Models::PaymentSimulateReleaseResponse, options: ) end |
#simulate_return(payment_token:, return_reason_code: nil, request_options: {}) ⇒ Lithic::Models::PaymentSimulateReturnResponse
Simulates a return of a Payment.
279 280 281 282 283 284 285 286 287 288 |
# File 'lib/lithic/resources/payments.rb', line 279 def simulate_return(params) parsed, = Lithic::PaymentSimulateReturnParams.dump_request(params) @client.request( method: :post, path: "v1/simulate/payments/return", body: parsed, model: Lithic::Models::PaymentSimulateReturnResponse, options: ) end |