예제 #1
0
 /**
  * @group integration
  */
 public function testCreatePaymentMoto()
 {
     $payment = new Payment();
     $payment->setType(Payment::TYPE_MOTO);
     $payment->setValue(12);
     $request = new CreatePayment($payment);
     $response = $this->getClient()->request($request);
     $this->assertTrue($response->isValid());
     $this->assertSame('ok0', $response->getStatus());
     $this->assertStringStartsWith('ep_country and ep_entity and ep_user and ep_cin ok', $response->getMessage());
     $this->assertSame($this->getConfig()->getCin(), $response->getCin());
     $this->assertSame($this->getConfig()->getUser(), $response->getUser());
     $this->assertSame($this->getConfig()->getEntity(), $response->getEntity());
     $this->assertTrue($response->getReference() != null);
     $this->assertSame($payment->getValue(), $response->getValue());
     $this->assertSame($payment->getKey(), $response->getKey());
     $this->assertRegExp('#https?://(test\\.|www\\.)?easypay.pt/_s/.*#', $response->getLink());
 }
예제 #2
0
 public function testMotoPayment()
 {
     $payment = new Payment();
     $payment->setType(Payment::TYPE_MOTO);
     $payment->setValue(10);
     $payment->setKey('key');
     $request = new CreatePayment($payment);
     $params = $request->handleRequest($this->getConfig());
     $this->assertTrue(is_array($params));
     $this->assertCount(9, $params);
     $this->assertSame('cin', $params['ep_cin']);
     $this->assertSame('user', $params['ep_user']);
     $this->assertSame('entity', $params['ep_entity']);
     $this->assertSame('language', $params['ep_language']);
     $this->assertSame('country', $params['ep_country']);
     $this->assertSame('auto', $params['ep_ref_type']);
     $this->assertSame('moto', $params['ep_type']);
     $this->assertSame('10', $params['t_value']);
     $this->assertSame('key', $params['t_key']);
 }
예제 #3
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testInvalidType()
 {
     $payment = new Payment();
     $payment->setType('invalid');
 }