Skip to content

Commit

Permalink
translate feedback codes into human readable message
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinSchneider committed May 14, 2024
1 parent ab58c9e commit ea7c5d9
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ module StripeHelpers
module SupplementalEvents
class CancellationFeedbackReceived < Base
# record = Stripe::Subscription
FEEDBACK_CODES = {
'customer_service' => 'Customer service was less than expected',
'low_quality' => 'Quality was less than expected',
'missing_features' => 'Some features are missing',
'other' => 'Other reason',
'switched_service' => "I'm switching to a different service",
'too_complex' => 'Ease of use was less than expected',
'unused' => "I don't use the service enough",
}

def properties
mrr = nil
Expand All @@ -17,7 +26,8 @@ def properties
mrr: mrr,
display_mrr: display_mrr,
cancellation_comment: stripe_record.cancellation_details&.comment,
cancellation_feedback: stripe_record.cancellation_details&.feedback,
cancellation_feedback: FEEDBACK_CODES[stripe_record.cancellation_details&.feedback],
cancellation_feedback_code: stripe_record.cancellation_details&.feedback,
cancellation_reason: stripe_record.cancellation_details&.reason,
}
end
Expand Down

0 comments on commit ea7c5d9

Please sign in to comment.