setBillingAddress1() public method

Sets the billing address, line 1.
public setBillingAddress1 ( string $value ) : CreditCard
$value string
return CreditCard provides a fluent interface.
Beispiel #1
0
 public function setUp()
 {
     parent::setUp();
     $this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest());
     $card = new CreditCard($this->getValidCard());
     $card->setBillingAddress1('Wall street');
     $card->setBillingAddress2('Wall street 2');
     $card->setBillingCity('San Luis Obispo');
     $card->setBillingCountry('US');
     $card->setBillingPostcode('93401');
     $card->setBillingPhone('1234567');
     $card->setBillingState('CA');
     $card->setShippingAddress1('Shipping Wall street');
     $card->setShippingAddress2('Shipping Wall street 2');
     $card->setShippingCity('San Luis Obispo');
     $card->setShippingCountry('US');
     $card->setShippingPostcode('93401');
     $card->setShippingPhone('1234567');
     $card->setShippingState('CA');
     $card->setCompany('Test Business name');
     $card->setEmail('*****@*****.**');
     $this->purchaseOptions = array('amount' => 9563, 'card' => $card, 'customerId' => '9966441');
     $this->captureOptions = array('amount' => 1000, 'transactionReference' => '9988775');
     $this->voidOptions = array('accountNumber' => '12345678', 'storeId' => 'test', 'storePassword' => 'test', 'transactionReference' => '115147689');
 }
 public function setUp()
 {
     parent::setUp();
     $bankAccount = new BankAccount();
     $bankAccount->setAccountNumber("12345678");
     $bankAccount->setRoutingNumber("112200439");
     $bankAccount->setBankName("Mikey National Bank");
     $bankAccount->setBankAccountType(BankAccount::ACCOUNT_TYPE_CHECKING);
     $bankAccount->setBillingFirstName("Mikey");
     $bankAccount->setBillingLastName("DABLname");
     $bankAccount->setName("Mikey DABLname");
     $bankAccount->setBillingAddress1("15505 Pennsylvania Ave.");
     $bankAccount->setBillingCity("Washington DC");
     $bankAccount->setBillingName("FED-Payor");
     $bankAccount->setBillingPostcode("20003");
     $bankAccount->setBillingState("CA");
     $bankAccount->setBillingCountry('USA');
     $bankAccount->setBillingPhone('5555555555');
     $bankAccount->setCompany("DAB2LLC");
     $bankAccount->setEmail('*****@*****.**');
     $creditCard = new CreditCard();
     $creditCard->setNumber('4111111111111111');
     $creditCard->setCvv("432");
     $creditCard->setExpiryMonth('12');
     $creditCard->setExpiryYear('2025');
     $creditCard->setEmail('*****@*****.**');
     $creditCard->setName("Mikey DABLname");
     $creditCard->setBillingAddress1("15505 Pennsylvania Ave.");
     $creditCard->setBillingCity("Washington DC");
     $creditCard->setBillingFirstName("FED-Payor");
     $creditCard->setBillingLastName("DABLname");
     $creditCard->setBillingPostcode("20003");
     $creditCard->setBillingState("DC");
     $creditCard->setBillingCountry("USA");
     $this->gateway = new CybersourceGateway($this->getHttpClient(), $this->getHttpRequest());
     $this->gateway->setTestMode(true);
     $defaultOptions = array('merchantId' => '', 'username' => '', 'transactionKey' => '');
     if ($defaultOptions['merchantId'] != '' && $defaultOptions['username'] != '' && $defaultOptions['transactionKey'] != '' && $defaultOptions['password'] != '') {
         $purchaseOptions = array('amount' => '12.00', 'card' => $creditCard, 'merchantReferenceCode' => uniqid());
         /** @var \Omnipay\Cybersource\Message\PurchaseRequest $request */
         $request = $this->gateway->purchase(array_merge($defaultOptions, $purchaseOptions));
         /** @var \Omnipay\Cybersource\Message\CybersourceResponse $response */
         $response = $request->send();
         $this->assertEquals(true, $response->isSuccessful());
         $purchaseOptions = array('amount' => '12.00', 'bankAccount' => $bankAccount, 'merchantReferenceCode' => uniqid());
         /** @var \Omnipay\Cybersource\Message\PurchaseRequest $request */
         $request = $this->gateway->purchase(array_merge($defaultOptions, $purchaseOptions));
         $response = $request->send();
         $this->assertEquals(true, $response->isSuccessful());
         $reportOptions = array('reportDate' => new \DateTime('12/17/2014'));
         /** @var \Omnipay\Cybersource\Message\TransactionDetailReportRequest $request */
         $request = $this->gateway->transactionDetailReport(array_merge($defaultOptions, $reportOptions));
         /** @var \Omnipay\Cybersource\Message\TransactionDetailReportResponse $response */
         $response = $request->send();
         $this->assertEquals(true, $response->isSuccessful());
     }
 }
 /**
  * @param Market_OrderModel       $order
  * @param Market_PaymentFormModel $paymentForm
  *
  * @return CreditCard
  */
 private function createCard(Market_OrderModel $order, Market_PaymentFormModel $paymentForm)
 {
     $card = new CreditCard();
     $card->setFirstName($paymentForm->firstName);
     $card->setLastName($paymentForm->lastName);
     $card->setNumber($paymentForm->number);
     $card->setExpiryMonth($paymentForm->month);
     $card->setExpiryYear($paymentForm->year);
     $card->setCvv($paymentForm->cvv);
     if ($order->billingAddressId) {
         $billingAddress = $order->billingAddress;
         $card->setBillingAddress1($billingAddress->address1);
         $card->setBillingAddress2($billingAddress->address2);
         $card->setBillingCity($billingAddress->city);
         $card->setBillingPostcode($billingAddress->zipCode);
         $card->setBillingState($billingAddress->getStateText());
         $card->setBillingCountry($billingAddress->getCountryText());
         $card->setBillingPhone($billingAddress->phone);
     }
     if ($order->shippingAddressId) {
         $shippingAddress = $order->shippingAddress;
         $card->setShippingAddress1($shippingAddress->address1);
         $card->setShippingAddress2($shippingAddress->address2);
         $card->setShippingCity($shippingAddress->city);
         $card->setShippingPostcode($shippingAddress->zipCode);
         $card->setShippingState($shippingAddress->getStateText());
         $card->setShippingCountry($shippingAddress->getCountryText());
         $card->setShippingPhone($shippingAddress->phone);
         $card->setCompany($shippingAddress->company);
     }
     $card->setEmail($order->email);
     return $card;
 }
Beispiel #4
0
 public function testBillingAddress1()
 {
     $this->card->setBillingAddress1('31 Spooner St');
     $this->assertEquals('31 Spooner St', $this->card->getBillingAddress1());
     $this->assertEquals('31 Spooner St', $this->card->getAddress1());
 }