Class: Paddle::Adjustment
- Inherits:
-
Object
- Object
- OpenStruct
- Object
- Paddle::Adjustment
show all
- Defined in:
- lib/paddle/models/adjustment.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
.create(transaction_id:, action:, reason:, items:, **params) ⇒ Object
9
10
11
12
13
|
# File 'lib/paddle/models/adjustment.rb', line 9
def create(transaction_id:, action:, reason:, items:, **params)
attrs = { transaction_id: transaction_id, action: action, reason: reason, items: items }
response = Client.post_request("adjustments", body: attrs.merge(params))
Adjustment.new(response.body["data"])
end
|
.credit_note(id:, disposition: "attachment") ⇒ Object
15
16
17
18
19
20
|
# File 'lib/paddle/models/adjustment.rb', line 15
def credit_note(id:, disposition: "attachment")
response = Client.get_request("adjustments/#{id}/credit-note?disposition=#{disposition}")
if response.success?
response.body["data"]["url"]
end
end
|