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.

Ruby
Copy
Copied
retry_result = gateway.subscription.retry_charge(
  subscription.id,
  "24.00",
  true
)
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.
Arguments
subscription_id required, String

A string value representing a specific subscription in the vault

amount BigDecimal or String

The 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.

submit_for_settlement bool

If 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.

Examples

Manually submit transaction for settlement

Ruby
Copy
Copied
retry_result = gateway.subscription.retry_charge(
  subscription.id,
  "24.00"
)
if retry_result.success?
  result = gateway.transaction.submit_for_settlement(
    retry_result.transaction.id
  )
  result.success?
  #=> true
end
This code snippet now uses gateway instance methods instead of class-level methods. Learn more.

Still have questions?

If you can’t find an answer, contact our Support team