summaryrefslogtreecommitdiff
path: root/app/models/solidus_subscriptions
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-06-16 16:16:00 +0200
committerGitHub <noreply@github.com>2020-06-16 16:16:00 +0200
commit2bfffee038c57c5f6f1d03aad434ae9b861bde60 (patch)
tree2c127392fefe633576d4fe3d7d7d48897b82c7ff /app/models/solidus_subscriptions
parentc3b5120d51aeb5b1acc1437aa945a5c277311a59 (diff)
parentd8954026c19c1615a96b557a48017e2db01cdeeb (diff)
Merge pull request #109 from solidusio-contrib/aldesantis/subscription-info-backend
Add subscription details to backend
Diffstat (limited to 'app/models/solidus_subscriptions')
-rw-r--r--app/models/solidus_subscriptions/installment.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/solidus_subscriptions/installment.rb b/app/models/solidus_subscriptions/installment.rb
index a899cee..1cad63e 100644
--- a/app/models/solidus_subscriptions/installment.rb
+++ b/app/models/solidus_subscriptions/installment.rb
@@ -95,6 +95,13 @@ module SolidusSubscriptions
details.where(success: true).exists?
end
+ # Returns the state of this fulfillment
+ #
+ # @return [Symbol] :fulfilled/:unfulfilled
+ def state
+ fulfilled? ? :fulfilled : :unfulfilled
+ end
+
# Mark this installment as having a failed payment
#
# @param order [Spree::Order] The order generated for this processing