Business::CPI::Role::Account - Manage accounts in the gateway
version 0.916
# build the gateway object my $cpi = Business::CPI->new( gateway => 'Whatever', ... ); # get data of the account about to be created # instead of Reseller, it could be a client, or data from a form, etc my $row = $db->resultset('Reseller')->find(5324); # create the object in the gateway $cpi->create_account({ id => $row->id, first_name => $row->name, last_name => $row->surname, email => $row->email, birthdate => $row->birthdate, phone => $row->phone, return_url => $myapp->root_url . '/gateway_account_created', }); # hardcoded data $cpi->create_account({ id => 43125, first_name => 'John', last_name => 'Smith', email => 'john@smith.com', birthdate => DateTime->now->subtract(years => 25), phone => '11 00001111', address => { street => 'Av. Paulista', number => '123', complement => '7º andar', district => 'Bairro X', city => 'São Paulo', state => 'SP', country => 'br', }, business => { corporate_name => 'MyCompany Ltd.', trading_name => 'MyCompany', phone => '11 11110000', address => { street => 'Alameda Santos', number => '321', complement => '3º andar', district => 'Bairro Y', city => 'São Paulo', state => 'SP', country => 'br', }, }, return_url => 'http://mrsmith.com', });
This role is used internally by the gateway to build objects representing a person's account in the gateway. In general, the end-user shouldn't have to instantiate this directly, but use the helper methods in the gateway main class. See the "SYNOPSIS" for an example, and be sure to check the gateway driver documentation for specific details and examples.
The id of the person who owns this account (or will own it, if it's being created) in the database of the application using Business::CPI. This is irrelevant for the gateway, but they store it for an easy way for the application to associate the gateway accounts to the application records.
The code that uniquely identifies this account in the gateway side.
Individual's full name. We have both full_name, and first_name and last_name because some gateways use the former, and some the latter. The application might set both the separate attributes (first and last) and the single one (full), and let the driver decide what to use. Or, the application might ignore this field, and let Business::CPI concatenate first and last names to generate the full_name.
Individual's first name.
Individual's last name.
Login of the individual in the gateway.
E-mail address of the individual.
Phone number of the individual. You can use + sign to set the country code, and you can set the area code if you want. You may use non-alphanumerical characters, such as parenthesis or spaces, but they will be removed. You cannot use letters.
Examples of valid numbers: "+55 11 98123-4567", "11 98123-4567", "98123-4567".
The date the person was born. Must be a DateTime object.
The date the account was created. Must be a DateTime object.
Boolean attribute to set whether the account represents an individual person or a company.
See Business::CPI::Role::Account::Address. You should provide a HashRef with the attributes, according to the Address role, and it will be inflated for you.
See Business::CPI::Role::Account::Business. You should provide a HashRef with the attributes, according to the Business class, and it will be inflated for you.
The URL the user will be redirected when the account is created.
Estante Virtual - http://www.estantevirtual.com.br
Business::CPI, Business::CPI::Role::Account::Address, Business::CPI::Role::Account::Business, Business::CPI::Role::Buyer
André Walker <andre@andrewalker.net>
This software is copyright (c) 2014 by André Walker.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Business::CPI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::CPI
CPAN shell
perl -MCPAN -e shell install Business::CPI
For more information on module installation, please visit the detailed CPAN module installation guide.