cancelSubscription() публичный Метод

public cancelSubscription ( )
Пример #1
0
 public function xChangePlanAction()
 {
     if (!$this->getParam('package')) {
         $this->response->failure("z");
     }
     if ($this->billing->package == $this->getParam('package')) {
         $this->response->success();
     }
     if ($this->getParam('package') == 'cancel') {
         if ($this->billing->subscriptionId) {
             $this->billing->cancelSubscription();
         }
         $this->response->success("Subscription cancelled: Scalr has STOPPED managing your instances.  You can reactivate your account at any time.");
         return;
     }
     if ($this->billing->subscriptionId) {
         $this->billing->changePackage($this->getParam('package'));
         $this->response->success("Subscription successfully updated");
     } else {
         if (!$this->getParam('postalCode')) {
             $this->response->failure("Billing postal code is required");
             exit;
         }
         $this->billing->createSubscription($this->getParam('package'), $this->getParam('ccNumber'), $this->getParam('ccExpMonth'), $this->getParam('ccExpYear'), $this->getParam('ccCvv'), $this->getParam('firstName'), $this->getParam('lastName'), $this->getParam('postalCode'));
         $this->response->success("Subscription successfully created");
     }
 }
Пример #2
0
 public function xChangePlanAction()
 {
     if (!$this->getParam('package')) {
         $this->response->failure("z");
     }
     if ($this->billing->package == $this->getParam('package')) {
         $this->response->success();
     }
     if ($this->getParam('package') == 'cancel') {
         if ($this->billing->subscriptionId) {
             $this->billing->cancelSubscription();
         }
         $this->response->success("Your subscription has been cancelled, you will no longer be charged. Since your account was overdue, the cancellation is immediate and you will no longer be able to manage your infrastructure through Scalr, and all Scalr automation will cease.");
         return;
     }
     if ($this->billing->subscriptionId) {
         $this->billing->changePackage($this->getParam('package'));
         $this->response->success("Subscription successfully updated");
     } else {
         if (!$this->getParam('postalCode')) {
             $this->response->failure("Billing postal code is required");
             exit;
         }
         $this->billing->createSubscription($this->getParam('package'), $this->getParam('ccNumber'), $this->getParam('ccExpMonth'), $this->getParam('ccExpYear'), $this->getParam('ccCvv'), $this->getParam('firstName'), $this->getParam('lastName'), $this->getParam('postalCode'));
         $this->response->success("Subscription successfully created");
     }
 }