/**
  * @param PaymentInterface $payment
  * @param array $options
  * @return array
  */
 public function serializePayment(PaymentInterface $payment, $options = array())
 {
     $result = array();
     if ($payment->getCustomer() && $payment->getCustomer()->getSubscriptionCustomerId()) {
         $result['customerId'] = $payment->getCustomer()->getSubscriptionCustomerId();
     }
     if ($payment->getNonce()) {
         $result['paymentMethodNonce'] = $payment->getNonce();
     }
     if (count($options) > 0) {
         $result['options'] = $options;
     }
     return $result;
 }
예제 #2
0
 /**
  * Add payment
  *
  * @param \Kairos\SubscriptionBundle\Model\PaymentInterface $payment
  * @return \Kairos\SubscriptionBundle\Model\CustomerInterface
  */
 public function addPayment(\Kairos\SubscriptionBundle\Model\PaymentInterface $payment)
 {
     $payment->setCustomer($this);
     $this->creditCards[] = $payment;
     return $this;
 }