Skip Menu |

This queue is for tickets about the Business-OnlinePayment-InternetSecure CPAN distribution.

Report information
The Basics
Id: 83653
Status: resolved
Priority: 0/
Queue: Business-OnlinePayment-InternetSecure

People
Owner: Nobody in particular
Requestors: slobodan [...] miskovic.ca
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Support for CIMB - Customer DB
Please find attached a patch that implements support for CIMB in InternetSecure. (Also, i updated documentation a bit, fixed an error in the sample code) If you are no longer actively maintaining this module I'd be willing to take over.
Subject: Business-OnlinePayment-InternetSecure-CIMB-Support.patch
diff --git a/Changes b/Changes index 5e72729..a229e64 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl extension Business::OnlinePayment::InternetSecure. +0.06 + - Added support for CIMB (Customer DB, card tokenization) + - Documentation fixes + 0.04 Sat, 19 Aug 2006 15:02:51 -0400 These changes should make it easier to switch between this module and other Business::OnlinePayment backends: diff --git a/InternetSecure.pm b/InternetSecure.pm index e8c4c69..3984d9b 100644 --- a/InternetSecure.pm +++ b/InternetSecure.pm @@ -12,7 +12,7 @@ use XML::Simple qw(xml_in xml_out); use base qw(Business::OnlinePayment Exporter); -our $VERSION = '0.04'; +our $VERSION = '0.06'; use constant SUCCESS_CODES => qw(2000 90000 900P1); @@ -182,6 +182,8 @@ sub to_xml { xxxShippingCountry ship_country xxxShippingPhone ship_phone xxxShippingEmail ship_email + + xxxCustomerDB cimb_store )); $data{MerchantNumber} = $self->merchant_id; @@ -192,6 +194,8 @@ sub to_xml { my ($y, $m) = $self->parse_expdate($content{expiration}); $data{xxxCCYear} = sprintf '%.4u' => $y; $data{xxxCCMonth} = sprintf '%.2u' => $m; + + delete $data{xxxCustomerDB} unless $data{xxxCustomerDB}; if (defined $content{cvv2} && $content{cvv2} ne '') { $data{CVV2} = 1; @@ -350,7 +354,7 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O use Business::OnlinePayment; - $txn = new Business::OnlinePayment 'InternetSecure', + my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000'; $txn->content( @@ -375,14 +379,18 @@ Business::OnlinePayment::InternetSecure - InternetSecure backend for Business::O currency => 'CAD', taxes => 'GST PST', description => 'Test transaction', + + cimb_store => 1, # Tokenization Support + + test_transaction => 1, # or -1 to dest declined ); $txn->submit; if ($txn->is_success) { - print "Card processed successfully: " . $tx->authorization . "\n"; + print "Card processed successfully: " . $txn->authorization . "\n"; } else { - print "Card was rejected: " . $tx->error_message . "\n"; + print "Card was rejected: " . $txn->error_message . "\n"; } =head1 DESCRIPTION diff --git a/META.yml b/META.yml deleted file mode 100644 index 75f6106..0000000 --- a/META.yml +++ /dev/null @@ -1,13 +0,0 @@ -# http://module-build.sourceforge.net/META-spec.html -#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# -name: Business-OnlinePayment-InternetSecure -version: 0.04 -version_from: InternetSecure.pm -installdirs: site -requires: - Business::OnlinePayment: 2 - Net::SSLeay: 0 - XML::Simple: 0 - -distribution_type: module -generated_by: ExtUtils::MakeMaker version 6.30_01 diff --git a/README b/README index ef15cc6..ec7dd81 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Business-OnlinePayment-InternetSecure version 0.01 +Business-OnlinePayment-InternetSecure version 0.06 ================================================== This is Business::OnlinePayment::InternetSecure, a Business::OnlinePayment diff --git a/t/cimb_store.t b/t/cimb_store.t new file mode 100644 index 0000000..cf73074 --- /dev/null +++ b/t/cimb_store.t @@ -0,0 +1,52 @@ +# Check for CIMB (CustomerDB) support + +use Test::More tests => 2 + 1; + +BEGIN { use_ok('Business::OnlinePayment') }; +BEGIN { use_ok('XML::Simple', qw(xml_in)) }; + +my $txn = new Business::OnlinePayment 'InternetSecure', merchant_id => '0000'; + +$txn->content( + action => 'Normal Authorization', + + card_number => '5111-1111-1111-1111', + expiration => '2013-03', + + amount => 13.95, + + cimb_store => 1, +); + +is_deeply( xml_in($txn->to_xml), xml_in(<<__EOF__) ); +<?xml version="1.0" encoding="utf-8" standalone="yes"?> +<TranxRequest> + <MerchantNumber>0000</MerchantNumber> + <xxxCard_Number>5111111111111111</xxxCard_Number> + <xxxCCMonth>03</xxxCCMonth> + <xxxCCYear>2013</xxxCCYear> + <CVV2>0</CVV2> + <CVV2Indicator></CVV2Indicator> + <Products>13.95::1::::::{CAD}</Products> + <xxxName></xxxName> + <xxxCompany></xxxCompany> + <xxxAddress></xxxAddress> + <xxxCity></xxxCity> + <xxxProvince></xxxProvince> + <xxxPostal></xxxPostal> + <xxxCountry></xxxCountry> + <xxxPhone></xxxPhone> + <xxxEmail></xxxEmail> + <xxxShippingName></xxxShippingName> + <xxxShippingCompany></xxxShippingCompany> + <xxxShippingAddress></xxxShippingAddress> + <xxxShippingCity></xxxShippingCity> + <xxxShippingProvince></xxxShippingProvince> + <xxxShippingPostal></xxxShippingPostal> + <xxxShippingCountry></xxxShippingCountry> + <xxxShippingPhone></xxxShippingPhone> + <xxxShippingEmail></xxxShippingEmail> + <xxxCustomerDB>1</xxxCustomerDB> +</TranxRequest> + +__EOF__