Skip to main content

Pause subscription

Last updated: 27-Sep-2021
Rate this article:

Overview

Use the pauseSubscription method to suspend all automatic charges for a predefined time period for a subscription.

Request Parameters

Parameters Required Type/Description
SubscriptionRef Required String. The system-generated reference code of the subscription.
ResumeDate Required Number.  Date when the subscription should be resumed. Format "YYYY-MM-DD". The resume date needs to be set within 3 years starting from the day the subscription expires. The timezone used is the one on the server.
PauseReason Optional String. Freeform text filled in by the merchant. Text is limited to 100 characters.

Request Example

<?php
$sb = "58";
$vers = "6.0";
$client = new SoapClient("http://api.sandbox" . $sb . ".avangate.local/soap/$vers/?wsdl", array(
    'location' => "http://api.sandbox" . $sb . ".avangate.local/soap/$vers/",
    'cache_wsdl' => WSDL_CACHE_NONE,
    "trace" => 1));
$date = gmdate('Y-m-d H:i:s');
$merchantCode = "666999";
$key = "%y~8|m]T84p[W4+O1]_?";
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
$hash = hash_hmac('md5', $string, $key);
$sessionID = $client->login($merchantCode, $date, $hash);
var_dump("session: ", $sessionID);
//$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
$SubRef = "B7D8E72224";
$resumeDate = "2020-09-30 17:00:00";
$reason = "vacation leave";
try {
    $addPause = $client->setRenewalPause($sessionID, $SubRef, $resumeDate, $reason);
    var_dump("setRenewalPause:", $addPause);
} catch (SoapFault $e) {
    echo "Error setRenewalPause: " . $e->getMessage();
}
try {
    $renewalPause = $client->getRenewalPause($sessionID, $SubRef);
    var_dump("getRenewalPause:", $renewalPause);
} catch (SoapFault $e) {
    echo "Error getRenewalPause: " . $e->getMessage();
}
exit;

Response 

The pauseSubscription call returns the above TRUE/FALSE parameters.

Parameters Type/Description
SubscriptionRef

Boolean

  • TRUE - if the call was successful and a pause was scheduled; 
  • FALSE - if the pause mechanism is not enabled for the merchant OR any of the eligibility conditions were not met OR pause is not enabled for the product OR the maximum pause duration for the product was exceeded. In this case, the system also throws the following message: "The subscription is not eligible for pause."
ResumeDate

Boolean

  • TRUE - if the call was successful and a pause was scheduled; 
  • FALSE - if the pause mechanism is not enabled for the merchant OR any of the eligibility conditions were not met OR pause is not enabled for the product OR the maximum pause duration for the product was exceeded. In this case, the system also throws the following message: "The subscription is not eligible for pause."
Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo