Katie Horn has submitted this change and it was merged.

Change subject: Add another freaky Alipay audit exception
......................................................................


Add another freaky Alipay audit exception

Some Alipay orders are coming in with method and product IDs
indicating bank transfer, but method 'PP'.

Change-Id: I1eda5d745a2b49feb8c6bcca889d535fa6948c98
---
M sites/all/modules/globalcollect_audit/globalcollect_audit.module
1 file changed, 12 insertions(+), 3 deletions(-)

Approvals:
  Katie Horn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/sites/all/modules/globalcollect_audit/globalcollect_audit.module 
b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
index fc0d547..b61f756 100644
--- a/sites/all/modules/globalcollect_audit/globalcollect_audit.module
+++ b/sites/all/modules/globalcollect_audit/globalcollect_audit.module
@@ -1940,11 +1940,20 @@
 
 function gca_wr1_key_grinder( $record, $keys, $name, $error_on_mismatch = 
false ){
        $ret = null;
+       // Sometime GC indicates Alipay as Ewallet / Alipay, and sometimes as
+       // bank transfer/bank transfer, but with Payment-method 'PP'.  Yecch.
+       $is_alipay = (
+                       $record['WbC Payment method ID'] === '8'
+                       && $record['WbC Payment product ID'] === '861'
+               ) || (
+                       $record['WbC Payment method ID'] === '7'
+                       && $record['WbC Payment product ID'] === '11'
+                       && $record['Payment-method'] === 'PP'
+               );
+
        //Alipay charges in CNY and pays out in EUR
        //short-circuit both currency and amount for them
-       if ( $record['WbC Payment method ID'] === '8'
-               && $record['WbC Payment product ID'] === '861'
-               && in_array( $name, array( 'currency', 'amount' ) ) ){
+       if ( $is_alipay && in_array( $name, array( 'currency', 'amount' ) ) ){
 
                if ( $name === 'currency' ) {
                        $ret = $record['Invoice-currency-deliv'];

-- 
To view, visit https://gerrit.wikimedia.org/r/186391
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1eda5d745a2b49feb8c6bcca889d535fa6948c98
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/crm
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Katie Horn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to