@@ 863-870 (lines=8) @@ | ||
860 | update_post_meta( $order_id, '_stripe_charge_captured', $response->captured ? 'yes' : 'no' ); |
|
861 | ||
862 | // Store other data such as fees |
|
863 | if ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) { |
|
864 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
865 | // values are in the local currency of the Stripe account, not from WC. |
|
866 | $fee = ! empty( $response->balance_transaction->fee ) ? WC_Stripe::format_number( $response->balance_transaction, 'fee' ) : 0; |
|
867 | $net = ! empty( $response->balance_transaction->net ) ? WC_Stripe::format_number( $response->balance_transaction, 'net' ) : 0; |
|
868 | update_post_meta( $order_id, 'Stripe Fee', $fee ); |
|
869 | update_post_meta( $order_id, 'Net Revenue From Stripe', $net ); |
|
870 | } |
|
871 | ||
872 | if ( $response->captured ) { |
|
873 | $order->payment_complete( $response->id ); |
@@ 481-488 (lines=8) @@ | ||
478 | update_post_meta( $order_id, 'Stripe Payment ID', $result->id ); |
|
479 | update_post_meta( $order_id, '_transaction_id', $result->id ); |
|
480 | ||
481 | if ( isset( $result->balance_transaction ) && isset( $result->balance_transaction->fee ) ) { |
|
482 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
483 | // values are in the local currency of the Stripe account, not from WC. |
|
484 | $fee = ! empty( $result->balance_transaction->fee ) ? self::format_number( $result->balance_transaction, 'fee' ) : 0; |
|
485 | $net = ! empty( $result->balance_transaction->net ) ? self::format_number( $result->balance_transaction, 'net' ) : 0; |
|
486 | update_post_meta( $order_id, 'Stripe Fee', $fee ); |
|
487 | update_post_meta( $order_id, 'Net Revenue From Stripe', $net ); |
|
488 | } |
|
489 | } |
|
490 | } |
|
491 | } |