예제 #1
0
 /**
  * @param Response\SaveCard $response
  */
 public function saveCardResponse(Response\SaveCard $response)
 {
     $response->setSuccess($response->getApiResponse('FinalStatus') === 'success');
     if ($response->getSuccess()) {
         $response->setToken($response->getApiResponse('orderID'));
         $response->setTokenExpiryDate(new \DateTime('+1 year'));
     }
 }
예제 #2
0
 /**
  * @param Helper\CreditCard $creditCard
  * @param callable $success
  * @param callable $failure
  *
  * @return Response\SaveCard
  */
 public final function saveCard(Helper\CreditCard $creditCard, callable $success, callable $failure)
 {
     $this->apiCheck(__FUNCTION__);
     $this->blacklistCheck($creditCard);
     $response = new Response\SaveCard($this->getApi());
     $response->setCreditCard($creditCard);
     $this->execute($response, __FUNCTION__, $success, $failure);
     return $response;
 }