Merge pull request #609 from woocommerce/PCP-608-add-the-paypal-fee-to-the-custom-fields

Add "PayPal Transaction Key" into order custom fields.
This commit is contained in:
Emili Castells 2022-05-17 10:45:42 +02:00 committed by GitHub
commit 63c8cb8851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,6 +81,10 @@ class WCGatewayModule implements ModuleInterface {
if ( $breakdown ) {
$wc_order->update_meta_data( PayPalGateway::FEES_META_KEY, $breakdown->to_array() );
$wc_order->save_meta_data();
$paypal_fee = $breakdown->paypal_fee();
if ( $paypal_fee ) {
update_post_meta( $wc_order->get_id(), 'PayPal Transaction Key', $paypal_fee->value() );
}
}
},
10,