Module: Justifi::PaymentMethod

Defined in:
lib/justifi/payment_method.rb

Class Method Summary collapse

Class Method Details

.create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/justifi/payment_method.rb', line 6

def create(params: {}, headers: {}, idempotency_key: nil, seller_account_id: nil, sub_account_id: nil)
  Justifi. if 
  headers[:sub_account] =  ||  if  || 

  JustifiOperations.idempotently_request("/v1/payment_methods",
    method: :post,
    params: params,
    headers: headers,
    idempotency_key: idempotency_key)
end

.get(token:, headers: {}) ⇒ Object



24
25
26
27
28
# File 'lib/justifi/payment_method.rb', line 24

def get(token:, headers: {})
  JustifiOperations.execute_get_request("/v1/payment_methods/#{token}",
    {},
    headers)
end

.list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil) ⇒ Object



17
18
19
20
21
22
# File 'lib/justifi/payment_method.rb', line 17

def list(params: {}, headers: {}, seller_account_id: nil, sub_account_id: nil)
  Justifi. if 
  headers[:sub_account] =  ||  if  || 

  JustifiOperations.list("/v1/payment_methods", params, headers)
end

.update(token:, card_params:, headers: {}, idempotency_key: nil) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/justifi/payment_method.rb', line 30

def update(token:, card_params:, headers: {}, idempotency_key: nil)
  JustifiOperations.idempotently_request("/v1/payment_methods/#{token}",
    method: :patch,
    params: card_params,
    headers: {},
    idempotency_key: idempotency_key)
end