Problem with Paypal Express Checkout

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with Paypal Express Checkout

张良
Hi there,

  I was redirected to Paypal when the first time i click the link
/control/setPayPalCheckout after I added some items into the cart,  and I
returned back to the website without finished the payment on Paypal. Then i
failed to be redirected to Paypal again after I clicked the link
/control/setPayPalCheckout  again.

  I don't know much about the Paypal express checkout, but I found a way to
resovle this problem. I'm not sure if it's the correct way. Does anyone have
ideas about this?

  There are 3 lines in PayPalServices.java from 111 to 113:
        if (UtilValidate.isNotEmpty(token)) {
            encoder.add("TOKEN", token);
        }

  The problem went away after I commented out those 3 lines. Any helps on
this will be appreciated.

  Regards,

Liang Zhang
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

Scott Gray-2
Hi Liang,

It's been a while since I wrote the code so I can't really remember the exact specifics.  Could you consider creating a jira issue and I'll take a look at it when I get a chance?

Many thanks
Scott

HotWax Media
http://www.hotwaxmedia.com

On 13/08/2010, at 9:47 PM, 张良 wrote:

> Hi there,
>
>  I was redirected to Paypal when the first time i click the link
> /control/setPayPalCheckout after I added some items into the cart,  and I
> returned back to the website without finished the payment on Paypal. Then i
> failed to be redirected to Paypal again after I clicked the link
> /control/setPayPalCheckout  again.
>
>  I don't know much about the Paypal express checkout, but I found a way to
> resovle this problem. I'm not sure if it's the correct way. Does anyone have
> ideas about this?
>
>  There are 3 lines in PayPalServices.java from 111 to 113:
>        if (UtilValidate.isNotEmpty(token)) {
>            encoder.add("TOKEN", token);
>        }
>
>  The problem went away after I commented out those 3 lines. Any helps on
> this will be appreciated.
>
>  Regards,
>
> Liang Zhang


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

Pranay Pandey-2
In reply to this post by 张良
Hi Liang and Scott,

This is the solution to the problem that I also found when I  
communicated the issue with PayPal developers network. It seems correct.

Thanks & Regards
--
Pranay Pandey

On Aug 13, 2010, at 3:17 PM, 张良 wrote:

> Hi there,
>
>  I was redirected to Paypal when the first time i click the link
> /control/setPayPalCheckout after I added some items into the cart,  
> and I
> returned back to the website without finished the payment on Paypal.  
> Then i
> failed to be redirected to Paypal again after I clicked the link
> /control/setPayPalCheckout  again.
>
>  I don't know much about the Paypal express checkout, but I found a  
> way to
> resovle this problem. I'm not sure if it's the correct way. Does  
> anyone have
> ideas about this?
>
>  There are 3 lines in PayPalServices.java from 111 to 113:
>        if (UtilValidate.isNotEmpty(token)) {
>            encoder.add("TOKEN", token);
>        }
>
>  The problem went away after I commented out those 3 lines. Any  
> helps on
> this will be appreciated.
>
>  Regards,
>
> Liang Zhang

Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

BJ Freeman
since the code you removed checks to see if
cart.getAttribute("payPalCheckoutToken");
is empty then adds it, I would say the problem is farther up the line.


Pranay Pandey sent the following on 8/16/2010 3:40 AM:

> Hi Liang and Scott,
>
> This is the solution to the problem that I also found when I
> communicated the issue with PayPal developers network. It seems correct.
>
> Thanks & Regards
> --
> Pranay Pandey
>
> On Aug 13, 2010, at 3:17 PM, 张良 wrote:
>
>> Hi there,
>>
>> I was redirected to Paypal when the first time i click the link
>> /control/setPayPalCheckout after I added some items into the cart, and I
>> returned back to the website without finished the payment on Paypal.
>> Then i
>> failed to be redirected to Paypal again after I clicked the link
>> /control/setPayPalCheckout again.
>>
>> I don't know much about the Paypal express checkout, but I found a way to
>> resovle this problem. I'm not sure if it's the correct way. Does
>> anyone have
>> ideas about this?
>>
>> There are 3 lines in PayPalServices.java from 111 to 113:
>> if (UtilValidate.isNotEmpty(token)) {
>> encoder.add("TOKEN", token);
>> }
>>
>> The problem went away after I commented out those 3 lines. Any helps on
>> this will be appreciated.
>>
>> Regards,
>>
>> Liang Zhang
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

张良
Hi all,

  Many thanks for all your replies. I'm sorry for my lateness.

  I'm working on the PayPal stuff these days. I encountered another
