Hi folks ! Just registered. I need to send to a Payment Gateway encrypted XML /base64/. Here are their requirements : ===================== 2.Parameter encryption Java

/String base64Xml = URLEncoder.encode(xml.toString(),"UTF-8"); sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder(); String base64 = encoder.encode(base64Xml.getBytes());

Php:

$base64 =base64_encode(urlencode($baseStr));
3.Data Submit <form action=“https://payment.server.com/payment/Interface” method=“post”> <input type=”hidden” name=”TradeInfo” value=”<%= base64 %>”/> <input type=”submit” value=”submit” /> </form>

=================== I do everything to complete my XML then I encode it base64 and try to send. They said that cannot decode it. Why? - they dont know. Me too as I'm newby in Perl. They said that maybe my string is not correctly URL encoded...Here is the part of my sending :

#======= Encode XML base64 ================================ use MIME::Base64 ; $enco = encode_base64($wr); #======= Send request to Payment Gateway ================== use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new(); my $req = POST 'https://payment.server.com/payment/Interface'; [ type=>'hidden', name=> 'TradeInfo', value=> $enco, type=>'submit', value=>'submit', ]; $content = $ua->request($req)->as_string; # print "Content-type: text/html\n\n"; print $content;

====================== $enco is encoded string. When I sent them $enco in a file they decode it correctly. But when I send through Post method they cant I receive a error.jsp?error=1001 all the time I send Mybe something wrong in my post? Or ?.... Any help ??????????????????????????????????


In reply to post form URL encoded by itko

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.