Google-Checkout
view release on metacpan or search on metacpan
lib/Google/Checkout/General/MerchantCalculations.pm view on Meta::CPAN
=item new URL => ..., COUPONS => ..., CERTIFICATES => ...
Constructor. The URL argument should be a link for merchant calculation.
The COUPONS and CERTIFICATES arguments should be either a true or false
value to signal whether coupons and gift certificates are supported or not.
=item get_url
Returns the callback URL.
=item set_url URL
Sets the callback URL.
=item get_coupons
Returns the string "true" if coupons are supported.
Otherwise, returns the string "false".
=item set_coupons FLAG
Enable (if FLAG is true) or disable (if FLAG is false)
coupon support.
=item get_certificates
Returns the string "true" if gift certificates are supported.
Otherwise, returns the string "false".
=item set_certificates FLAG
Enable (if FLAG is true) or disable (if FLAG is false)
gift certificate support.
=back
=cut
=head1 COPYRIGHT
Copyright 2006 Google. All rights reserved.
=cut
#--
#-- <merchant-calculations>
#--
use strict;
use warnings;
sub new
{
my ($class, %args) = @_;
my $self = {url => $args{url} || '',
coupons => $args{coupons} ? 'true' : 'false',
certificates => $args{certificates} ? 'true' : 'false'};
return bless $self => $class;
}
sub get_url
{
my ($self) = @_;
return $self->{url};
}
sub set_url
{
my ($self, $url) = @_;
$self->{url} = $url if $url;
}
sub get_coupons
{
my ($self) = @_;
return $self->{coupons};
}
sub set_coupons
{
my ($self, $coupons) = @_;
$self->{coupons} = $coupons ? 'true' : 'false';
}
sub get_certificates
{
my ($self) = @_;
return $self->{certificates};
}
sub set_certificates
{
my ($self, $certificates) = @_;
$self->{certificates} = $certificates ? 'true' : 'false';
}
1;
( run in 1.080 second using v1.01-cache-2.11-cpan-5b529ec07f3 )