@@ 476-483 (lines=8) @@ | ||
473 | // Store other data such as fees |
|
474 | update_post_meta( $order_id, 'Stripe Payment ID', $result->id ); |
|
475 | ||
476 | if ( isset( $result->balance_transaction ) && isset( $result->balance_transaction->fee ) ) { |
|
477 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
478 | // values are in the local currency of the Stripe account, not from WC. |
|
479 | $fee = ! empty( $result->balance_transaction->fee ) ? self::format_number( $result->balance_transaction, 'fee' ) : 0; |
|
480 | $net = ! empty( $result->balance_transaction->net ) ? self::format_number( $result->balance_transaction, 'net' ) : 0; |
|
481 | update_post_meta( $order_id, 'Stripe Fee', $fee ); |
|
482 | update_post_meta( $order_id, 'Net Revenue From Stripe', $net ); |
|
483 | } |
|
484 | } |
|
485 | } |
|
486 | } |
@@ 825-832 (lines=8) @@ | ||
822 | update_post_meta( $order_id, '_stripe_charge_captured', $response->captured ? 'yes' : 'no' ); |
|
823 | ||
824 | // Store other data such as fees |
|
825 | if ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) { |
|
826 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
827 | // values are in the local currency of the Stripe account, not from WC. |
|
828 | $fee = ! empty( $response->balance_transaction->fee ) ? WC_Stripe::format_number( $response->balance_transaction, 'fee' ) : 0; |
|
829 | $net = ! empty( $response->balance_transaction->net ) ? WC_Stripe::format_number( $response->balance_transaction, 'net' ) : 0; |
|
830 | update_post_meta( $order_id, 'Stripe Fee', $fee ); |
|
831 | update_post_meta( $order_id, 'Net Revenue From Stripe', $net ); |
|
832 | } |
|
833 | ||
834 | if ( $response->captured ) { |
|
835 | $order->payment_complete( $response->id ); |