Jonathan Posted July 7, 2015 Report Posted July 7, 2015 Payments via PayPal even when using the "pay" link directly connected to a specific invoice get added as account credit then applied to the oldest open invoice by the cron. Verified the invoice ID is passed both directions in the API calls. To recreate:Have multiple open invoices. Click "pay" by the newest (as client) and pay via PayPal. The correct invoice info is passed/displayed to PayPal, but the payment will end up as an account credit until the cron runs and applies it. Here's a input/output set from API logs where it didn't apply to the invoice it clearly stated. Output: /callback/gw/1/paypal_payments_standard/?client_id=<123> a:33:{s:8:"mc_gross";s:4:"1.74";s:22:"protection_eligibility";s:10:"Ineligible";s:8:"payer_id";s:13:"KH2WQPLXXVD46";s:3:"tax";s:4:"0.00";s:12:"payment_date";s:25:"12:41:29 Jul 07, 2015 PDT";s:14:"payment_status";s:9:"Completed";s:7:"charset";s:12:"windows-1252";s:10:"first_name";s:6:"<name>";s:6:"mc_fee";s:4:"0.35";s:14:"notify_version";s:3:"3.8";s:6:"custom";s:13:"509422=1.7419";s:12:"payer_status";s:10:"unverified";s:8:"business";s:20:"<redacted>";s:8:"quantity";s:1:"1";s:11:"verify_sign";s:56:"AKhVogKbB40Wjc1IzHO0x4rgsUxoAwZ3YRlNGzQVLxBeMi6Syg9Ntz9D";s:11:"payer_email";s:19:"<redacted>";s:6:"txn_id";s:17:"7RP550164A104845G";s:12:"payment_type";s:7:"instant";s:19:"payer_business_name";s:8:"<redacted>";s:9:"last_name";s:6:"<redacted>";s:14:"receiver_email";s:20:"<ppemail>";s:11:"payment_fee";s:4:"0.35";s:11:"receiver_id";s:13:"4L5A77C6WEY6J";s:8:"txn_type";s:10:"web_accept";s:9:"item_name";s:15:"Invoice #469610";s:11:"mc_currency";s:3:"USD";s:11:"item_number";s:0:"";s:17:"residence_country";s:2:"US";s:15:"handling_amount";s:4:"0.00";s:19:"transaction_subject";s:13:"509422=1.7419";s:13:"payment_gross";s:4:"1.74";s:8:"shipping";s:4:"0.00";s:12:"ipn_track_id";s:13:"7ea093ab47dbf";} Input: https://www.paypal.com/cgi-bin/webscr a:34:{s:3:"cmd";s:16:"_notify-validate";s:8:"mc_gross";s:4:"1.74";s:22:"protection_eligibility";s:10:"Ineligible";s:8:"payer_id";s:13:"KH2WQPLXXVD46";s:3:"tax";s:4:"0.00";s:12:"payment_date";s:25:"12:41:29 Jul 07, 2015 PDT";s:14:"payment_status";s:9:"Completed";s:7:"charset";s:12:"windows-1252";s:10:"first_name";s:6:"<redacted>";s:6:"mc_fee";s:4:"0.35";s:14:"notify_version";s:3:"3.8";s:6:"custom";s:13:"509422=1.7419";s:12:"payer_status";s:10:"unverified";s:8:"business";s:20:"<redacted>";s:8:"quantity";s:1:"1";s:11:"verify_sign";s:56:"AKhVogKbB40Wjc1IzHO0x4rgsUxoAwZ3YRlNGzQVLxBeMi6Syg9Ntz9D";s:11:"payer_email";s:19:"<redacted>";s:6:"txn_id";s:17:"7RP550164A104845G";s:12:"payment_type";s:7:"instant";s:19:"payer_business_name";s:8:"<redacted>";s:9:"last_name";s:6:"<redacted>";s:14:"receiver_email";s:20:"<redacted>";s:11:"payment_fee";s:4:"0.35";s:11:"receiver_id";s:13:"4L5A77C6WEY6J";s:8:"txn_type";s:10:"web_accept";s:9:"item_name";s:15:"Invoice #469610";s:11:"mc_currency";s:3:"USD";s:11:"item_number";s:0:"";s:17:"residence_country";s:2:"US";s:15:"handling_amount";s:4:"0.00";s:19:"transaction_subject";s:13:"509422=1.7419";s:13:"payment_gross";s:4:"1.74";s:8:"shipping";s:4:"0.00";s:12:"ipn_track_id";s:13:"7ea093ab47dbf";} In this case, the payment ended up getting applied to invoice 467083 and not 469610 like it should've been. EDIT: "509422" DOES correspond to the correct invoice that should have been paid, but not the one that was actually paid since the cron did it.
Tyson Posted July 7, 2015 Report Posted July 7, 2015 This sounds like an issue brought up in another thread which may be an problem with non-merchant gateways in general.
Tyson Posted July 7, 2015 Report Posted July 7, 2015 The issue here is that the PayPal gateway is telling Blesta to apply "1.7419" to an invoice when only "1.74" has been paid. This would normally occur for invoices being paid in an amount with greater precision than the currency, for example, if the invoice is calculated from prorated values. If the invoice total were "1.74", then it would be marked paid after payment. A fix will be added apart of CORE-1728 for v3.5.1. activa and Michael 2
Recommended Posts