Class: Pin::Refund
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#charge ⇒ Object
Returns the value of attribute charge.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#error_message ⇒ Object
Returns the value of attribute error_message.
-
#success ⇒ Object
Returns the value of attribute success.
-
#token ⇒ Object
Returns the value of attribute token.
Class Method Summary collapse
- .all(charge_or_charge_id) ⇒ Object
-
.create(charge_or_charge_id, amount = nil) ⇒ Object
provide a charge object, or charge ID, and it will be refunded optionally provide an amount in cents, greater than equal to 100, to refund defaults to the full amount of the charge.
Methods inherited from Base
find, first, #initialize, last
Constructor Details
This class inherits a constructor from Pin::Base
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def amount @amount end |
#charge ⇒ Object
Returns the value of attribute charge.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def charge @charge end |
#created_at ⇒ Object
Returns the value of attribute created_at.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def created_at @created_at end |
#currency ⇒ Object
Returns the value of attribute currency.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def currency @currency end |
#error_message ⇒ Object
Returns the value of attribute error_message.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def @error_message end |
#success ⇒ Object
Returns the value of attribute success.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def success @success end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/pin-payments/refund.rb', line 3 def token @token end |
Class Method Details
.all(charge_or_charge_id) ⇒ Object
17 18 19 |
# File 'lib/pin-payments/refund.rb', line 17 def all(charge_or_charge_id) super(path: path_for(charge_or_charge_id)) end |
.create(charge_or_charge_id, amount = nil) ⇒ Object
provide a charge object, or charge ID, and it will be refunded optionally provide an amount in cents, greater than equal to 100, to refund defaults to the full amount of the charge
11 12 13 14 15 |
# File 'lib/pin-payments/refund.rb', line 11 def create(charge_or_charge_id, amount = nil) raise "`amount` must be greater than or equal to 100" if !amount.nil? && amount < 100 super({amount: amount}, path_for(charge_or_charge_id)) end |