Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Adding PayPal fee as meta data, PFW-299 #1243

Merged
merged 1 commit into from Dec 8, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -2227,4 +2227,10 @@ public function angelleye_wc_braintree_docapture($order) {
}
}
}
public static function angelleye_add_paypal_payment_meta($order_id, $payment_meta) {
foreach ($payment_meta as $key => $value) {
update_post_meta($order_id, $key, wc_clean($value));
}
}
}
@@ -333,6 +333,8 @@ public function angelleye_do_express_checkout_payment() {
if ($this->gateway->payment_action != 'Sale') {
AngellEYE_Utility::angelleye_paypal_for_woocommerce_add_paypal_transaction($this->paypal_response, $order, $this->gateway->payment_action);
}
$payment_meta = array('Payment type' => !empty($this->paypal_response['PAYMENTINFO_0_PAYMENTTYPE']) ? $this->paypal_response['PAYMENTINFO_0_PAYMENTTYPE'] : '', 'PayPal Transaction Fee' => !empty($this->paypal_response['PAYMENTINFO_0_FEEAMT']) ? $this->paypal_response['PAYMENTINFO_0_FEEAMT'] : '');
AngellEYE_Utility::angelleye_add_paypal_payment_meta($order_id, $payment_meta);
if ($this->response_helper->ec_is_response_success($this->paypal_response)) {
do_action('ae_add_custom_order_note', $order, $card = null, $token = null, $this->paypal_response);
apply_filters('woocommerce_payment_successful_result', array('result' => 'success'), $order_id);
@@ -343,7 +343,7 @@ public function set_payment() {
public function getAuth() {
$this->mode = $this->testmode == true ? 'SANDBOX' : 'LIVE';
$auth = new ApiContext(new OAuthTokenCredential($this->rest_client_id, $this->rest_secret_id));
$auth->setConfig(array('mode' => $this->mode, 'http.headers.PayPal-Partner-Attribution-Id' => 'AngellEYE_SP_WooCommerce', 'log.LogEnabled' => $this->debug , 'log.LogLevel' => ($this->mode == 'DEBUG') ? 'DEBUG' : 'INFO', 'log.FileName' => wc_get_log_file_path('paypal_credit_card_rest')));
$auth->setConfig(array('mode' => $this->mode, 'http.headers.PayPal-Partner-Attribution-Id' => 'AngellEYE_SP_WooCommerce', 'log.LogEnabled' => $this->debug , 'log.LogLevel' => ($this->mode == 'SANDBOX') ? 'DEBUG' : 'INFO', 'log.FileName' => wc_get_log_file_path('paypal_credit_card_rest')));
return $auth;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.