public function testSetGetWithValidData()
 {
     $billpayPayInitParameter = new BillpayPayInitParameter();
     $billpayPayInitParameter->set('LEGALFORM', self::LEGALFORM)->set('ADDRESSADDITION', self::ADDRESSADDITION)->set('DATEOFBIRTH', self::DATEOFBIRTH)->set('DELIVERY_GENDER', self::DELIVERY_GENDER)->set('DELIVERY_FIRSTNAME', self::DELIVERY_FIRSTNAME)->set('DELIVERY_LASTNAME', self::DELIVERY_LASTNAME)->set('DELIVERY_STREET', self::DELIVERY_STREET)->set('DELIVERY_ADDRESSADDITION', self::DELIVERY_ADDRESSADDITION)->set('DELIVERY_ZIP', self::DELIVERY_ZIP)->set('DELIVERY_CITY', self::DELIVERY_CITY)->set('DELIVERY_COUNTRY', self::DELIVERY_COUNTRY)->set('DELIVERY_PHONE', self::DELIVERY_PHONE);
     $this->assertEquals(self::LEGALFORM, $billpayPayInitParameter->get('LEGALFORM'));
     $this->assertEquals(self::ADDRESSADDITION, $billpayPayInitParameter->get('ADDRESSADDITION'));
     $this->assertEquals(self::DATEOFBIRTH, $billpayPayInitParameter->get('DATEOFBIRTH'));
     $this->assertEquals(self::DELIVERY_GENDER, $billpayPayInitParameter->get('DELIVERY_GENDER'));
     $this->assertEquals(self::DELIVERY_FIRSTNAME, $billpayPayInitParameter->get('DELIVERY_FIRSTNAME'));
     $this->assertEquals(self::DELIVERY_LASTNAME, $billpayPayInitParameter->get('DELIVERY_LASTNAME'));
     $this->assertEquals(self::DELIVERY_STREET, $billpayPayInitParameter->get('DELIVERY_STREET'));
     $this->assertEquals(self::DELIVERY_ADDRESSADDITION, $billpayPayInitParameter->get('DELIVERY_ADDRESSADDITION'));
     $this->assertEquals(self::DELIVERY_ZIP, $billpayPayInitParameter->get('DELIVERY_ZIP'));
     $this->assertEquals(self::DELIVERY_CITY, $billpayPayInitParameter->get('DELIVERY_CITY'));
     $this->assertEquals(self::DELIVERY_COUNTRY, $billpayPayInitParameter->get('DELIVERY_COUNTRY'));
     $this->assertEquals(self::DELIVERY_PHONE, $billpayPayInitParameter->get('DELIVERY_PHONE'));
     $this->assertCount(0, $billpayPayInitParameter->getInvalidData());
 }
 public function testCreatePayInit()
 {
     $saferpay = new Saferpay();
     $saferpay->setHttpClient(new BuzzClient());
     $payInitParameter = new PayInitParameter();
     $payInitParameter->setAccountid('99867-94913159');
     $payInitParameter->setAmount(1200);
     $payInitParameter->setCurrency('CHF');
     $payInitParameter->setDescription(sprintf('Ordernumber: %s', '000001'));
     $payInitParameter->setOrderid(1);
     $payInitParameter->setSuccesslink('http://test.lo?status=success');
     $payInitParameter->setFaillink('http://test.lo?status=fail');
     $payInitParameter->setBacklink('http://test.lo?status=back');
     $payInitParameter->setProviderset(array(BillpayPayInitParameterInterface::PROVIDERSET_BILLPAY_INVOICE));
     $payInitParameter->setGender(PayInitParameterInterface::GENDER_COMPANY);
     $payInitParameter->setFirstname('John');
     $payInitParameter->setLastname('Doe');
     $payInitParameter->setStreet('Samplestreet 0');
     $payInitParameter->setZip('00000');
     $payInitParameter->setCity('Samplecity');
     $payInitParameter->setCountry('US');
     $payInitParameter->setLangid('EN');
     $payInitParameter->setPhone('+10000000000');
     $payInitParameter->setEmail('*****@*****.**');
     $billpayPayInitParameter = new BillpayPayInitParameter();
     $billpayPayInitParameter->setLegalform(BillpayPayInitParameterInterface::LEGALFORM_MISC);
     $billpayPayInitParameter->setDeliveryGender(PayInitParameterInterface::GENDER_COMPANY);
     $billpayPayInitParameter->setDeliveryFirstname('John');
     $billpayPayInitParameter->setDeliveryLastname('Doe');
     $billpayPayInitParameter->setDeliveryStreet('Samplestreet 0');
     $billpayPayInitParameter->setDeliveryZip('00000');
     $billpayPayInitParameter->setDeliveryCity('Samplecity');
     $billpayPayInitParameter->setDeliveryCountry('US');
     $billpayPayInitParameter->setDeliveryPhone('+10000000000');
     $payInitParameterCollection = new Collection($payInitParameter->getRequestUrl());
     $payInitParameterCollection->addCollectionItem($payInitParameter);
     $payInitParameterCollection->addCollectionItem($billpayPayInitParameter);
     $url = $saferpay->createPayInit($payInitParameterCollection);
     $this->assertStringStartsWith('https://www.saferpay.com/vt2/Pay.aspx', $url);
 }