Class: Stripe::CustomerPaymentMethodService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/customer_payment_method_service.rb

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

#list(customer, params = {}, opts = {}) ⇒ Object

Returns a list of PaymentMethods for a given Customer



7
8
9
10
11
12
13
14
15
# File 'lib/stripe/services/customer_payment_method_service.rb', line 7

def list(customer, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/customers/%<customer>s/payment_methods", { customer: CGI.escape(customer) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(customer, payment_method, params = {}, opts = {}) ⇒ Object

Retrieves a PaymentMethod object for a given Customer.



18
19
20
21
22
23
24
25
26
# File 'lib/stripe/services/customer_payment_method_service.rb', line 18

def retrieve(customer, payment_method, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/customers/%<customer>s/payment_methods/%<payment_method>s", { customer: CGI.escape(customer), payment_method: CGI.escape(payment_method) }),
    params: params,
    opts: opts,
    base_address: :api
  )
end