bug5773: Fixed refund behavior when auto cancelation is done. Now the payment amount will be refunded to origin account.

- merged bug5805, because need this improvements to have a full picture of changes regarding subscriptions before adding additional UI elements, like new information/confirmation dialogs.
This commit is contained in:
Udo Wessels
2023-07-21 12:07:22 +02:00
12 changed files with 89 additions and 16 deletions
@@ -8,6 +8,7 @@ import com.chargebee.models.Subscription;
import com.chargebee.models.Subscription.CancelForItemsRequest;
import com.chargebee.models.enums.AccountReceivablesHandling;
import com.chargebee.models.enums.CreditOptionForCurrentTermCharges;
import com.chargebee.models.enums.RefundableCreditsHandling;
import com.sap.sse.security.subscription.SubscriptionApiBaseService;
import com.sap.sse.security.subscription.SubscriptionApiRequestProcessor;
@@ -37,6 +38,7 @@ public class ChargebeeCancelSubscriptionRequest extends ChargebeeApiRequest {
CancelForItemsRequest request = Subscription.cancelForItems(subscriptionId)
.creditOptionForCurrentTermCharges(CreditOptionForCurrentTermCharges.PRORATE)
.accountReceivablesHandling(AccountReceivablesHandling.SCHEDULE_PAYMENT_COLLECTION)
.refundableCreditsHandling(RefundableCreditsHandling.SCHEDULE_REFUND)
.endOfTerm(false);
return new ChargebeeInternalApiRequestWrapper(request);
}