function createCustomerShippingData()
{
    $id = '1';
    $legalDocument = '63165236372';
    $name = 'Fulano da Silva';
    $address = createAddress();
    $phone = Phone::create(Phone::COMERCIAL, '11', '37288788');
    return CustomerShippingData::create($id, AbstractCustomer::TYPE_PESSOA_FISICA, $legalDocument, $name, $address, $phone);
}
Example #2
0
function createBuyer()
{
    $buyer = new Customer();
    $buyer->setMail("*****@*****.**");
    $buyer->setName("Comprador Teste");
    $buyer->setCpf("850-822-365-04");
    $buyer->setPhone("34-3311-9999");
    $buyer->setCellPhone("34-9999-1111");
    $buyer->setAddress(createAddress());
    $buyer->setGender(GenderEnum::MALE);
    $buyer->setBirthDate("01/01/1970");
    $buyer->setRg("11337733");
    $buyer->setIssueRgDate("01/01/1990");
    $buyer->setOrganConsignorRg("SSP");
    $buyer->setStateConsignorRg("MG");
    $buyer->setCompanyName("Empresa de teste");
    $buyer->setCnpj("72-139-715/0001-30");
    $buyer->setSearchToken("");
    return $buyer;
}
setOrderCustomer($order, $customer);
$customer = createCustomer('DUMON', '15b242e7-52eb-46bd-8f0e-6568b72cd9a6', 'Janine Labrune', null, 'France', 4);
$customers[] = $customer;
$order = createOrder(125, '1995-05-05', '1995-05-09', 'Federal Shipping', 100, 1, 800);
$orders[] = $order;
setCustomerOrder($customer, $order);
setOrderCustomer($order, $customer);
$order = createOrder(126, '1999-07-16', '1999-08-20', 'Speedy Express', 80, 2, 150);
$orders[] = $order;
setCustomerOrder($customer, $order);
setOrderCustomer($order, $customer);
$order = createOrder(126, '2008-08-16', '2009-08-22', 'United Package', 88, 6, 50);
$orders[] = $order;
setCustomerOrder($customer, $order);
setOrderCustomer($order, $customer);
$customer = createCustomer('EASTC', '15b242e7-52eb-46bd-8f0e-6568b72cd9a7', 'Ann Devon', createAddress('FF45', 15, 16, '35 King George', true, false), 'Germany', 3);
$customers[] = $customer;
print_r($customers);
function createAddress($houseNumber, $lineNumber, $lineNumber2, $streetName, $isValid, $isPrimary)
{
    $address = new Address4();
    $address->Address2 = new Address2();
    $address->Address2->IsPrimary = $isPrimary;
    $address->HouseNumber = $houseNumber;
    $address->IsValid = $isValid;
    $address->LineNumber = $lineNumber;
    $address->LineNumber2 = $lineNumber2;
    $address->StreetName = $streetName;
    return $address;
}
function createCustomer($customerID, $customerGuid, $customerName, $address, $country, $rating)
Example #4
0
        $errors[] = 'Please Enter a valid email. (example@email.com)';
    }
    if (isEmptyField($address)) {
        $errors[] = 'Address cannot be blank!';
    }
    if (isEmptyField($phone)) {
        $errors[] = 'Phone cannot be blank!';
    } elseif (!preg_match($validPhoneRegex, $phone)) {
        $errors[] = "Please Enter a valid Phone Number: (XXX)XXX-XXXX";
    }
    if (isEmptyField($birthday)) {
        $errors[] = 'Birthday cannot be blank!';
    }
    if (empty($errors)) {
        $image = uploadProductImage();
        if (createAddress($user_id, $address_group_id, $fullname, $email, $address, $phone, $website, $birthday, $image)) {
            $results[] = 'Address Added';
        } else {
            $results[] = 'Address was not Added';
            var_dump($user_id, $address_group_id);
        }
        //
    }
}
?>
        
        <div class="nav">
            <img class="navimg" src="../images/logo4.png"/>
            <img class="navimgtext" src="../images/ab_text_only.png"/>
            <form action='../sessiondelete.php' method="post">
            <input class="UserHomeLogout" type="submit" name="action" value="Log Out">
 public function createAddress($params)
 {
     $this->checkPerm("create person");
     $res = createAddress($params);
     if (isset($res["id"])) {
         $this->logPerson($params, 2);
     }
     return $res;
 }