示例#1
0
<?php

include __DIR__ . '/../vendor/autoload.php';
$yaml = new \Symfony\Component\Yaml\Parser();
$credentials = $yaml->parse(file_get_contents(__DIR__ . '/config.yml'));
try {
    $client = new \Frontsystems\Client($credentials['username'], $credentials['password']);
    $customer_service = new \Frontsystems\Customer($client);
    $customer_id = $customer_service->getCustomerByEmail($credentials['email'])->getCustomerId();
    $address = new \Frontsystems\Entity\Address($customer_id, 'Name', 'Address', 'Zip', 'City', 'Country', false, 'Phone', 'Comment');
    $address_service = new \Frontsystems\Address($client);
    var_dump($address_service->save($address)->getResult());
    var_dump($address_service->getAddressId());
} catch (\Exception $e) {
    var_dump($e);
}
示例#2
0
<?php

include __DIR__ . '/../vendor/autoload.php';
$yaml = new \Symfony\Component\Yaml\Parser();
$credentials = $yaml->parse(file_get_contents(__DIR__ . '/config.yml'));
try {
    $client = new \Frontsystems\Client($credentials['username'], $credentials['password']);
    $customer = new \Frontsystems\Entity\Customer(0.0, 'Address', 'City', 'Comment', 'Country', $credentials['email'], 'FirstName', 'LastName', 'Phone', 'Zip', 'DlvAddress', 'DlvCity', 'DlvComment', 'DlvName', 'DlvPhone', 'DlvZip');
    $customer_service = new \Frontsystems\Customer($client);
    var_dump($customer_service->save($customer)->getResult());
    var_dump($customer_service->getCustomerByEmail($credentials['email'])->getResult());
    var_dump($customer_service->getCustomerId());
    var_dump($customer_service->setCustomerId(123)->getCustomer());
} catch (\Exception $e) {
    var_dump($e);
}