Login  Register

Re: Users - PayPal

Posted by rohit on Aug 26, 2006; 7:22am
URL: http://ofbiz.116.s1.nabble.com/Users-PayPal-tp136968p136972.html

Hi,

I suppose this problem is still not completely resolverd. The IPN fails until another line is changes as below

// first verify this is valid from PayPal
        Map parametersMap = UtilHttp.getParameterMap(request);
        parametersMap.put("cmd", "_notify-validate");  
       
        // send off the confirm request    
        String confirmResp = null;

        try {
            String str = UtilHttp.urlEncodeArgs(parametersMap, false); ( 'false' had to be added for the IPN to be properly received, other we get the error mentioned on this link http://www.nabble.com/paypal-IPN-error.-IPN-is-not-received-and-transaction-is-not-recorded-tf2126743.html#a5868092)

            URL u = new URL("http://www.paypal.com/cgi-bin/webscr");
            URLConnection uc = u.openConnection();
            uc.setDoOutput(true);

But the IPN is still not correctly processed, as it gets stuck in the following code:

        // get the orderId
        String orderId = request.getParameter("invoice");

        // get the order header
        GenericValue orderHeader = null;
        if (UtilValidate.isNotEmpty(orderId)) {
            try {
                orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
            } catch (GenericEntityException e) {
                Debug.logError(e, "Cannot get the order header for order: " + orderId, module);
                request.setAttribute("_ERROR_MESSAGE_", "Problems getting order header.");
                return "error";
            }
        } else {
            Debug.logError("PayPal did not callback with a valid orderId!", module);
            request.setAttribute("_ERROR_MESSAGE_", "No valid orderId returned with PayPal Callback.");
            return "error";
        }

and we get this error:  

2006-08-25 12:34:57,090 (http-0.0.0.0-7070-Processor6) [     RequestHandler.java:144:INFO ] This is the first request in this visit.
2006-08-25 12:34:57,716 (http-0.0.0.0-7070-Processor6) [     RequestHandler.java:203:INFO ] [Processing Request]: payPalNotify
2006-08-25 12:34:58,043 (http-0.0.0.0-7070-Processor6) [       PayPalEvents.java:222:ERROR] PayPal Verification Response: VERIFIED
2006-08-25 12:34:58,045 (http-0.0.0.0-7070-Processor6) [       PayPalEvents.java:229:INFO ] Got verification from PayPal, processing..
2006-08-25 12:34:58,056 (http-0.0.0.0-7070-Processor6) [       PayPalEvents.java:268:ERROR] PayPal did not callback with a valid orderId!
2006-08-25 12:34:59,192 (http-0.0.0.0-7070-Processor6) [     RequestHandler.java:274:ERROR] Request payPalNotify caused an error with the following message: No valid orderId returned with PayPal Callback.
2006-08-25 12:34:59,194 (http-0.0.0.0-7070-Processor6) [     RequestHandler.java:386:INFO ] [RequestHandler.doRequest]: Response is a view.


I not sure why the order ID is not retreived.

rohit

A. Zeneski wrote
Done.

On May 15, 2006, at 1:06 PM, Hao Jiang wrote:

> Hi, I've fixed it. The problem is not the email address format, which
> bizdev%40userful.com is OK, but look at the URL string, it uses  
> "&"
> instead of "&", that's not acceptable.
>
> Looking at the class
> ofbiz/applications/accounting/src/org/ofbiz/accounting/thirdparty/
> paypal/PayPalEvents.java
>
> at line 162,
> String encodedParameters = UtilHttp.urlEncodeArgs(parameters);
>
> then look at UtilHttp class, this will eventually call
> urlEncodeArgs(parameters, true), then return "&", not "&"
>
> so the easiest way to fix it is modify the line 162 code to
> String encodedParameters = UtilHttp.urlEncodeArgs(parameters, false);
>
> Hao
>
>
>
> On Mon, 2006-05-15 at 04:52 -0700, rohit2006 wrote:
>> hey, i am too getting the same error. the business email ID is shown
>> bizdev%40userful.com in the paypal URL, which paypal does not accept.
>> someone please help. i am using opentaps-0.9.0.
>>
>> rohit
>> --
>> View this message in context: http://www.nabble.com/Users---PayPal- 
>> t940082.html#a4390637
>> Sent from the OFBiz - User forum at Nabble.com.
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users@lists.ofbiz.org
>> http://lists.ofbiz.org/mailman/listinfo/users
>>
>
>
>
> _______________________________________________
> Users mailing list
> Users@lists.ofbiz.org
> http://lists.ofbiz.org/mailman/listinfo/users

 
_______________________________________________
Users mailing list
Users@lists.ofbiz.org
http://lists.ofbiz.org/mailman/listinfo/users