Business-GestPayCrypt
view release on metacpan or search on metacpan
lib/Business/GestPayCrypt.pm view on Meta::CPAN
Language => '',
MIN => '', # add 0.30
PasswordEncrypt => '', # add 0.30
ShopLogin => '',
ShopTransactionID => '',
TransactionResult => '',
VBV => '', # add 0.30
VBVrisp => '', # add 0.30
# private methods
Decripted => '',
DomainName => 'ecomm.sella.it',
ScriptEncrypt => '/CryptHTTP/Encrypt.asp',
ScriptDecrypt => '/CryptHTTP/Decrypt.asp',
ToBeEncript => '',
};
return bless $self, $class;
}
#
# implements the Get<Attribute> and Set<Attribute> methods
#
sub AUTOLOAD {
my ($self,$value) = @_;
my %permission = (
AlertCode => 'g',
AlertDescription => 'g',
Amount => 'gs',
AuthorizationCode => 'g',
BankTransactionID => 'g',
BuyerEmail => 'gs',
BuyerName => 'gs',
CardNumber => 's',
Currency => 'gs',
Country => 'g', # add 0.30
CustomInfo => 'gs',
CVV => 's', # add 0.30
EncryptedString => 'gs',
Encryption => 's', # add 0.30
ErrorCode => 'g',
ErrorDescription => 'g',
ExpMonth => 's',
ExpYear => 's',
Language => 's',
MIN => 's', # add 0.30
PasswordEncrypt => 's', # add 0.30
ShopLogin => 'gs',
ShopTransactionID => 'gs',
TransactionResult => 'g',
VBV => 'g', # add 0.30
VBVrisp => 'g', # add 0.30
);
# my $method = $GestPayCrypt::AUTOLOAD; # add comment 0.40
my $method = $Business::GestPayCrypt::AUTOLOAD; # add 0.40
$method =~ /::(Get|Set)(.*)$/;
if ( $1 eq 'Get' && ( $permission{$2} eq 'g' || $permission{$2} eq 'gs' ) ) {
return $self->{$2};
} elsif ( $1 eq 'Set' && ( $permission{$2} eq 's' || $permission{$2} eq 'gs' ) ) {
$self->{$2} = $value;
return;
} else {
my ($package,$filename,$line) = caller(); # add 0.40
die "The method $method don't exists at $filename line $line\n";
}
}
# add 0.30
sub SetWithoutEncryption {
my $self = shift;
$self->{'Encryption'} = 0;
return;
}
# add 0.30
sub SetShopTransactionID {
my ($self,$string) = @_;
$self->{'ShopTransactionID'} = url_encode(trim($string));
return;
}
# add 0.30
sub SetBuyerName {
my ($self,$string) = @_;
$self->{'BuyerName'} = url_encode(trim($string));
return;
}
# add 0.30
sub SetBuyerEmail {
my ($self,$string) = @_;
$self->{'BuyerEmail'} = trim($string);
return;
}
# add 0.30
sub SetLanguage {
my ($self,$string) = @_;
$self->{'Language'} = trim($string);
return;
}
# add 0.30
sub SetCustomInfo {
my ($self,$string) = @_;
$self->{'CustomInfo'} = url_encode(trim($string));
return;
}
# add 0.30
sub GetShopTransactionID {
my $self = shift;
return url_decode($self->{'ShopTransactionID'});
}
# add 0.30
sub GetBuyerName {
my $self = shift;
return url_decode($self->{'BuyerName'});
}
# add 0.30
sub GetCustomInfo {
( run in 2.802 seconds using v1.01-cache-2.11-cpan-6de40a662fe )