Support » Plugin: PayPal for WooCommerce » DoAuthorize -> DoCapture

  • 1) I have tryed your plugin and your DoAuthorize & DoCapture method works well in Paypal Express Checkout but it doesn’t permit to capture a price minor than the authorized amount.

    If i make some discount or if i remove an item ordered from the order with the standard woocommerce method, the capture method must get the new amount not the old one.

    2) I would like to have standard DoAuthorize & DoCapture method on standard paypal payment method. Woocommerce implementation have already authorize possibility but it doesn’t have capture from order page. I don’t understand why nobody implement it?

    Thanks for your work.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor angelleye

    (@angelleye)

    1) So you’re saying if you run an order for $100 and then try to capture $70 against that order it’s actually capturing the full $100 instead? That is odd, and we haven’t had any other reports of that, so I guess I would need more details to try and figure out what’s going on here.

    2) Not sure I understand what you’re saying here..?? We did implement capture with our Express Checkout integration, which is one of the benefits of our plugin over the Standard PayPal included with WC.

    Thread Starter steppade

    (@steppade)

    1) So you’re saying if you run an order for $100 and then try to capture $70 against that order it’s actually capturing the full $100 instead?

    I haven’t any field to set the new amount. I have reduced the order with the standard wc method. But capturing the amount it capture the old amount(es. $100 not 70)

    Here the photo: http://ginex.indivia.net/images/wrong_capture.png

    I am on sandbox.

    2) Yes you implemented capture on Express Checkout and i have the bug here.

    The problem that i have with EC, but maybe i am noob on paypal, is that on y e-commerce i can delivery only some place and on EC the user can change the destination. The second thing is that i must manage date & time slot for delivery because i work with food, then i need to calculate shipping cost by destination.

    So on my test i have EC button on my checkout page, here the user chose and set things, then he arrives on Paypal, where he can change destination, then he come back on another(new.. may be made by your plugin) “checkout” place, where he can change delivery method and where he can complete the operation.

    It’s a bit long, it’s not express. I have asked if you can implement capture on standard paypal too to solve my problem(i have ssl) where i have read that capture is possible too.

    In standard wc paypal, i can set ‘authorization’ method but i haven’t a box where i can capture o void.

    Sorry for my english.

    Thanks.

    • This reply was modified 5 years, 6 months ago by steppade.
    Thread Starter steppade

    (@steppade)

    1) I can confirm this problem when i change the amount for discount or partial refund.

    Here an accurate step by stem screenshot story (picture 00 to 08 with comment) for discount method:

    http://ginex.indivia.net/images/discount_and_capture/

    and for refund method (some step skipped) :

    http://ginex.indivia.net/images/refund_and_capture/

    2) Paypal doesn’t let change the shipping address to the user. It say only.. if you want change go to the site http://www.domain.com. It’s a my mistake because i read “modify” link without click on it to see what was. This is good.

    So i have only one problem left on the checkout->review order page. Here the screenshot:

    http://ginex.indivia.net/images/checkout_review_order_page.png

    How you can see.. here there is another time the possibility to chose the shipping delivery method but it can’t happen because the user have chosed everything on the real checkout page with a complex method described on this 2 screenshot:

    http://ginex.indivia.net/images/checkout_with_EC_button_init.png
    http://ginex.indivia.net/images/checkout_with_EC_button_filling_procedure.png

    Let me know if you need something to understand what’s happen here.

    Thanks.

    Plugin Contributor angelleye

    (@angelleye)

    The additional review page is required in most cases because generally when using Express Checkout the user would not be using the full WooCommerce checkout page. That’s where the Express Part comes in. They just click to checkout, they’re sent directly to PayPal where they choose their address, and they’re returned to a review page on the site where they can choose shipping based on the address selected at PayPal. They do not have to fill out any forms, though.

    In your case, it sounds like you’re requiring the WC checkout page because of the custom procedure you have going on. This is what eliminates the “express” factor more than our review page. Since you are doing that, though, you should be able to enable the “Skip Final Review” option in our Express Checkout settings page. This way the final review will not be displayed, and instead of the order would simply be finalized using the currently available details in the WooCommerce cart object.

    Please give that a try and let me know if that gives you what you’re after.

    Thanks!

    Thread Starter steppade

    (@steppade)

    This sound good! But i can’t check-it, it’s disabled.

    On setting i read:

    (The WooCommerce guest checkout option is disabled. Therefore, the review page is required for login / account creation, and this option will be overridden.) (Payments tokens are enabled, which require the review page, and that will override this option.)

    1) The WooCommerce guest checkout option is disabled.

    Yes, guest can’t buy

    2) Therefore, the review page is required for login / account creation, and this option will be overridden.

    They can’t proceed on payment from any page, in particular on checkout page if they are not already logged-in. They have a box here to login and continue with checkout.

    3) Payments tokens are enabled, which require the review page, and that will override this option

    It’s enabled by default. I can disable it but it’s the same.

    Anyway i can leave review page because with few css operation i can fix this that page.

    But i can’t use the plugin without the capture bug fix.

    Thanks to you.

    Thread Starter steppade

    (@steppade)

    About the the bug (point n.1), as you can see on this function, i have added some var_dump and an exit to understand what’s happen on DoCapture on EC:

    pfw_do_capture($order, $transaction_id = null, $capture_total = null) {
            $this->add_ec_angelleye_paypal_php_library();
            $this->ec_add_log('DoCapture API call');
            
            $AMT = $this->get_amount_by_transaction_id($transaction_id);
            var_dump($order);
            var_dump($capture_total);
            exit('AMT: '.$AMT);
            $DataArray = array(
                'AUTHORIZATIONID' => $transaction_id,
                'AMT' => $AMT,
                'CURRENCYCODE' => $order->get_order_currency(),
                'COMPLETETYPE' => 'NotComplete',
            );
            ...
    

    With the procedure already described with the images for the discount, on $capture_total variable i have the new real amount.

    But this arg is never used.. instead you get the old amount from AMT on postmeta table.

    I’m note sure about your code, there is to much code to understand. But i can say that searching for update_meta_post with AMT key there is only an occurrence on DoVoid. So AMT will be ever the old total amount not the new once.

    Maybe here you need to use $capture_total and implement some check to see if the new amount is permitted whit this authorization before send do_capture. I see that you implemented a lot of utility that maybe already did it.

    Now i will check if this work for partial refund too.

    UPDATE1:
    For partial refund doesn’t work. I’m try to understand how it work on wc.

    UPDATE2:
    With $order->get_total_refunded() you can know if there are refunds and what’s the amount.

    Then:

    $capture_total – $order->get_total_refunded() give the the amount to capture.

    I hope that all this info can help you to help me 🙂

    Thanks,
    g.

    • This reply was modified 5 years, 6 months ago by steppade.
    • This reply was modified 5 years, 6 months ago by steppade. Reason: update with refund2
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘DoAuthorize -> DoCapture’ is closed to new replies.