Subscription
Subscription: Retry Charge
See also the Transaction response object.
You can manually retry charging past due subscriptions. For details on how to do this, see the managing subscriptions page.
- Java
Result<Transaction> retryResult = gateway.subscription().retryCharge(
subscription.getId(),
new BigDecimal("24.00"),
true
);
Arguments
amount
, BigDecimalThe amount to charge the customer if different from the current balance on the subscription. This value must be greater than 0, and must match the appropriate currency format.
submitForSettlement
, booleanIf set to true, the transaction will automatically be submitted for settlement if the retry request is successful. Available in the latest versions of our server SDKs.
subscriptionId
required, stringA string value representing a specific subscription in the vault
Examples
Manually submit transaction for settlement
- Java
Result<Transaction> retryResult = gateway.subscription().retryCharge(
subscription.getId(),
new BigDecimal("24.00")
);
if (retryResult.isSuccess()) {
Result<Transaction> result = gateway.transaction().submitForSettlement(
retryResult.getTarget().getId()
);
result.isSuccess();
// true
}