コード例 #1
0
ファイル: ApiCoreTestBase.php プロジェクト: apropos/sdk-php
 protected function setUp()
 {
     $logMessage = sprintf("\n%s: Test '%s' Starting.", \net\authorize\util\Helpers::now(), $this->getName());
     echo $logMessage;
     if (self::$log_file) {
         file_put_contents(self::$log_file, $logMessage, FILE_APPEND);
     }
     $this->refId = 'ref' . time();
     $this->counter = rand();
     $this->counterStr = sprintf("%s", $this->counter);
     $driversLicenseOne = new apiContract\DriversLicenseType();
     $driversLicenseOne->setNumber($this->getRandomString("DL-"));
     $driversLicenseOne->setState("WA");
     $driversLicenseOne->setDateOfBirth("01/01/1960");
     $customerOne = new apiContract\CustomerType();
     $customerOne->setType("individual");
     //TODO: CHANGE TO ENUM
     $customerOne->setId($this->getRandomString("Id"));
     $customerOne->setEmail($this->counterStr . "*****@*****.**");
     $customerOne->setPhoneNumber("1234567890");
     $customerOne->setFaxNumber("1234567891");
     //$customerOne->setDriversLicense( $driversLicenseOne);
     $customerOne->setTaxId("911011011");
     $creditCardOne = new apiContract\CreditCardType();
     $creditCardOne->setCardNumber("4111111111111111");
     $creditCardOne->setExpirationDate("2038-12");
     $this->paymentOne = new apiContract\PaymentType();
     $this->paymentOne->setCreditCard($creditCardOne);
     $this->orderType = new apiContract\OrderType();
     $this->orderType->setInvoiceNumber($this->getRandomString("Inv:"));
     $this->orderType->setDescription($this->getRandomString("Description"));
     $this->customerDataOne = new apiContract\CustomerDataType();
     //$this->customerDataOne->setDriversLicense( $customerOne->getDriversLicense());
     $this->customerDataOne->setEmail($customerOne->getEmail());
     $this->customerDataOne->setId($customerOne->getId());
     $this->customerDataOne->setTaxId($customerOne->getTaxId());
     $this->customerDataOne->setType($customerOne->getType());
     $this->customerAddressOne = new apiContract\CustomerAddressType();
     $this->customerAddressOne->setFirstName($this->getRandomString("FName"));
     $this->customerAddressOne->setLastName($this->getRandomString("LName"));
     $this->customerAddressOne->setCompany($this->getRandomString("Company"));
     $this->customerAddressOne->setAddress($this->getRandomString("StreetAdd"));
     $this->customerAddressOne->setCity("Bellevue");
     $this->customerAddressOne->setState("WA");
     $this->customerAddressOne->setZip("98004");
     $this->customerAddressOne->setCountry("USA");
     $this->customerAddressOne->setPhoneNumber($customerOne->getPhoneNumber());
     $this->customerAddressOne->setFaxNumber($customerOne->getFaxNumber());
     $this->payPalOne = new apiContract\PayPalType();
     $this->payPalOne->setPaypalLc("IT");
     $this->payPalOne->setPaypalPayflowcolor("FFFFF0");
     $this->payPalOne->setSuccessUrl($this->getRandomString("http://success.anet.net"));
     $this->payPalOne->setCancelUrl($this->getRandomString("http://cancel.anet.net"));
     //payPalHdrImg = GetRandomString("Hdr"),
     //payerID = GetRandomString("PayerId"),
 }
コード例 #2
0
 public function __construct()
 {
     $this->counter = rand();
     $this->counterStr = sprintf("%s", $this->counter);
     $driversLicenseOne = new DriversLicenseType();
     $driversLicenseOne->setNumber($this->getRandomString("DL-"));
     $driversLicenseOne->setState("WA");
     $driversLicenseOne->setDateOfBirth("01/01/1960");
     $customerOne = new CustomerType();
     $customerOne->setType("individual");
     //TODO: CHANGE TO ENUM
     $customerOne->setId($this->getRandomString("Id"));
     $customerOne->setEmail($this->counterStr . "*****@*****.**");
     $customerOne->setPhoneNumber("1234567890");
     $customerOne->setFaxNumber("1234567891");
     //$customerOne->setDriversLicense( $driversLicenseOne);
     $customerOne->setTaxId("911011011");
     $creditCardOne = new CreditCardType();
     $creditCardOne->setCardNumber("4111111111111111");
     $creditCardOne->setExpirationDate("2038-12");
     $this->paymentOne = new PaymentType();
     $this->paymentOne->setCreditCard($creditCardOne);
     $this->orderType = new OrderType();
     $this->orderType->setInvoiceNumber($this->getRandomString("Inv:"));
     $this->orderType->setDescription($this->getRandomString("Description"));
     $this->customerDataOne = new CustomerDataType();
     //$this->customerDataOne->setDriversLicense( $customerOne->getDriversLicense());
     $this->customerDataOne->setEmail($customerOne->getEmail());
     $this->customerDataOne->setId($customerOne->getId());
     $this->customerDataOne->setTaxId($customerOne->getTaxId());
     $this->customerDataOne->setType($customerOne->getType());
     $this->customerAddressOne = new CustomerAddressType();
     $this->customerAddressOne->setFirstName($this->getRandomString("FName"));
     $this->customerAddressOne->setLastName($this->getRandomString("LName"));
     $this->customerAddressOne->setCompany($this->getRandomString("Company"));
     $this->customerAddressOne->setAddress($this->getRandomString("StreetAdd"));
     $this->customerAddressOne->setCity("Bellevue");
     $this->customerAddressOne->setState("WA");
     $this->customerAddressOne->setZip("98004");
     $this->customerAddressOne->setCountry("USA");
     $this->customerAddressOne->setPhoneNumber($customerOne->getPhoneNumber());
     $this->customerAddressOne->setFaxNumber($customerOne->getFaxNumber());
 }