@@ 227-234 (lines=8) @@ | ||
224 | // Store other data such as fees |
|
225 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_transaction_id', $result->id ) : $order->set_transaction_id( $result->id ); |
|
226 | ||
227 | if ( isset( $result->balance_transaction ) && isset( $result->balance_transaction->fee ) ) { |
|
228 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
229 | // values are in the local currency of the Stripe account, not from WC. |
|
230 | $fee = ! empty( $result->balance_transaction->fee ) ? WC_Stripe_Helper::format_balance_fee( $result->balance_transaction, 'fee' ) : 0; |
|
231 | $net = ! empty( $result->balance_transaction->net ) ? WC_Stripe_Helper::format_balance_fee( $result->balance_transaction, 'net' ) : 0; |
|
232 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, parent::META_NAME_FEE, $fee ) : $order->update_meta_data( parent::META_NAME_FEE, $fee ); |
|
233 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, parent::META_NAME_NET, $net ) : $order->update_meta_data( parent::META_NAME_NET, $net ); |
|
234 | } |
|
235 | ||
236 | if ( is_callable( array( $order, 'save' ) ) ) { |
|
237 | $order->save(); |
@@ 247-254 (lines=8) @@ | ||
244 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, '_stripe_charge_captured', $captured ) : $order->update_meta_data( '_stripe_charge_captured', $captured ); |
|
245 | ||
246 | // Store other data such as fees |
|
247 | if ( isset( $response->balance_transaction ) && isset( $response->balance_transaction->fee ) ) { |
|
248 | // Fees and Net needs to both come from Stripe to be accurate as the returned |
|
249 | // values are in the local currency of the Stripe account, not from WC. |
|
250 | $fee = ! empty( $response->balance_transaction->fee ) ? WC_Stripe_Helper::format_balance_fee( $response->balance_transaction, 'fee' ) : 0; |
|
251 | $net = ! empty( $response->balance_transaction->net ) ? WC_Stripe_Helper::format_balance_fee( $response->balance_transaction, 'net' ) : 0; |
|
252 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, self::META_NAME_FEE, $fee ) : $order->update_meta_data( self::META_NAME_FEE, $fee ); |
|
253 | WC_Stripe_Helper::is_pre_30() ? update_post_meta( $order_id, self::META_NAME_NET, $net ) : $order->update_meta_data( self::META_NAME_NET, $net ); |
|
254 | } |
|
255 | ||
256 | if ( 'yes' === $captured ) { |
|
257 | /** |