Class: FacebookCommerce::CancellationRefundApi
- Defined in:
- lib/facebook_commerce.rb
Instance Attribute Summary
Attributes inherited from Api
#access_token, #cms_id, #logger
Instance Method Summary collapse
-
#cancel_order(order_id) ⇒ Hash
Cancellation response, eg.
-
#refund_order(order_id, reason_code, items = nil) ⇒ Hash
Refund response, eg.
Methods inherited from Api
Constructor Details
This class inherits a constructor from FacebookCommerce::Api
Instance Method Details
#cancel_order(order_id) ⇒ Hash
Returns Cancellation response, eg. { success: true}.
146 147 148 149 |
# File 'lib/facebook_commerce.rb', line 146 def cancel_order(order_id) data = { idempotency_key: SecureRandom.uuid } post("#{order_id}/cancellations", data) end |
#refund_order(order_id, reason_code, items = nil) ⇒ Hash
Returns Refund response, eg. { success: true}.
155 156 157 158 |
# File 'lib/facebook_commerce.rb', line 155 def refund_order(order_id, reason_code, items = nil) data = { reason_code: reason_code, idempotency_key: SecureRandom.uuid } post("#{order_id}/refunds", data) end |