/** * @param TakePaymentCommand $command * * @return Payment */ protected function convertCommandToPayment(TakePaymentCommand $command) { $payment = Payment::createUnpaid($command->getCost(), $command->getToken(), $command->getDescription(), $command->getUserEmail(), $command->getMetaData()); return $payment; }
/** * Prepare common spec properties */ function __construct() { $this->currency = new Currency(self::CURRENCY); $this->cost = new Money(self::AMOUNT, $this->currency); $this->userEmail = new EmailAddress(self::USER_EMAIL); $this->metadata = ['membershipId' => self::MEMBERSHIP_ID]; $this->expectedUnpaidPayment = Payment::createUnpaid($this->cost, self::TOKEN, self::DESCRIPTION, $this->userEmail, $this->metadata); $this->paymentId = self::PAYMENT_ID; $this->stripePaymentId = new StripePaymentId(self::STRIPE_PAYMENT_ID); $this->expectedUnpaidSavedPayment = clone $this->expectedUnpaidPayment; $this->expectedUnpaidSavedPayment->assignId(new PaymentId($this->paymentId)); $this->expectedProcessedPayment = clone $this->expectedUnpaidSavedPayment; $this->expectedProcessedPayment->hasBeenPaidWithGatewayTransaction($this->stripePaymentId); }