Marketpress Bug ?

Hi There,

Can you please help me with this bug…

When a transaction is successful, the shipping cost is not shown in the “order detail” page and in the “manage section” (for seller). Only the total of transaction is shown.

This issue happens with “Paypal Chained Payment Gateway”

Thanks.

Marketpress:2.5.5

Multisite.

global cart:off

Gateway: Paypal chained payment

Paypal: sandbox mode

  • JDJ
    • Flash Drive

    Hi Timothy,

    Thanks for your reply.

    the product is not a digital download.

    i did a test with express checkout as well and the info is showing.

    when buying the same product with paypal chained payment gateway the info seems to get lost :

    see screenshots:

    Thanks

  • Timothy
    • Chief Pigeon

    Hey again.

    Yeah I’ve just been playing with it all again and changing things around. Had some chained gateway issues which is why it took me a while to get back. I get the same thing, no shipping when using the chained gateway.

    I will let Aaron know.

    Thanks.

  • Aaron
    • CTO

    Just curious when testing this did you get redirected back to the confirmation screen after paying?

    Also, is your test site publically accesible on the web? One of the endpoints where orders are created is via the IPN notice from PayPal’s servers, and if they couldn’t contact your site that might be tied to this symptom.

  • JDJ
    • Flash Drive

    Hi Aaron,

    When using chained payment, i get redirected by paypal to the order confirmation page ( store/shopping-cart/confirmation/ ) which print the following info: Thank you for your order! We appreciate your business,.. transaction number….you can track your order here…

    When using paypal express (which works fine) i get here: /store/shopping-cart/confirm-checkout/?token=EC-3DE993344R588024P&PayerID=294RG2PTCZ4FC

    which asks to confirm the transaction before getting to the confirmation page ( thank you for your order…:wink:

    so it seems that there is 1 step missing while using chained payment compared to express checkout.

    my test site is publicly accessible. I do not have any issues with the paypal express checkout gateway which uses IPN as well so the server might not be the problem.

    Thanks for helping me with this.

  • JDJ
    • Flash Drive

    Order notes ( special instructions ) are not showing up as well.

    basically it is impossible to sell a physical product using chained payment as all important information for the seller/buyer are missing.

    This issue should be addressed urgently.

    Thanks.

  • JDJ
    • Flash Drive

    Hi Aaron,

    Thanks for looking into this.

    I agree “multiple topics won’t get it fixed faster” but it took 10 days (and two previous topics) to get the “attention” of a developer on this. Thanks to Timothy for really testing and flagging you about this issue.

  • JDJ
    • Flash Drive

    Hi Timothy,

    thanks for trying again with 2.5.6.

    I think Aaron knows about the issue now.

    this happens in sandbox so its maybe not the case (hopefully) in live mode.

    I am now trying to set chained payment in live mode to see if this issue remains but i can’t get live mode to work so far: https://premium.wpmudev.org/forums/topic/chained-payment-live-api-error-code-550001

    Do you have an install working with Chained payments in live mode? if yes, could you try creating a $0.5 product with 0.5$ shipping (not a download) which should be enough to go through and test. i can be the buyer if needed.

    Thanks

  • Timothy
    • Chief Pigeon

    Hey again.

    I see Aaron responded over there. Not sure if you saw that yet or not?

    Do you have an install working with Chained payments in live mode? if yes, could you try creating a $0.5 product with 0.5$ shipping (not a download) which should be enough to go through and test. i can be the buyer if needed.

    I do have a few client sites in an MS install. I’ll see if they mind me taking a peek for chained/shipping.

    Take care.

  • JDJ
    • Flash Drive

    Hi Aaron,

    i tried with 2.5.7 in live mode and on a fresh wp install in sandbox. I still don’t get the details for the shipping price, tax price or discount value after the payment is made. These details are not showing in manage orders or order details page.

    Also, i noticed that within the transaction details page in Paypal, the “shopping cart contents”, “Shipping”, “Sales Tax” are not present as it would be with a normal express checkout transaction. Is this due to the use of the chained payments API ?

  • Aaron
    • CTO

    i tried with 2.5.7 in live mode and on a fresh wp install in sandbox. I still don’t get the details for the shipping price, tax price or discount value after the payment is made. These details are not showing in manage orders or order details page.

    This is for new checkouts since the upgrade? I confirmed the issue, found and fixed it, and confirmed it fixed. Perhaps you didn’t upgrade completely?

    Also, i noticed that within the transaction details page in Paypal, the “shopping cart contents”, “Shipping”, “Sales Tax” are not present as it would be with a normal express checkout transaction. Is this due to the use of the chained payments API ?

    Those aren’t sent separately to PayPal with chained payments, their API doesn’t support it.

  • JDJ
    • Flash Drive

    yes new checkouts for the fresh wp mu install subfolder ( sandbox) wp 3.3.1…

    on the live api install ( subdomains) i tried with the same product…

    I will try again then, maybe on a different server if needed.

    could you let me know under which config you got it work? wp version, php version , that would be helpful

    Thanks

  • JDJ
    • Flash Drive

    Hi Aaron,

    I have tried again and again..also on different servers.

    I do not know what has been fixed in 2.5.7 .

    The original problem still remains: the shipping price is not returned anywhere after the transaction is made (please see screen shots below.) the same goes for taxes.

    Now , my membership is ending in one day. I do not feel confident about investing any more time and money, just to be able to get a product with a basic functioning shopping cart with chained payments.

    I understand that there may be certain bumps along the road, but with the lag time in response and the back and forth with no results, I don't see how renewing my membership would help me with my business.

    Please advise.

  • JDJ
    • Flash Drive

    Hi Aaron,

    thanks for getting back on it again.

    1. Yes the order had 1$ shipping ( flat rate shipping from the shipping tab settings – not extra shipping on product page) as per screenshot item cost is 1 $ and order total is 2$.

    so shipping is 1$ as set in shipping settings. i haven’t added taxes in this example.

    2. Yes i do let paypal redirect to the site automatically.

    is there a demo site i could use where chained payments works so i could login as a seller? If not, would you mind testing one of my test sites?

    Thanks.

  • JDJ
    • Flash Drive

    Yes, the transaction was successful. Seller got paid, the marketplace got the commission. I used a small amount in this test as it was live, but played with larger amounts in sandbox with the same results.

    I did another test earlier and noticed that the last page where the shipping detail appears is: “confirm your purchase” .

    after hitting the “confirm payment” button to go to PayPal, the shipping detail is gone. PayPal shows the total transaction only and the invoice number in “Your payment summary” before login into Paypal to purchase. It seems that the shipping price detail is lost here.

  • Aaron
    • CTO

    I’m not really sure what to do with this as I found the bug and fixed it, and it works for me. Only thing I can think is something wierd with your server setup.

    Do you know of anything installed that could affect transients being set/kept?

    Can you watch your options table, both when you get directed to paypal, and after you get returned. Look for the ‘_transient_timeout_mp_order_ORDERID_shipping’ meta key, it should be created when you get sent to paypal, then when brought back from paypal the plugin will read that, create the order, then delete it. Those transients are supposed to stick in the table for up to 12 hours.

  • jruckman
    • WPMU DEV Initiate

    Thank you @jdj

    I believe we are talking about the same thing. And since I can not get a response on the post I started, I am going to jump in here.

    @aaron hopefully this images will further help you troubleshoot.

    Seems like a minor detail, but is a requirement that the client has to have. And, per your comment on my post, “all the shopping cart content/detail is sent to PayPal” – I agree that the content is available via the cart, but I can’t see that ALL of it is being sent, if it is, it’s not connecting properly with PayPal. Even more so, since cart total and shipping total show up as a lump sum in PayPal (see marketpress-example.jpg).

    Additionally, I did not have any promotions setup at all.

    Thank you for your help.

  • JDJ
    • Flash Drive

    @jruckman

    I do understand the issue with express checkout not showing the shipping & Tax WITHIN PAYPAL and I do think it is important for marketpress to be able to sit next to other shopping carts.

    The issue is also similar with chained payments as the data ( shipping&Tax) are not available either within PayPal.

    Nontheless, this thread is to try to get the data ( Shipping & tax) WITHIN MARKETPRESS. Until now, I can’t get it to work which makes the gateway unusable to sell tangible products. ( no shipping&tax data in manage orders or mp emails)

    I did some research about express-checkout, so I will write back on your thread to make sure that we do not confuse our different issues which might complicate things:

    https://premium.wpmudev.org/forums/topic/help-configuring-marketpress-to-send-all-transaction-details-to-paypal

  • JDJ
    • Flash Drive

    Hi Aaron,

    I have been using flat rate shipping. I Haven’t tried with any other shipping method yet.

    About the transient: I do get them.

    When using debug bar along with the debug transient plugin, i can see that the 3 transients are created:

    One for User_id (containing array:id) , the other for shipping info (array: name, address…:wink: and the last one, cart (array: price, quantity, download )

    The shipping_price and tax_price are not contained whithin the transients…

    So maybe the problem is here…

  • Aaron
    • CTO

    Ok, I think i’ve sorted where the issue it happening. As I am testing on a local install, the IPN never reaches me so order is created at the point of redirection.

    I’m guessing on your install it’s live so the IPN is coming and creating the order before the redirect, and when created by an IPN it can’t calculate shipping/tax totals.

    Lets try and disable IPN order creation. Around line 531 of the gateway file, change:

    if ($mp->get_order($order_id)) {
    $mp->update_order_payment_status($order_id, $status, $paid);
    } else if ($create_order) {
    //succesful payment, create our order now
    $cart = get_transient('mp_order_' . $order_id . '_cart');
    $shipping_info = get_transient('mp_order_' . $order_id . '_shipping');
    $user_id = get_transient('mp_order_' . $order_id . '_userid');
    $success = $mp->create_order($order_id, $cart, $shipping_info, $payment_info, $paid, $user_id);

    //if successful delete transients
    if ($success) {
    delete_transient('mp_order_' . $order_id . '_cart');
    delete_transient('mp_order_' . $order_id . '_shipping');
    delete_transient('mp_order_' . $order_id . '_userid');
    }
    }

    to

    if ($mp->get_order($order_id)) {
    $mp->update_order_payment_status($order_id, $status, $paid);
    }

  • JDJ
    • Flash Drive

    Thanks Aaron, it works!!!

    I now get the shipping in the order details and manage orders!

    does it means that the order is now created before the IPN is returned? In that case can we use the ipn to simply change the status from “pending” to “complete” when the IPN arrives?

    Thanks again!

  • JDJ
    • Flash Drive

    1)

    I tested 2.5.8 beta with a product including shipping, tax and discount. Everything is ok with the redirect. I get the shipping, tax and the discount back in “manage order and order details” as well as email notification from mp.

    It works also for order creation via IPN for shipping and tax, but the coupon value is missing or shows N/A in manage orders.

    I guess adding one more transient including the coupon_value should do the trick.

    2)

    Since Paypal API seems to have been recently improved and before the new marketpress version is released, do you mind having a look at the new API documentation, which could address the similar issue with express checkout not passing the shipping and tax data into Paypal.

    It now seems that all this could be possible to achieve with Chained Payments gateway as well, using the “GetPaymentOptions” or “SetPaymentOptions” API operations for adaptive payments.

    More precisely…the “invoice Data fields” containing invoice items, total tax and total shipping.

    For more details, please see page 140 of:

    https://cms.paypal.com/cms_content/US/en_US/files/developer/PP_AdaptivePayments.pdf

    Would be great to know your thoughts about it.

    Thanks.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.