My PHP Code \[code\]<?php$xml="<request><point_of_sale_id>XXXXXXX</point_of_sale_id><order_id>XXXXXXX</order_id><amount>XXXXXXX</amount><description>XXXXXXX</description><result_url>XXXXXXX</result_url><server_url>XXXXXXX</server_url></request>";$parameters_xml=base64_encode($xml);$merchant_secret_code='XXXXXXX';$signature=base64_encode(sha1($xml.$merchant_secret_code,1));echo "<form action=\"https://www.i-koruna.com/i-koruna/api/payment/payment-entry-point.jsf\"\n"; echo "method=\"POST\" accept-charset=\"utf-8\">\n"; echo "<input type=\"hidden\" name=\"api_version\" value=http://stackoverflow.com/"v2\" />\n"; echo "<input type=\"hidden\" name=\"parameters_xml\" value=http://stackoverflow.com/"$parameters_xml\" /> \n"; echo "<input type=\"hidden\" name=\"signature\" value=http://stackoverflow.com/"$signature\" />\n"; echo "<input type=\"hidden\" name=\"locale\" value=http://stackoverflow.com/"en\" />\n"; echo "<input type=\"submit\" value=http://stackoverflow.com/"Buy\" />\n"; echo "</form> \n";?>\[/code\]this code is working but same reproduction of it in perlPerl Code\[code\] use MIME::Base64; use Digest::SHA qw(sha1); my $parameters_xml = encode_base64("<request><point_of_sale_id>".$c->{ikoruna_pos}."</point_of_sale_id><order_id>$id</order_id><amount>".$f->{amount}."</amount><description>".$c->{item_name}."</description><result_url>$c->{site_url}/?payment_complete=$id-$usr_id</result_url><server_url>$c->{site_url}/?payment_complete=$id-$usr_id</server_url></request>"); $parameters_xml =~ s/\s+//g; my $merchant = 'XXXXXXXXXXXXX'; my $signature=encode_base64(sha1($parameters_xml.$merchant), ''); print "Content-type:text/html\n\n";print <<END<form action="https://www.i-koruna.com/i-koruna/api/payment/payment-entry-point.jsf" method="POST" accept-charset="utf-8"> <input type="hidden" name="api_version" value="http://stackoverflow.com/questions/14488527/v2" /> <input type="hidden" name="parameters_xml" value="http://stackoverflow.com/questions/14488527/$parameters_xml" /> <input type="hidden" name="signature" value="http://stackoverflow.com/questions/14488527/$signature" /> <input type="hidden" name="locale" value="http://stackoverflow.com/questions/14488527/en" /> <input type="submit" value="http://stackoverflow.com/questions/14488527/Buy" /></form>END\[/code\]I have checked it is a problem while packing $signature am i doing this correct?Ignore the HTML part if i missed something there that is not an issue i can do itI am getting this error from merchant "Invalid merchant signature"