log paypal standard transaction fees closes #8091
This commit is contained in:
parent
5662e3a1bd
commit
7c074c75e2
|
@ -181,6 +181,12 @@ class WC_Gateway_Paypal_IPN_Handler extends WC_Gateway_Paypal_Response {
|
|||
|
||||
if ( 'completed' === $posted['payment_status'] ) {
|
||||
$this->payment_complete( $order, ( ! empty( $posted['txn_id'] ) ? wc_clean( $posted['txn_id'] ) : '' ), __( 'IPN payment completed', 'woocommerce' ) );
|
||||
|
||||
if ( isset( $posted['mc_fee'] ) ) {
|
||||
// log paypal transaction fee
|
||||
update_post_meta( $order->id, '_paypal_standard_txn_fee', $posted['mc_fee'] );
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->payment_on_hold( $order, sprintf( __( 'Payment pending: %s', 'woocommerce' ), $posted['pending_reason'] ) );
|
||||
}
|
||||
|
|
|
@ -75,6 +75,11 @@ class WC_Gateway_Paypal_PDT_Handler extends WC_Gateway_Paypal_Response {
|
|||
$this->payment_on_hold( $order, sprintf( __( 'Validation error: PayPal amounts do not match (amt %s).', 'woocommerce' ), $amount ) );
|
||||
} else {
|
||||
$this->payment_complete( $order, $transaction, __( 'PDT payment completed', 'woocommerce' ) );
|
||||
|
||||
if ( isset( $_REQUEST['mc_fee'] ) ) {
|
||||
// log paypal transaction fee
|
||||
update_post_meta( $order->id, '_paypal_standard_txn_fee', $_REQUEST['mc_fee'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue