NAME

WWW::LogicBoxes::Role::Command::Customer - Customer Related Operations

SYNPOSIS

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Customer;

    my $logic_boxes = WWW::LogicBoxes->new( ... );

    # Creation
    my $customer = WWW::LogicBoxes->new( ... );
    $logic_boxes->create_customer(
        customer => $customer,
        password => 'Top Secret!',
    );

    # Retrieval
    my $retrieved_customer = $logic_boxes->get_customer_by_id( $customer->id );
    my $retrieved_customer = $logic_boxes->get_customer_by_username( $customer->username ); # An email address

REQUIRES

submit

DESCRIPTION

Implements customer related operations with the LogicBoxes's API.

METHODS

create_customer

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Customer;

    my $logic_boxes = WWW::LogicBoxes->new( ... );

    my $customer = WWW::LogicBoxes->new( ... );
    $logic_boxes->create_customer(
        customer => $customer,
        password => 'Top Secret!',
    );

    print 'New customer id: ' . $customer->id . "\n";

Given a WWW::LogicBoxes::Customer or a HashRef that can coerced into a WWW::LogicBoxes::Customer and a password, creates the specified customer.

get_customer_by_id

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Customer;

    my $logic_boxes = WWW::LogicBoxes->new( ... );

    my $retrieved_customer = $logic_boxes->get_customer_by_id( 42 );

Given an Integer ID, will return an instace of WWW::LogicBoxes::Customer. Returns undef if there is no matching WWW::LogicBoxes::Customer with the specified id.

get_customer_by_username

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Customer;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    my $retrieved_customer = $logic_boxes->get_customer_by_username(
        'domainbuyer@test-domain.com'
    );

Given an Email Address of a customer, will return an instance of WWW::LogicBoxes::Customer. Returns undef if there is no matching WWW::LogicBoxes::Customer with the specified email address.