function createCustomer(HpsPayPlanService $service, HpsCardHolder $cardHolder) { $customer = new HpsPayPlanCustomer(); $customer->customerIdentifier = getIdentifier($cardHolder->firstName . $cardHolder->lastName); $customer->firstName = $cardHolder->firstName; $customer->lastName = $cardHolder->lastName; $customer->customerStatus = HpsPayPlanCustomerStatus::ACTIVE; $customer->primaryEmail = $cardHolder->emailAddress; $customer->addressLine1 = $cardHolder->address->address; $customer->city = $cardHolder->address->city; $customer->stateProvince = $cardHolder->address->state; $customer->zipPostalCode = $cardHolder->address->zip; $customer->country = $cardHolder->address->country; $customer->phoneDay = $cardHolder->phoneNumber; $response = $service->addCustomer($customer); return $response->customerKey; }
public function test002AddCustomerCompany() { $customer = new HpsPayPlanCustomer(); $customer->customerIdentifier = $this->getIdentifier('Business'); $customer->company = 'AcmeCo'; $customer->customer_status = HpsPayPlanCustomerStatus::ACTIVE; $customer->primaryEmail = '*****@*****.**'; $customer->addressLine1 = '987 Elm St'; $customer->city = 'Princeton'; $customer->stateProvince = 'NJ'; $customer->zipPostalCode = '12345'; $customer->country = 'USA'; $customer->phoneDay = '5551112222'; $response = $this->service->addCustomer($customer); $this->assertEquals(true, $response != null); $this->assertEquals(true, $response->customerKey != null); self::$customerCompanyKey = $response->customerKey; }