1. Home
  2. Subscription Instant Conversion Request

Subscription Instant Conversion Request

No field are needed in the request. The subscription ID is in the URI.

Instant Conversion Response

Field Type Max Length Requirement Description Version
transactionID N 20 M Rebill Transaction reference returned by the system
errorCode D 3 M See Messages and error codes
errorMessage S 100 M See Messages and error codes
subscription O M The subscription object

PHP Gateway Client

Transaction name : InstantConversion

PHP Methods

Method name Requirement
setSubscriptionID M

PHP Example

<?php
$client = new GatewayClient();

$transaction = $client->newTransaction('InstantConversion', 'testMerchant', 'testPassword');
$transaction->setSubscriptionID($subscriptionID);

$response = $transaction->send();

if ('000' === $response->errorCode) {
    $transactionID  = $response->transactionID;
    $subscription   = $response->subscription;
} else {
    echo "Error {$response->errorCode} with message {$response->errorMessage}";
}
?>

Java Gateway Client

Java Methods

Connector method doSubscriptionInstantConversion
Request class SubscriptionInstantConversionRequest
Response class SubscriptionInstantConversionResponse

Java Examples

PaymentGatewayConnector connector = new PaymentGatewayConnector(API_URL, ORIGINATOR, PASSWORD);

SubscriptionInstantConversionResponse response = null;
SubscriptionInstantConversionRequest request = new SubscriptionInstantConversionRequest();
request.setSubscriptionId(1234567L);

try {
  response = connector.doSubscriptionInstantConversion(request);
} catch (Exception e) {
  e.printStackTrace();
}

if (response != null) {
  if (TransactionResultCode.TRANSACTION_SUCCESSFULLY.equals(response.getErrorCode()) {
    System.out.println("Success: " + response.getErrorMessage());
  } else {
    System.out.println("Failure: " + response.getErrorMessage());
  }
}

Was this article helpful?