WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » [Resolved] How can i get my IPN works in woocommerce payment

[Resolved] How can i get my IPN works in woocommerce payment

Viewing 15 replies - 16 through 30 (of 55 total)
  • same here.. my IPN not working either.
    did u tried IPN set to
    “http://yoursite.com/?paypalListener=paypal_standard_IPN” ?

    Yeah you could try $order->payment_complete() . i’ll try that too.. thanks for the headups

    Hey Nadun, IT WORKS!!!!

    I just place this $order->payment_complete() at the end of my insert script. ( not sure should i remove my script and just put that in )

    Hey queenielow,

    I haven’t tried “http://yoursite.com/?paypalListener=paypal_standard_IPN” will try tonight.

    wow! Good that it worked!! If your custom code only change the order status $order->payment_complete() should do that and reducing the stock. Make sure your stock levels are not reducing twice.

    There is a “update_status()” method also if you only wanna do that.
    http://wcdocs.woothemes.com/apidocs/source-class-WC_Order.html#1066

    Hope it works for me too!

    Hey Nadun,

    U dont need anything.. just $order->payment_complete() will do all the calculation , i think.. but try it at ur side to see if it works on minus stock.

    Thanks for the update_status().. i need it to go directly to complete.

    Cheers

    I’m having trouble with this too. I am still using a sandbox for testing PayPal, and the IPN is working without errors. Still my orders do not reduce stock, and they say “pending” even though the money is transferred to my test account.

    I’m redirecting users to order-received/ as well. Where can I put your code in the template to make this work for me?

    Edit

    I just added the code to the top of the page and it worked! Thanks SO MUCH for posting this.

    <?php
    /**
     * Order details
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     1.6.4
     */
    
    global $woocommerce;
    
    $order = new WC_Order( $order_id );
    
    $order->payment_complete()
    
    ?>

    glad that help. No worries 🙂

    Please help me my orders are being completed via paypal but i am not receiving any notification of the orders. also the customer is not being emailed an invoice.

    I am not sure what pages you are adding these codes to. Can someone please tell me what page you are editing to get this to work?

    I have added

    http://www.mysite.com/?paypalListener=paypal_standard_IPN

    to paypal and paypal has verified that the notifications are going thru sucessfuly.

    I don’t have a need to reduce stock as i have only digital goods. I just want to be notified when someone makes a purchase. Currently i get an email if someone checks out with a coupon but NOT when they check out with paypal

    Please help me

    @weddingalbumcafe

    The best way to fix this is:

    1. Create a folder called Woocommerce under your theme folder. (ex. twentyten/woocommerce)

    2. Go to the woocommerce plugin folder and copy the contents of woocommerce/templates into the new folder (ex. twentyten/woocommerce)

    3. Open up the Order Details file in your editor. (ex /twentyten/woocommerce/order/order-details.php)

    4. Add the code at the top, right before the ?>

    $order->payment_complete()

    5. Save it and upload it back to the theme folder. (ex. /twentyten/woocommerce/order/order-details.php)

    Copying the files to your theme folder will prevent these changes from being overwritten if you ever upgrade Woocommerce.

    I believe this will fix the emails and the stock as well.

    Hopefully that helps.

    thanks so much angelo, that did not work for me.

    do you know the name of the file that processes orders completed by coupon code? Maybe i could see if there are any differences in the two files that determines why one sends nofiications and the other does not

    You should make sure you have auto redirect set up in PayPal to redirect them to the order-received page.

    Also, setup a developer account with PayPal so you can run tests (if you haven’t done so yet)

    it is set up to take them to the thank you page is that not correct?

    if so, make the code change to the thank you template.

    I have amended my thankyou template can you please verify if this correct for me. I still can’t get this to work.

    this is file /templates/checkout/thankyou.php

    <?php
    /**
     * Thankyou page
     *
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     1.6.4
     */
    
    global $woocommerce;
    
    $order->payment_complete()
    ?>
    
    <?php if ($order) : ?>
    
    	<?php if (in_array($order->status, array('failed'))) : ?>
    
    		<p><?php _e('Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', 'woocommerce'); ?></p>
    
    		<p><?php
    			if (is_user_logged_in()) :
    				_e('Please attempt your purchase again or go to your account page.', 'woocommerce');
    			else :
    				_e('Please attempt your purchase again.', 'woocommerce');
    			endif;
    		?></p>
    
    		<p>
    			<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e('Pay', 'woocommerce') ?></a>
    			<?php if (is_user_logged_in()) : ?>
    			<a href="<?php echo esc_url( get_permalink(woocommerce_get_page_id('myaccount')) ); ?>" class="button pay"><?php _e('My Account', 'woocommerce'); ?></a>
    			<?php endif; ?>
    		</p>
    
    	<?php else : ?>
    
    		<p><?php _e('Thank you. Your order has been received.', 'woocommerce'); ?></p>
    
    		<ul class="order_details">
    			<li class="order">
    				<?php _e('Order:', 'woocommerce'); ?>
    				<strong><?php echo $order->get_order_number(); ?></strong>
    			</li>
    			<li class="date">
    				<?php _e('Date:', 'woocommerce'); ?>
    				<strong><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></strong>
    			</li>
    			<li class="total">
    				<?php _e('Total:', 'woocommerce'); ?>
    				<strong><?php echo $order->get_formatted_order_total(); ?></strong>
    			</li>
    			<?php if ($order->payment_method_title) : ?>
    			<li class="method">
    				<?php _e('Payment method:', 'woocommerce'); ?>
    				<strong><?php
    					echo $order->payment_method_title;
    				?></strong>
    			</li>
    			<?php endif; ?>
    		</ul>
    		<div class="clear"></div>
    
    	<?php endif; ?>
    
    	<?php do_action( 'woocommerce_thankyou_' . $order->payment_method, $order->id ); ?>
    	<?php do_action( 'woocommerce_thankyou', $order->id ); ?>
    
    <?php else : ?>
    
    	<p><?php _e('Thank you. Your order has been received.', 'woocommerce'); ?></p>
    
    <?php endif; ?>
    queenielow

    @queenielow

    HI there,

    You should put this $order->payment_complete(); after <?php else : ?>

    so it will be like this
    <?php else : ?>
    <?php $order->payment_complete(); ?>

    haleeben

    @haleeben

    Thank you queenielow and Nadun

    Emails notifications are now working for me, hope the guys at Woo read this thread.

Viewing 15 replies - 16 through 30 (of 55 total)
  • The topic ‘[Resolved] How can i get my IPN works in woocommerce payment’ is closed to new replies.
Skip to toolbar