Handle pending IPN requests. Closes #3192
This commit is contained in:
parent
d528bef73a
commit
53e9dd6368
|
@ -620,6 +620,7 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
// We are here so lets check status and do actions
|
||||
switch ( $posted['payment_status'] ) {
|
||||
case 'completed' :
|
||||
case 'pending' :
|
||||
|
||||
// Check order not already completed
|
||||
if ( $order->status == 'completed' ) {
|
||||
|
@ -671,11 +672,14 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway {
|
|||
if ( ! empty( $posted['payment_type'] ) )
|
||||
update_post_meta( $order->id, 'Payment type', $posted['payment_type'] );
|
||||
|
||||
// Payment completed
|
||||
$order->add_order_note( __( 'IPN payment completed', 'woocommerce' ) );
|
||||
$order->payment_complete();
|
||||
if ( $posted['payment_status'] == 'completed' ) {
|
||||
$order->add_order_note( __( 'IPN payment completed', 'woocommerce' ) );
|
||||
$order->payment_complete();
|
||||
} else {
|
||||
$order->update_status( 'on-hold', sprintf( __( 'Payment pending: %s', 'woocommerce' ), $posted['pending_reason'] ) );
|
||||
}
|
||||
|
||||
if ( 'yes' == $this->debug )
|
||||
if ( 'yes' == $this->debug )
|
||||
$this->log->add( 'paypal', 'Payment complete.' );
|
||||
|
||||
break;
|
||||
|
|
|
@ -176,6 +176,8 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
|
|||
* Tweak - New System Status report layout, now plugin list is better visually and very better to read
|
||||
* Tweak - content-widget-product.php template for product lists inside core widgets
|
||||
* Tweak - Shipping is now renamed to Shipping and Handling on checkout
|
||||
* Tweak - Select all/none for countries in admin
|
||||
* Tweak - Handle pending status for paypal
|
||||
* Fix - Changed MyException to Exception in Checkout class as MyException class does not exist in WooCommerce
|
||||
* Fix - Default cart widget styling on non-wc pages.
|
||||
* Fix - Rounding for mijireh tax ex. price.
|
||||
|
|
Loading…
Reference in New Issue