problem with the function which accepts callback from Paypal then
sents response of shipping methods and shipping prices to Paypal. The
callback URL '/control/payPalCheckoutUpdate' was invoked by Paypal but
the shipping prices displayed on Paypal were not updated.

  This issue was caused by the value of the parameter named "MAXAMT"
sent to Paypal.
  In the funtion addCartDetails in PaypalServices.java, it sums up all
sub totals and other adjustments, but it may not sums up a shipping
price because there may be not a shiping price set in the cart.
  encoder.add("MAXAMT",
cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());

  For example, i bought a product values $100. The value of "MAXAMT"
would be "100". Then I was redirected to Paypal and Paypal tried to
sending address information to the website and get a shipping method
called 'EXPRESS' which costs $20. Paypal would not update the shipping
price, because 100 (sub total) + 20 (postage) > 100 (MAXAMT).

  I fixed the issue in a rough way which just add 1000 more to the MAXAMT:
  encoder.add("MAXAMT",
cart.getSubTotal().add(otherAdjustments).add(BigDecimal.valueOf(1000l)).setScale(2).toPlainString());

  And there's another problem with calculating shipping price in
funciton 'getExpressCheckout' at line 615:
      Map<String, Object> result =
ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0);
  I wrote a shipment service for one shipping method which calculates
the shipping price from the country geo id. That service can get the
contactMechId from the service context but it gets a null value from
the database:
   shippingAddress = delegator.findByPrimaryKey("PostalAddress",
UtilMisc.toMap("contactMechId", shippingContactMechId));

  I modified the code about shipping price getExpressCheckout in
PayPalServices.java and get the shipping price directly from  PayPal :
  BigDecimal shippingTotal = new BigDecimal(decoder.get("SHIPPINGAMT"));

  Cheers

Liang

2010/8/17, BJ Freeman <[hidden email]>:

> since the code you removed checks to see if
> cart.getAttribute("payPalCheckoutToken");
> is empty then adds it, I would say the problem is farther up the line.
>
>
> Pranay Pandey sent the following on 8/16/2010 3:40 AM:
>> Hi Liang and Scott,
>>
>> This is the solution to the problem that I also found when I
>> communicated the issue with PayPal developers network. It seems correct.
>>
>> Thanks & Regards
>> --
>> Pranay Pandey
>>
>> On Aug 13, 2010, at 3:17 PM, 张良 wrote:
>>
>>> Hi there,
>>>
>>> I was redirected to Paypal when the first time i click the link
>>> /control/setPayPalCheckout after I added some items into the cart, and I
>>> returned back to the website without finished the payment on Paypal.
>>> Then i
>>> failed to be redirected to Paypal again after I clicked the link
>>> /control/setPayPalCheckout again.
>>>
>>> I don't know much about the Paypal express checkout, but I found a way to
>>> resovle this problem. I'm not sure if it's the correct way. Does
>>> anyone have
>>> ideas about this?
>>>
>>> There are 3 lines in PayPalServices.java from 111 to 113:
>>> if (UtilValidate.isNotEmpty(token)) {
>>> encoder.add("TOKEN", token);
>>> }
>>>
>>> The problem went away after I commented out those 3 lines. Any helps on
>>> this will be appreciated.
>>>
>>> Regards,
>>>
>>> Liang Zhang
>>
>>
>
hdv
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

hdv
In reply to this post by 张良
hi
I am facing the same problem with paypal.after clicking on the link it gives error "No ExpressCheckout token found in cart, you must do a successful setExpressCheckout before redirecting."

I commented out those three lines but that didnt solve this problem.So is there any other solution for this problem??
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

BJ Freeman
In reply to this post by 张良
let me clarify that I use the IPN version of paypal before the express
code was introduced. So I will leave that to Scott.
as Scott mentioned please open a Jira and put comment there
https://cwiki.apache.org/confluence/display/OFBADMIN/OFBiz+Contributors+Best+Practices
an link you may find helpful
https://cwiki.apache.org/confluence/display/OFBIZ/Third+Party+Payment+and+Shipment+Configuration

What I do want to address is there are many options to passing and
receiving parameters to and from paypal.
to make Paypal interface in ofbiz flexible I added  properties, like
GetShippingFromPaypal and UsePayPalAddressVerification and the code to
support them.



张良 sent the following on 8/18/2010 12:50 AM:

