DragonByte Tech
Well-known member
- Affected version
- 2.0.5
I've been receiving the "Invalid cost amount" error message for some select payment receipts with a taxation rate set.
I modified the relevant line of PayPal.php to read
This is the message that gets logged:
This is the IPN returned:
The
I am running PHP 7.2.
I modified the relevant line of PayPal.php to read
$state->logMessage = 'Invalid cost amount: ' . (round(floatval($state->costAmount), 2) - round(floatval($state->taxAmount), 2)) . ' is not equal to ' . round(floatval($cost), 2) . ' or "' . strval($state->costCurrency) . '" is not equal to "' . $currency . '"';
This is the message that gets logged:
Error: Invalid cost amount: 44.95 is not equal to 44.95 or "USD" is not equal to "USD"
This is the IPN returned:
Code:
array(35) {
["mc_gross"] => string(5) "53.94"
["protection_eligibility"] => string(10) "Ineligible"
["payer_id"] => string(13) "<>"
["tax"] => string(4) "8.99"
["payment_date"] => string(25) "06:56:00 May 01, 2018 PDT"
["payment_status"] => string(9) "Completed"
["charset"] => string(12) "windows-1252"
["first_name"] => string(4) "<>"
["mc_fee"] => string(4) "1.86"
["notify_version"] => string(3) "3.9"
["custom"] => string(32) "<>"
["payer_status"] => string(8) "verified"
["business"] => string(28) "<>"
["quantity"] => string(1) "1"
["verify_sign"] => string(56) "<>"
["payer_email"] => string(21) "<>"
["txn_id"] => string(17) "<>"
["payment_type"] => string(7) "instant"
["payer_business_name"] => string(10) "<>"
["last_name"] => string(5) "<>"
["receiver_email"] => string(28) "<>"
["payment_fee"] => string(4) "1.86"
["shipping_discount"] => string(4) "0.00"
["receiver_id"] => string(13) "<>"
["insurance_amount"] => string(4) "0.00"
["txn_type"] => string(10) "web_accept"
["item_name"] => string(31) "<>"
["discount"] => string(4) "0.00"
["mc_currency"] => string(3) "USD"
["item_number"] => string(0) ""
["residence_country"] => string(2) "GB"
["shipping_method"] => string(7) "Default"
["transaction_subject"] => string(0) ""
["payment_gross"] => string(5) "53.94"
["ipn_track_id"] => string(13) "<>"
}
The
cost_amount
column in the xf_purchase_request
table contains 44.95
.I am running PHP 7.2.