Module: Justifi::PaymentIntent
- Defined in:
- lib/justifi/payment_intent.rb
Class Method Summary collapse
- .capture(id:, params:, headers: {}, idempotency_key: nil) ⇒ Object
- .create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil) ⇒ Object
- .get(id:, headers: {}) ⇒ Object
- .list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) ⇒ Object
- .list_payments(id:, params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) ⇒ Object
- .update(id:, params: {}, headers: {}, idempotency_key: nil) ⇒ Object
Class Method Details
.capture(id:, params:, headers: {}, idempotency_key: nil) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/justifi/payment_intent.rb', line 45 def capture(id:, params:, headers: {}, idempotency_key: nil) JustifiOperations.idempotently_request("/v1/payment_intents/#{id}/capture", method: :post, params: params, headers: headers, idempotency_key: idempotency_key) end |
.create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/justifi/payment_intent.rb', line 34 def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil) Justifi.seller_account_deprecation_warning if seller_account_id headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id JustifiOperations.idempotently_request("/v1/payment_intents", method: :post, params: params, headers: headers, idempotency_key: idempotency_key) end |
.get(id:, headers: {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/justifi/payment_intent.rb', line 20 def get(id:, headers: {}) JustifiOperations.execute_get_request("/v1/payment_intents/#{id}", {}, headers) end |
.list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/justifi/payment_intent.rb', line 6 def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) Justifi.seller_account_deprecation_warning if seller_account_id headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id JustifiOperations.execute_get_request("/v1/payment_intents", params, headers) end |
.list_payments(id:, params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/justifi/payment_intent.rb', line 13 def list_payments(id:, params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) Justifi.seller_account_deprecation_warning if seller_account_id headers[:sub_account] = sub_account_id || seller_account_id if sub_account_id || seller_account_id JustifiOperations.execute_get_request("/v1/payment_intents/#{id}/payments", params, headers) end |
.update(id:, params: {}, headers: {}, idempotency_key: nil) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/justifi/payment_intent.rb', line 26 def update(id:, params: {}, headers: {}, idempotency_key: nil) JustifiOperations.idempotently_request("/v1/payment_intents/#{id}", method: :patch, params: params, headers: headers, idempotency_key: idempotency_key) end |