/** * @param string $ccNumber * @param string $ccCvv * @param string $ccExpMonth * @param string $ccExpYear * @param string $firstName * @param string $lastName * @param string $postalCode * @throws Exception */ public function xUpdateCreditCardAction($ccNumber, $ccCvv, $ccExpMonth, $ccExpYear, $firstName, $lastName, $postalCode) { $info = $this->billing->getInfo(); if (!$info['ccType'] && in_array($info['realState'], array('Canceled', 'Trial_ended', 'Unpaid'))) { $reActivate = true; } $this->billing->updateCreditCard($ccNumber, $ccCvv, $ccExpMonth, $ccExpYear, $firstName, $lastName, $postalCode); if ($reActivate) { $this->billing->reactivateSubscription(); $this->response->success("Subscription successfully re-activated"); } else { $this->response->success("Credit card details successfully updated"); } }
public function xUpdateCreditCardAction() { if (!$this->getParam('postalCode')) { $this->response->failure("Billing postal code is required"); exit; } $info = $this->billing->getInfo(); if (!$info['ccType'] && in_array($info['realState'], array('Canceled', 'Trial_ended', 'Unpaid'))) { $reActivate = true; } $this->billing->updateCreditCard($this->getParam('ccNumber'), $this->getParam('ccCvv'), $this->getParam('ccExpMonth'), $this->getParam('ccExpYear'), $this->getParam('firstName'), $this->getParam('lastName'), $this->getParam('postalCode')); if ($reActivate) { $this->billing->reactivateSubscription(); $this->response->success("Subscription successfully re-activated"); } else { $this->response->success("Credit card details successfully updated"); } }