Exemplo n.º 1
0
 public function testHttpsRpc()
 {
     $pr = new PayLinkRequest();
     $address = (new Address())->address1("<addressLine1>")->address2("<addressLine2>")->area("<area>");
     $cardholder = (new Cardholder())->title("<title>")->firstName("<firstName>")->lastName("<lastName>")->address($address);
     $configuration = (new Configuration())->postbackPolicy("sync")->postback("http://postback/address")->redirect("http://general/redirect")->redirectSuccess("http://success/redirect")->redirectFailure("http://failure/redirect")->options(array(Configuration::BYPASS_CUSTOMER_EMAIL, Configuration::BYPASS_MERCHANT_EMAIL, Configuration::BYPASS_AVS_ADDRESS, Configuration::BYPASS_AVS_POSTCODE, Configuration::ENFORCE_CSC_REQUIRED));
     $pr->merchantId(self::getElectronicCommerceHighPassMID())->licenceKey(self::getElectronicCommerceHighPassLicenceKey())->identifier("PaymentRequestGoodRequestPacketTest")->amount(5000)->currency("GBP")->cardholder($cardholder)->configuration($configuration);
 }
Exemplo n.º 2
0
 public function testPayLinkRequest_success()
 {
     $pr = new PayLinkRequest();
     $address = (new Address())->address1("<addressLine1>")->address2("<addressLine2>")->area("<area>");
     $cardholder = (new Cardholder())->title("<title>")->firstName("<firstName>")->lastName("<lastName>")->address($address);
     $configuration = (new Configuration())->postbackPolicy("sync")->postback("http://postback/address")->redirect("http://general/redirect")->redirectSuccess("http://success/redirect")->redirectFailure("http://failure/redirect")->options(array(Configuration::BYPASS_CUSTOMER_EMAIL, Configuration::BYPASS_MERCHANT_EMAIL, Configuration::BYPASS_AVS_ADDRESS, Configuration::BYPASS_AVS_POSTCODE, Configuration::ENFORCE_CSC_REQUIRED));
     $pr->merchantId(self::getElectronicCommerceHighPassMID())->licenceKey(self::getClientLicenceKey())->identifier("PaymentRequestGoodRequestPacketTest")->amount(5000)->currency("GBP")->cardholder($cardholder)->configuration($configuration);
     $res = $pr->saleTransaction();
     $this->assertTrue(get_class($res) == 'CityPay\\PayLink\\PayLinkToken', "Response object is of type " . get_class($res) . ", not CityPay\\PayLink\\PayLinkToken as required.");
 }