lib/mollie/api/object/payment.rb in mollie-api-ruby-2.2.0 vs lib/mollie/api/object/payment.rb in mollie-api-ruby-2.2.1

- old
+ new

@@ -1,16 +1,18 @@ module Mollie module API module Object class Payment < Base - STATUS_OPEN = "open" - STATUS_CANCELLED = "cancelled" - STATUS_EXPIRED = "expired" - STATUS_PAID = "paid" - STATUS_PAIDOUT = "paidout" - STATUS_FAILED = "failed" - STATUS_REFUNDED = "refunded" + STATUS_OPEN = "open" + STATUS_CANCELLED = "cancelled" + STATUS_EXPIRED = "expired" + STATUS_PAID = "paid" + STATUS_PAIDOUT = "paidout" + STATUS_FAILED = "failed" + STATUS_REFUNDED = "refunded" + STATUS_PENDING = "pending" + STATUS_CHARGED_BACK = "charged_back" RECURRINGTYPE_NONE = nil RECURRINGTYPE_FIRST = "first" RECURRINGTYPE_RECURRING = "recurring" @@ -58,9 +60,21 @@ status == STATUS_PAIDOUT end def refunded? status == STATUS_REFUNDED + end + + def failed? + status == STATUS_FAILED + end + + def pending? + status == STATUS_PENDING + end + + def charged_back? + status == STATUS_CHARGED_BACK end def details=(details) @details = OpenStruct.new(details) if details.is_a?(Hash) end