Skip Menu |

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

Report information
The Basics
Id: 8071
Status: resolved
Priority: 0/
Queue: Business-OnlinePayment-LinkPoint

People
Owner: Nobody in particular
Requestors: william [...] knowmad.com
Cc:
AdminCc:

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



Subject: Posting a return without a credit card
Hi Ivan, Thanks for the recent update to the module to work with the latest API and stop forcing the test server. I have run into a situation where I need post a return for an order but do not want to keep the credit card on file. According to the tech support rep at LinkPoint, there are credits and returns. I've tried to explain the difference in the patch I've attached to this post. In addition to the new 'order_number' key, I also added a 'debug' key to control when the warnings are printed to my log. I'd rather not have credit card info printed to a plaintext log by default. However, this output is extremely useful when trying to debug code. If you have a better solution, please improve my patch. I looked at other modules but none had any info about debugging in their POD. I updated the POD with these details. Please review and comment. I'd love to see this patch be included in the next release. Regards, William
--- /tmp/Business-OnlinePayment-LinkPoint-0.04/LinkPoint.pm Thu Jun 24 11:32:33 2004 +++ perl5/Business/OnlinePayment/LinkPoint.pm Wed Oct 20 16:53:27 2004 @@ -99,7 +99,8 @@ my %content = $self->content; my($month, $year); - unless ( $content{action} eq 'POSTAUTH' ) { + unless ( $content{'action'} eq 'POSTAUTH' || + ( $content{'action'} eq 'CREDIT' && exists $content{'order_number'} )) { if ( $self->transaction_type() =~ /^(cc|visa|mastercard|american express|discover)$/i @@ -139,6 +140,7 @@ cardexpmonth => \$month, cardexpyear => \$year, chargetotal => 'amount', + oid => 'order_number', ); my $lperl = new LPPERL; @@ -152,16 +154,18 @@ result chargetotal cardnumber cardexpmonth cardexpyear name email phone addrnum city state zip country + oid /); - $post_data{'ordertype'} = $content{action}; - + $post_data{'ordertype'} = $content{action}; if ( $content{'cvv2'} ) { $post_data{cvmindicator} = 'provided'; $post_data{cvmvalue} = $content{'cvv2'}; } - warn "$_ => $post_data{$_}\n" foreach keys %post_data; + if (exists $content{'debug'} && $content{'debug'}) { + warn "$_ => $post_data{$_}\n" foreach keys %post_data; + } my %response; #{ @@ -170,7 +174,9 @@ #} %response = $lperl->curl_process(\%post_data); - warn "$_ => $response{$_}\n" for keys %response; + if (exists $content{'debug'} && $content{'debug'}) { + warn "$_ => $response{$_}\n" for keys %response; + } if ( $response{'r_approved'} eq 'APPROVED' ) { $self->is_success(1); @@ -232,7 +238,8 @@ =head1 DESCRIPTION -For detailed information see L<Business::OnlinePayment>. +For detailed information see L<Business::OnlinePayment>. Also see the +LinkPoint API User Manual at http://www.linkpoint.com/support. =head1 COMPATIBILITY @@ -241,6 +248,38 @@ Version 0.4 of this module has been updated for the LinkPoint Perl Wrapper version 3.5. + +=head1 RETURNS AND CREDITS + +The LinkPoint API supports returns and credits. A credit allows you to return +money to any credit card. Set the action to 'CREDIT' and include the cc +number, expiration date and amount in the content method. + +A return allows you to post a credit back to the buyer without having to +submit credit card information. This type of transaction is useful when you do +not want to store credit card details on your server. Simply submit a +transaction with the action as 'CREDIT' and the order_number set to the value +returned by the original purchase (this can be retrieved using the +$tx->order_number() method after a successful sale). For example: + + $tx->content( + action => 'credit', + order_number => $order_number, + ); + $tx->submit(); + +=head1 DEBUGGING + +To enable debugging messages in your error log (STDERR), set debug to a true +value when setting the content: + + $tx->content( + type => 'VISA', + action => 'Normal Authorization', + .... + debug => 1, + ); + =head1 BUGS
The documentation part isn't LinkPoint-specific so I didn't feel right including it. Many processors support voids and credits. I did take the oid changes, and added a similar debugging flag. [guest - Wed Oct 20 16:56:28 2004]: Show quoted text
> Hi Ivan, > > Thanks for the recent update to the module to work with the latest
API Show quoted text
> and stop forcing the test server. > > I have run into a situation where I need post a return for an order > but do not want to keep the credit card on file. According to the > tech support rep at LinkPoint, there are credits and returns.
I've Show quoted text
> tried to explain the difference in the patch I've attached to
this Show quoted text
> post. > > In addition to the new 'order_number' key, I also added a 'debug'
key Show quoted text
> to control when the warnings are printed to my log. I'd rather
not Show quoted text
> have credit card info printed to a plaintext log by default. > However, this output is extremely useful when trying to debug
code. Show quoted text
> If you have a better solution, please improve my patch. I looked
at Show quoted text
> other modules but none had any info about debugging in their POD.
I Show quoted text
> updated the POD with these details. > > Please review and comment. I'd love to see this patch be included in > the next release. > > > Regards, > William