public function createCard(CardModel $card, BalancedUserInterface $user) { $card->setBalancedUri(uniqid()); return $card; }
public function chargeSavedCard(CardEntity $cardEntity, Customer $customer, $amount, $statement = null, $description = null) { $card = new Card(); $card->setBalancedUri($cardEntity->getBalancedUri()); return $this->chargeCard($card, $customer, $amount, $statement, $description); }
public function createCard(CardModel $card, BalancedUserInterface $user) { if ($this->debug) { $this->logger->info(sprintf("[Balanced Payment] Adding card %d", $card->getName())); } $cardData = $this->balancedPaymentCalls->createCard(array('name' => $card->getName(), 'number' => $card->getNumber(), 'cvv' => $card->getCvv(), 'month' => $card->getExpirationMonth(), 'year' => $card->getExpirationYear())); $customer = $this->balancedPaymentCalls->getCustomer($user->getBalancedUri()); $customer->addCard($cardData->{'uri'}); $card->setBalancedUri($cardData->{'uri'}); return $card; }