Add transaction fee meta to pui order

This commit is contained in:
dinamiko 2022-10-10 12:06:20 +02:00
parent 783377cddd
commit beebb862da

View file

@ -246,6 +246,10 @@ class PayUponInvoice {
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() );
}
}
} catch ( RuntimeException $exception ) {
$this->logger->error( $exception->getMessage() );