getShippingFirstName() public method

Get the first part of the card shipping name.
public getShippingFirstName ( ) : string
return string
Beispiel #1
0
 public function testShippingName()
 {
     $this->card->setShippingFirstName('Bob');
     $this->card->setShippingLastName('Smith');
     $this->assertEquals('Bob Smith', $this->card->getShippingName());
     $this->card->setShippingName('John Foo');
     $this->assertEquals('John', $this->card->getShippingFirstName());
     $this->assertEquals('Foo', $this->card->getShippingLastName());
 }
 /**
  * Returns ReD Shield risk checker parameters
  *
  * @param CreditCard $card
  * @return array
  */
 protected function getRedParams($card)
 {
     $params = ['CRITERION.RED_ebWEBSITE' => $card->getEbWebsite(), 'CRITERION.RED_EBT_GENDER' => $card->getGender(), 'CRITERION.RED_EBT_TOF' => $card->getRedTof(), 'CRITERION.RED_SHIP_ADDR1' => $card->getShippingAddress1(), 'CRITERION.RED_SHIP_ADDR2' => $card->getShippingAddress2(), 'CRITERION.RED_SHIP_CITY' => $card->getShippingCity(), 'CRITERION.RED_SHIP_CNTRY_CD' => $card->getShippingCountry(), 'CRITERION.RED_CUST_ID' => $card->getCustomerId(), 'CRITERION.RED_SHIP_EMAIL' => $card->getShippingEmail(), 'CRITERION.RED_SHIP_FNAME' => $card->getShippingFirstName(), 'CRITERION.RED_SHIP_LNAME' => $card->getShippingLastName(), 'CRITERION.RED_SHIP_HOME_PHONE' => $card->getShippingPhone(), 'CRITERION.RED_SHIP_MOBILE_PHONE' => $card->getShippingFax(), 'CRITERION.RED_SHIP_POSTAL_CD' => $card->getShippingPostcode(), 'CRITERION.RED_SHIP_STPR_CD' => $card->getShippingState()];
     foreach ($this->getItemAmount() as $idx => $value) {
         $params["CRITERION.RED_ITEM_AMT" . ($idx + 1)] = $value;
     }
     foreach ($this->getItemQty() as $idx => $value) {
         $params["CRITERION.RED_ITEM_QTY" . ($idx + 1)] = $value;
     }
     foreach ($this->getItemDesc() as $idx => $value) {
         $params["CRITERION.RED_ITEM_DESC" . ($idx + 1)] = $value;
     }
     // set number of ITEMs
     $params['CRITERION.RED_OI_REPEAT'] = max([count($this->getItemAmount()), count($this->getItemQty()), count($this->getItemDesc())]) ?: null;
     foreach ($card->getUserData() as $idx => $value) {
         $params["CRITERION.RED_EBT_USER_DATA" . ($idx + 1)] = $value;
     }
     return $params;
 }