CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: Re: [vc1048] Digest::SHA1 Problems: Edit Log



Zhris
Enthusiast

Feb 12, 2015, 12:55 AM


Views: 18804
Re: [vc1048] Digest::SHA1 Problems

Hi,

As a direct consequence of what Fishmonger pointed out, I had missed that you are also posting the parameter UMcommand_type, whereas I believe you meant to use UMcommand as per the sample. Inevitably, since the command is part of the hash, and you don't provide this value, the payment provider will not be able to generate a matching hash. Fixing this and URI encoding the values to be on the safe side will hopefully fix your issue.

Untested:


Code
if ($usaepay_test_on eq 'Yes') { $postdata = "&UMtestmode=true"; }else{ $postdata = "&UMtestmode=false"; }  

if ($UMaddcustomer eq 'Yes') {
$postdata .= "&UMkey=$UMkey&UMhash=$hash&UMamount=$tota&UMdescription=$invoice_description&UMname=$bfname%20$blname&UMstreet=$badd&UMcity=$bcity&UMstate=$bstate&UMzip=$bzip&UMcustemail=$bemail&UMinvoice=$inv_num&UMcard=$FORM{'cardnumber'}&UMexpir=$expmon$expyear&UMcvv2=$FORM{'isunumb'}&UMcommand_type=$UMcommand_type";
}else {
$postdata .= "&UMkey=$UMkey&UMhash=$hash&UMamount=$tota&UMdescription=$invoice_description&UMname=$bfname%20$blname&UMstreet=$badd&UMcity=$bcity&UMstate=$bstate&UMzip=$bzip&UMcustemail=$bemail&UMinvoice=$inv_num&UMcard=$FORM{'cardnumber'}&UMexpir=$expmon$expyear&UMcvv2=$FORM{'isunumb'}&UMcommand_type=$UMcommand_type";
}


use URI::Query;

my $postdata = URI::Query->new(
UMtestmode => ( $usaepay_test_on eq 'Yes' ) ? 'true' : 'false',
UMkey => $UMkey,
UMhash => $hash,
UMamount => $tota,
UMdescription => $invoice_description,
UMname => "$bfname $blname",
UMstreet => $badd,
UMcity => $bcity,
UMstate => $bstate,
UMzip => $bzip,
UMcustemail => $bemail,
UMinvoice => $inv_num,
UMcard => $FORM{'cardnumber'},
UMexpir => "$expmon$expyear",
UMcvv2 => $FORM{'isunumb'},
UMcommand => $UMcommand_type,
)->stringify;



Regards,

Chris


(This post was edited by Zhris on Feb 12, 2015, 1:09 AM)


Edit Log:
Post edited by Zhris (Enthusiast) on Feb 12, 2015, 12:56 AM
Post edited by Zhris (Enthusiast) on Feb 12, 2015, 1:09 AM
Post edited by Zhris (Enthusiast) on Feb 12, 2015, 1:09 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives