File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
src/main/java/com/trynoice/api/subscription Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -570,7 +570,7 @@ private void handleStripeCheckoutSessionEvent(@NonNull Session session) throws W
570
570
try {
571
571
stripeApi .refundSubscription (session .getSubscription ());
572
572
} catch (StripeException e ) {
573
- throw new RuntimeException ("failed to cancel stripe subscription" , e );
573
+ throw new RuntimeException ("failed to refund stripe subscription" , e );
574
574
}
575
575
} else {
576
576
copySubscriptionDetailsFromStripeObject (subscription );
Original file line number Diff line number Diff line change @@ -159,7 +159,9 @@ public void refundSubscription(@NonNull String id) throws StripeException {
159
159
}
160
160
}
161
161
162
- subscription .cancel ();
162
+ if (!"canceled" .equals (subscription .getStatus ())) {
163
+ subscription .cancel ();
164
+ }
163
165
}
164
166
165
167
/**
You can’t perform that action at this time.
0 commit comments