/**
  * @test
  * @codeCoverageIgnore
  */
 public function createTransactionWithToken()
 {
     $this->_model->setAmount(100)->setCurrency('EUR')->setToken('098f6bcd4621d373cade4e832627b4f6');
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Transaction', $result);
     return $result;
 }
Beispiel #2
0
 /**
  * @test
  * @codeCoverageIgnore
  */
 public function createWebhookWithEmail()
 {
     $this->_model->setEmail('*****@*****.**')->setActive(true)->setEventTypes(array('transaction.succeeded', 'subscription.created'));
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Webhook', $result, var_export($result, true));
     $this->deleteWebhook($result);
 }
Beispiel #3
0
 /**
  * @test
  * @codeCoverageIgnore
  */
 public function createPayment()
 {
     $this->_model->setToken("098f6bcd4621d373cade4e832627b4f6");
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Payment', $result);
     return $result;
 }
 /**
  * @test
  * @codeCoverageIgnore
  */
 public function createPreauthorization()
 {
     $this->_model->setToken("098f6bcd4621d373cade4e832627b4f6")->setAmount(100)->setCurrency('EUR');
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Preauthorization', $result);
     $this->assertNotNull($result . getTransaction());
     return $result;
 }
Beispiel #5
0
 /**
  * @test
  * @codeCoverageIgnore
  */
 public function createRefund()
 {
     $transactionModel = new Models\Request\Transaction();
     $transactionModel->setAmount(200)->setCurrency('EUR')->setToken("098f6bcd4621d373cade4e832627b4f6");
     $transactionModelResponse = $this->_service->create($transactionModel);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Transaction', $transactionModelResponse, var_export($transactionModelResponse, true));
     $this->_model->setAmount(100)->setDescription('EUR')->setId($transactionModelResponse->getId());
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Refund', $result, var_export($result, true));
     return $result;
 }
 /**
  * @test
  * @codeCoverageIgnore
  */
 public function createSubscriptionWithoutOffer()
 {
     $this->_model->setAmount(2000)->setCurrency('EUR')->setInterval('2 WeEK, tUEsDAY');
     $PaymentModel = new Models\Request\Payment();
     $PaymentModel->setToken("098f6bcd4621d373cade4e832627b4f6");
     $PaymentModelResponse = $this->_service->create($PaymentModel);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Payment', $PaymentModelResponse, var_export($PaymentModelResponse, true));
     $this->_model->setClient($PaymentModelResponse->getClient())->setPayment($PaymentModelResponse->getId());
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Subscription', $result, var_export($result, true));
     return $result;
 }
Beispiel #7
0
 /**
  * @test
  * @codeCoverageIgnore
  * @expectedException \Paymill\Services\PaymillException
  * @expectedExceptionMessage 'PluginsAtPaymillDotde' is not a valid email address.
  */
 public function createClientWithInvalidEmail()
 {
     $this->_model->setEmail('PluginsAtPaymillDotde')->setDescription('Test');
     $result = $this->_service->create($this->_model);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Client', $result);
     return $result;
 }
Beispiel #8
0
 /**
  * @test
  * @depends createOffer
  */
 public function getRequestSubscription($offer)
 {
     $subscriptionModel = new Models\Request\Subscription();
     $subscriptionModel->setOffer($offer->getId());
     $PaymentModel = new Models\Request\Payment();
     $PaymentModel->setToken("098f6bcd4621d373cade4e832627b4f6");
     $PaymentModelResponse = $this->_service->create($PaymentModel);
     $this->assertInstanceOf('Paymill\\Models\\Response\\Payment', $PaymentModelResponse, var_export($PaymentModelResponse, true));
     $subscriptionModel->setClient($PaymentModelResponse->getClient())->setPayment($PaymentModelResponse->getId());
     $subscription = $this->_service->create($subscriptionModel);
     $this->assertEquals($offer->getId(), $subscription->getOffer()->getId());
     return $subscription;
 }