NAME
Business::CPI::Gateway::Base - Father of all gateways
VERSION
version 0.913
ATTRIBUTES
driver_name
The name of the driver for this gateway. This is built automatically, but can be customized.
Example: for Business::CPI::Gateway::TestGateway
, the driver name will be TestGateway
.
log
Provide a logger to the gateway. It's the user's responsibility to configure the logger. By default, nothing is logged. You could set this to a Log::Log4perl object, for instance, to get full logging.
item_class
The class for the items (products) being purchased. Defaults to Business::CPI::${driver_name}::Item if it exists, or Business::CPI::Base::Item otherwise.
cart_class
The class for the shopping cart (the complete order). Defaults to Business::CPI::${driver_name}::Cart if it exists, or Business::CPI::Base::Cart otherwise.
buyer_class
The class for the buyer (the sender). Defaults to Business::CPI::${driver_name}::Buyer if it exists, or Business::CPI::Base::Buyer otherwise.
account_class
The class for the accounts. Defaults to Business::CPI::${driver_name}::Account if it exists, or Business::CPI::Base::Account otherwise.
account_address_class
The class for the addresses for the accounts. Defaults to Business::CPI::${driver_name}::Account::Address if it exists, or Business::CPI::Base::Account::Address otherwise.
account_business_class
The class for the business information of accounts. Defaults to Business::CPI::${driver_name}::Account::Business if it exists, or Business::CPI::Base::Account::Business otherwise.
receiver_id
ID, login or e-mail of the business owner. The way the gateway uniquely identifies the account owner.
currency
Currency code, such as BRL, EUR, USD, etc.
notification_url
The url for the gateway to postback, notifying payment changes.
return_url
The url for the customer to return to, after they finished the payment.
checkout_with_token
Boolean attribute to determine whether the form will hold the entire cart, or it will use the payment token generated for it. Defaults to false.
checkout_url
The url the application will post the form to. Defined by the gateway.
METHODS
new_cart
Creates a new Business::CPI::Role::Cart connected to this gateway.
new_account
Creates a new instance of an account. In general, you shouldn't need to use this, except for testing. Use create_account
, instead, if your driver provides it.
get_checkout_code
Generates a payment token for a given cart. Do not call this method directly. Instead, see "get_checkout_code" in Business::CPI::Role::Cart.
get_notification_details
Get the payment notification (such as PayPal's IPN), and return a hashref with the details.
query_transactions
Search past transactions.
get_transaction_details
Get more details about a given transaction.
notify
This is supposed to be called when the gateway sends a notification about a payment status change to the application. Receives the request as a parameter (in a CGI-compatible format), and returns data about the payment. The format is still under discussion, and is soon to be documented.
map_object
Helper method for get_hidden_inputs to translate between Business::CPI and the gateway, using methods like checkout_form_items_map, checkout_form_buyer_map, etc.
AUTHOR
André Walker <andre@andrewalker.net>
COPYRIGHT AND LICENSE
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.