Class: Paddle::PaymentMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/paddle/models/payment_method.rb

Class Method Summary collapse

Methods inherited from Object

#initialize, #to_ostruct, #update

Constructor Details

This class inherits a constructor from Paddle::Object

Class Method Details

.delete(customer:, id:) ⇒ Object



14
15
16
# File 'lib/paddle/models/payment_method.rb', line 14

def delete(customer:, id:)
  Client.delete_request("customers/#{customer}/payment-methods/#{id}")
end

.list(customer:, **params) ⇒ Object



4
5
6
7
# File 'lib/paddle/models/payment_method.rb', line 4

def list(customer:, **params)
  response = Client.get_request("customers/#{customer}/payment-methods", params: params)
  Collection.from_response(response, type: PaymentMethod)
end

.retrieve(customer:, id:) ⇒ Object



9
10
11
12
# File 'lib/paddle/models/payment_method.rb', line 9

def retrieve(customer:, id:)
  response = Client.get_request("customers/#{customer}/payment-methods/#{id}")
  PaymentMethod.new(response.body["data"])
end