> Hi all,
>
>    Many thanks for all your replies. I'm sorry for my lateness.
>
>    I'm working on the PayPal stuff these days. I encountered another
> problem with the function which accepts callback from Paypal then
> sents response of shipping methods and shipping prices to Paypal. The
> callback URL '/control/payPalCheckoutUpdate' was invoked by Paypal but
> the shipping prices displayed on Paypal were not updated.
>
>    This issue was caused by the value of the parameter named "MAXAMT"
> sent to Paypal.
>    In the funtion addCartDetails in PaypalServices.java, it sums up all
> sub totals and other adjustments, but it may not sums up a shipping
> price because there may be not a shiping price set in the cart.
>    encoder.add("MAXAMT",
> cart.getSubTotal().add(otherAdjustments).setScale(2).toPlainString());
>
>    For example, i bought a product values $100. The value of "MAXAMT"
> would be "100". Then I was redirected to Paypal and Paypal tried to
> sending address information to the website and get a shipping method
> called 'EXPRESS' which costs $20. Paypal would not update the shipping
> price, because 100 (sub total) + 20 (postage)>  100 (MAXAMT).
>
>    I fixed the issue in a rough way which just add 1000 more to the MAXAMT:
>    encoder.add("MAXAMT",
> cart.getSubTotal().add(otherAdjustments).add(BigDecimal.valueOf(1000l)).setScale(2).toPlainString());
>
>    And there's another problem with calculating shipping price in
> funciton 'getExpressCheckout' at line 615:
>        Map<String, Object>  result =
> ShippingEvents.getShipGroupEstimate(dispatcher, delegator, cart, 0);
>    I wrote a shipment service for one shipping method which calculates
> the shipping price from the country geo id. That service can get the
> contactMechId from the service context but it gets a null value from
> the database:
>     shippingAddress = delegator.findByPrimaryKey("PostalAddress",
> UtilMisc.toMap("contactMechId", shippingContactMechId));
>
>    I modified the code about shipping price getExpressCheckout in
> PayPalServices.java and get the shipping price directly from  PayPal :
>    BigDecimal shippingTotal = new BigDecimal(decoder.get("SHIPPINGAMT"));
>
>    Cheers
>
> Liang
>
> 2010/8/17, BJ Freeman<[hidden email]>:
>> since the code you removed checks to see if
>> cart.getAttribute("payPalCheckoutToken");
>> is empty then adds it, I would say the problem is farther up the line.
>>
>>
>> Pranay Pandey sent the following on 8/16/2010 3:40 AM:
>>> Hi Liang and Scott,
>>>
>>> This is the solution to the problem that I also found when I
>>> communicated the issue with PayPal developers network. It seems correct.
>>>
>>> Thanks&  Regards
>>> --
>>> Pranay Pandey
>>>
>>> On Aug 13, 2010, at 3:17 PM, 张良 wrote:
>>>
>>>> Hi there,
>>>>
>>>> I was redirected to Paypal when the first time i click the link
>>>> /control/setPayPalCheckout after I added some items into the cart, and I
>>>> returned back to the website without finished the payment on Paypal.
>>>> Then i
>>>> failed to be redirected to Paypal again after I clicked the link
>>>> /control/setPayPalCheckout again.
>>>>
>>>> I don't know much about the Paypal express checkout, but I found a way to
>>>> resovle this problem. I'm not sure if it's the correct way. Does
>>>> anyone have
>>>> ideas about this?
>>>>
>>>> There are 3 lines in PayPalServices.java from 111 to 113:
>>>> if (UtilValidate.isNotEmpty(token)) {
>>>> encoder.add("TOKEN", token);
>>>> }
>>>>
>>>> The problem went away after I commented out those 3 lines. Any helps on
>>>> this will be appreciated.
>>>>
>>>> Regards,
>>>>
>>>> Liang Zhang
>>>
>>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

Scott Gray-2
In reply to this post by hdv
What link exactly are you referring to?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 18/08/2010, at 10:47 PM, hdv wrote:

>
> hi
> I am facing the same problem with paypal.after clicking on the link it gives
> error "No ExpressCheckout token found in cart, you must do a successful
> setExpressCheckout before redirecting."
>
> I commented out those three lines but that didnt solve this problem.So is
> there any other solution for this problem??
> --
> View this message in context: http://ofbiz.135035.n4.nabble.com/Problem-with-Paypal-Express-Checkout-tp2323947p2329611.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.


smime.p7s (3K) Download Attachment
hdv
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

hdv
I am referring to this link "ecommerce/control/setPayPalCheckout".
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Paypal Express Checkout

张良
Hi all,

  A jira was created.

  Cheers.

Liang

2010/8/19 hdv <[hidden email]>

>
> I am referring to this link "ecommerce/control/setPayPalCheckout".
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Problem-with-Paypal-Express-Checkout-tp2323947p2331035.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>