FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Oct 6, 2011, 1:29 PM
57 Posts

Re: Paypal anyone?

  • Category: APIs
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Paypal?
  • Replies: 7
this is what i have to integrate with moneybooker, it should not be too much different from paypal, read paypal/moneybooker API, all you need to do is to send some request data to moneybooker then you get response, you render response in a iframe then put it on xpages
 
String RequestStr = "https://www.moneybookers.com/app/payment.pl";
        URL url;
        try {
            url = new URL(RequestStr);

            URLConnection con = url.openConnection();
            HttpsURLConnection connection = (HttpsURLConnection) con;
            connection.setRequestMethod("POST");
            connection.setDoOutput(true);
            connection.setDoInput(true);
            DataOutputStream out = new DataOutputStream(connection
                    .getOutputStream());
            String content = "pay_to_email=weihang@wei.com&language=EN&amount=1&currency=EUR&detail1_description=orderID&detail1_text=ID";
            out.writeBytes(content);
            out.flush();
            out.close();
            // read response
            InputStream is = connection.getInputStream();
            String responseStr = convertStreamToString(connection
                    .getInputStream());
            responseStr = "<iframe id='iframe2' name='iframe2' width='99%' height='600' src='https://www.moneybookers.com/app/payment.pl?pay_to_email=weihang@wei.cn&language=EN&amount=1&currency=EUR&detail1_description=orderID&detail1_text=ID' frameborder='1' scrolling='yes'>"
                    + responseStr;
            responseStr += "</iframe>";
            UIComponent c = JSFUtil.findComponent("moneyBooker");
            com.ibm.xsp.component.xp.XspOutputText computedField = (com.ibm.xsp.component.xp.XspOutputText) c;
            computedField.setValue(responseStr);

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.