Find the following code block in /includes/modules/payment/paypalwpp.php, starting at line 503 for the zc157 version:
Code:
// store the PayPal order meta data -- used for later matching and back-end processing activities
$paypal_order = array('order_id' => $insert_id,
'txn_type' => $this->transactiontype,
'module_name' => $this->code,
'module_mode' => MODULE_PAYMENT_PAYPALWPP_MODULE_MODE,
'reason_code' => $this->reasoncode,
'payment_type' => $this->payment_type,
'payment_status' => $this->payment_status,
'pending_reason' => $this->pendingreason,
'invoice' => urldecode($_SESSION['paypal_ec_token'] . (isset($this->responsedata['PPREF']) ? $this->responsedata['PPREF'] : '')),
'first_name' => $_SESSION['paypal_ec_payer_info']['payer_firstname'],
'last_name' => $_SESSION['paypal_ec_payer_info']['payer_lastname'],
'payer_business_name' => $_SESSION['paypal_ec_payer_info']['payer_business'],
'address_name' => $_SESSION['paypal_ec_payer_info']['ship_name'],
'address_street' => $_SESSION['paypal_ec_payer_info']['ship_street_1'],
'address_city' => $_SESSION['paypal_ec_payer_info']['ship_city'],
'address_state' => $_SESSION['paypal_ec_payer_info']['ship_state'],
'address_zip' => $_SESSION['paypal_ec_payer_info']['ship_postal_code'],
'address_country' => $_SESSION['paypal_ec_payer_info']['ship_country_name'],
'address_status' => $_SESSION['paypal_ec_payer_info']['ship_address_status'],
'payer_email' => $_SESSION['paypal_ec_payer_info']['payer_email'],
'payer_id' => $_SESSION['paypal_ec_payer_id'],
'payer_status' => $_SESSION['paypal_ec_payer_info']['payer_status'],
'payment_date' => trim(preg_replace('/[^0-9-:]/', ' ', $this->payment_time)),
'business' => '',
'receiver_email' => (substr(MODULE_PAYMENT_PAYPALWPP_MODULE_MODE,0,7) == 'Payflow' ? MODULE_PAYMENT_PAYPALWPP_PFVENDOR : str_replace('_api1', '', MODULE_PAYMENT_PAYPALWPP_APIUSERNAME)),
'receiver_id' => '',
'txn_id' => $this->transaction_id,
'parent_txn_id' => '',
'num_cart_items' => (float)$this->numitems,
'mc_gross' => (float)$this->amt,
'mc_fee' => (float)urldecode($this->feeamt),
'mc_currency' => $this->responsedata['PAYMENTINFO_0_CURRENCYCODE'],
'settle_amount' => (float)(isset($this->responsedata['PAYMENTINFO_0_SETTLEAMT'])) ? $this->urldecode($this->responsedata['PAYMENTINFO_0_SETTLEAMT']) : $this->amt,
'settle_currency' => $this->responsedata['PAYMENTINFO_0_CURRENCYCODE'],
'exchange_rate' => (isset($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) && urldecode($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) > 0) ? urldecode($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) : 1.0,
'notify_version' => '0',
'verify_sign' =>'',
'date_added' => 'now()',
'memo' => (sizeof($this->fmfErrors) > 0 ? 'FMF Details ' . print_r($this->fmfErrors, TRUE) : '{Record generated by payment module}'),
);
zen_db_perform(TABLE_PAYPAL, $paypal_order);
$this->notify('NOTIFY_PAYPALWPP_AFTER_PROCESS_FINISHED', $paypal_order);
and make the highlighted change (you'll need to scroll to the right):
Code:
// store the PayPal order meta data -- used for later matching and back-end processing activities
$paypal_order = array('order_id' => $insert_id,
'txn_type' => $this->transactiontype,
'module_name' => $this->code,
'module_mode' => MODULE_PAYMENT_PAYPALWPP_MODULE_MODE,
'reason_code' => $this->reasoncode,
'payment_type' => $this->payment_type,
'payment_status' => $this->payment_status,
'pending_reason' => $this->pendingreason,
'invoice' => urldecode($_SESSION['paypal_ec_token'] . (isset($this->responsedata['PPREF']) ? $this->responsedata['PPREF'] : '')),
'first_name' => $_SESSION['paypal_ec_payer_info']['payer_firstname'],
'last_name' => $_SESSION['paypal_ec_payer_info']['payer_lastname'],
'payer_business_name' => $_SESSION['paypal_ec_payer_info']['payer_business'],
'address_name' => $_SESSION['paypal_ec_payer_info']['ship_name'],
'address_street' => $_SESSION['paypal_ec_payer_info']['ship_street_1'],
'address_city' => $_SESSION['paypal_ec_payer_info']['ship_city'],
'address_state' => $_SESSION['paypal_ec_payer_info']['ship_state'],
'address_zip' => $_SESSION['paypal_ec_payer_info']['ship_postal_code'],
'address_country' => $_SESSION['paypal_ec_payer_info']['ship_country_name'],
'address_status' => $_SESSION['paypal_ec_payer_info']['ship_address_status'],
'payer_email' => $_SESSION['paypal_ec_payer_info']['payer_email'],
'payer_id' => $_SESSION['paypal_ec_payer_id'],
'payer_status' => $_SESSION['paypal_ec_payer_info']['payer_status'],
'payment_date' => trim(preg_replace('/[^0-9-:]/', ' ', $this->payment_time)),
'business' => '',
'receiver_email' => (substr(MODULE_PAYMENT_PAYPALWPP_MODULE_MODE,0,7) == 'Payflow' ? MODULE_PAYMENT_PAYPALWPP_PFVENDOR : str_replace('_api1', '', MODULE_PAYMENT_PAYPALWPP_APIUSERNAME)),
'receiver_id' => '',
'txn_id' => $this->transaction_id,
'parent_txn_id' => '',
'num_cart_items' => (float)$this->numitems,
'mc_gross' => (float)$this->amt,
'mc_fee' => (float)urldecode($this->feeamt),
'mc_currency' => $this->responsedata['PAYMENTINFO_0_CURRENCYCODE'],
'settle_amount' => (float)(isset($this->responsedata['PAYMENTINFO_0_SETTLEAMT'])) ? $this->urldecode($this->responsedata['PAYMENTINFO_0_SETTLEAMT']) : (float)$this->amt,
'settle_currency' => $this->responsedata['PAYMENTINFO_0_CURRENCYCODE'],
'exchange_rate' => (isset($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) && urldecode($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) > 0) ? urldecode($this->responsedata['PAYMENTINFO_0_EXCHANGERATE']) : 1.0,
'notify_version' => '0',
'verify_sign' =>'',
'date_added' => 'now()',
'memo' => (sizeof($this->fmfErrors) > 0 ? 'FMF Details ' . print_r($this->fmfErrors, TRUE) : '{Record generated by payment module}'),
);
zen_db_perform(TABLE_PAYPAL, $paypal_order);
$this->notify('NOTIFY_PAYPALWPP_AFTER_PROCESS_FINISHED', $paypal_order);
Apparently, the PAYMENTINFO_0_SETTLEAMT element wasn't returned by PayPal, so the $this->amt value (which has the currency-code appended) is being used. That's causing the issue, since the settle_amt field in the database is defined as a decimal value.
Bookmarks