Class: PayPal::ProductsResource
Instance Attribute Summary
Attributes inherited from Resource
#client
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create(name:, type:, **params) ⇒ Object
14
15
16
17
|
# File 'lib/pay_pal/resources/products.rb', line 14
def create(name:, type:, **params)
attributes = {name: name, type: type}
Product.new post_request("v1/catalogs/products", body: attributes.merge(params)).body
end
|
4
5
6
7
|
# File 'lib/pay_pal/resources/products.rb', line 4
def list
response = get_request("v1/catalogs/products")
Collection.from_response(response, kind: "products", type: Product)
end
|
#retrieve(id:) ⇒ Object
9
10
11
12
|
# File 'lib/pay_pal/resources/products.rb', line 9
def retrieve(id:)
response = get_request("v1/catalogs/products/#{id}")
Product.new(response.body)
end
|