NAME

Business::CPI::Role::Receiver - The person receiving the money

VERSION

version 0.916

SYNOPSIS

# when building a cart
my $cart = $cpi->new_cart({
    ...
    receivers => [
        {
            # alias for account.gateway_id
            gateway_id      => 2313,

            fixed_amount    => 50.00,
            percent_amount  => 5.00,
            pay_gateway_fee => 1,
        },
        {
            account         => $cpi->account_class->new({ ... }),
            fixed_amount    => 250.00,
            pay_gateway_fee => 0,
        },
    ],
});

DESCRIPTION

This role is meant to be included by the class which represents Receivers in the gateway, such as Business::CPI::Base::Receiver. A Receiver is an account in the gateway which is going to receive a percentage or fixed amount of the payment being made.

ATTRIBUTES

account

MANDATORY. A representation of the user account in the gateway. See the Account role for details.

gateway_id (shortcut)

This is not really an attribute, but a shortcut to the gateway_id attribute in the Account. You should provide either a gateway_id or an Account object (for the account attribute) when instantiating a Receiver object, but never both.

is_primary

Boolean. Is this the main account receiving the money, or secondary? Defaults to false, i.e., it's a secondary receiver.

pay_gateway_fee

Boolean attribute to define whether this receiver should be the one paying the gateway fees. Similar to the "feesPayer" parameter in Adaptive Payments in PayPal.

fixed_amount

The value, in the chosen currency, this receiver is getting of the payment.

percentual_amount

The percentage of the payment that this receiver is getting.

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.