[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Apply drupal formatting to AntifraudQueueConsumer.php
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/398782 ) Change subject: Apply drupal formatting to AntifraudQueueConsumer.php .. Apply drupal formatting to AntifraudQueueConsumer.php Change-Id: I5279c87e5c80a4561753709e6e72a8ec0aea73a2 --- M sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php 1 file changed, 107 insertions(+), 100 deletions(-) Approvals: jenkins-bot: Verified Ejegg: Looks good to me, approved diff --git a/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php b/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php index 9613f27..a0aa736 100644 --- a/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php +++ b/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php @@ -6,112 +6,119 @@ class AntifraudQueueConsumer extends WmfQueueConsumer { - /** -* Validate and store messages from the payments-antifraud queue -* -* @param array $message -* @throws WmfException -*/ - function processMessage( $message ) { - $id = "{$message['gateway']}-{$message['order_id']}"; - watchdog( - 'fredge', - "Beginning processing of payments-antifraud message for $id: " . - json_encode( $message ), - array(), - WATCHDOG_INFO - ); + /** + * Validate and store messages from the payments-antifraud queue + * + * @param array $message + * + * @throws WmfException + */ + function processMessage($message) { +$id = "{$message['gateway']}-{$message['order_id']}"; +watchdog( + 'fredge', + "Beginning processing of payments-antifraud message for $id: " . + json_encode($message), + array(), + WATCHDOG_INFO +); - // handle the IP address conversion to binary so we can do database voodoo later. - if ( array_key_exists( 'user_ip', $message ) ) { - // check for IPv6 - if ( strpos( ':', $message['user_ip'] ) !== false ) { - /** -* despite a load of documentation to the contrary, the following line -* ***doesn't work at all***. -* Which is okay for now: We force IPv4 on payments. -* @TODO eventually: Actually handle IPv6 here. -*/ - // $message['user_ip'] = inet_pton($message['user_ip']); +// handle the IP address conversion to binary so we can do database voodoo later. +if (array_key_exists('user_ip', $message)) { + // check for IPv6 + if (strpos(':', $message['user_ip']) !== FALSE) { +/** + * despite a load of documentation to the contrary, the following line + * ***doesn't work at all***. + * Which is okay for now: We force IPv4 on payments. + * + * @TODO eventually: Actually handle IPv6 here. + */ +// $message['user_ip'] = inet_pton($message['user_ip']); - watchdog( - 'fredge', - 'Weird. Somehow an ipv6 address got through on payments. ' . - "Caught in antifraud consumer. $id", - array(), - WATCHDOG_WARNING - ); - $message['user_ip'] = 0; - } else { - $message['user_ip'] = ip2long( $message['user_ip'] ); - } - } +watchdog( + 'fredge', + 'Weird. Somehow an ipv6 address got through on payments. ' . + "Caught in antifraud consumer. $id", + array(), + WATCHDOG_WARNING +); +$message['user_ip'] = 0; + } + else { +$message['user_ip'] = ip2long($message['user_ip']); + } +} - $this->insertAntifraudData( $message, $id ); - } +$this->insertAntifraudData($message, $id); + } - /** -* take a message and insert or update rows in payments_fraud and payments_fraud_breakdown. -* If there is not yet an antifraud row for this ct_id and order_id, all fields -* in the table must be present in the message. -* @param array $msg the message that you want to upsert. -* @param string $logIdentifier Some small string for the log that will help id -* the message if something goes amiss and we have to log about it. -* @throws FredgeDataValidationException -*/ - protected funct
[MediaWiki-commits] [Gerrit] wikimedia...crm[master]: Apply drupal formatting to AntifraudQueueConsumer.php
Eileen has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/398782 ) Change subject: Apply drupal formatting to AntifraudQueueConsumer.php .. Apply drupal formatting to AntifraudQueueConsumer.php Change-Id: I5279c87e5c80a4561753709e6e72a8ec0aea73a2 --- M sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php 1 file changed, 107 insertions(+), 100 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/crm refs/changes/82/398782/1 diff --git a/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php b/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php index 9613f27..a0aa736 100644 --- a/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php +++ b/sites/all/modules/queue2civicrm/fredge/AntifraudQueueConsumer.php @@ -6,112 +6,119 @@ class AntifraudQueueConsumer extends WmfQueueConsumer { - /** -* Validate and store messages from the payments-antifraud queue -* -* @param array $message -* @throws WmfException -*/ - function processMessage( $message ) { - $id = "{$message['gateway']}-{$message['order_id']}"; - watchdog( - 'fredge', - "Beginning processing of payments-antifraud message for $id: " . - json_encode( $message ), - array(), - WATCHDOG_INFO - ); + /** + * Validate and store messages from the payments-antifraud queue + * + * @param array $message + * + * @throws WmfException + */ + function processMessage($message) { +$id = "{$message['gateway']}-{$message['order_id']}"; +watchdog( + 'fredge', + "Beginning processing of payments-antifraud message for $id: " . + json_encode($message), + array(), + WATCHDOG_INFO +); - // handle the IP address conversion to binary so we can do database voodoo later. - if ( array_key_exists( 'user_ip', $message ) ) { - // check for IPv6 - if ( strpos( ':', $message['user_ip'] ) !== false ) { - /** -* despite a load of documentation to the contrary, the following line -* ***doesn't work at all***. -* Which is okay for now: We force IPv4 on payments. -* @TODO eventually: Actually handle IPv6 here. -*/ - // $message['user_ip'] = inet_pton($message['user_ip']); +// handle the IP address conversion to binary so we can do database voodoo later. +if (array_key_exists('user_ip', $message)) { + // check for IPv6 + if (strpos(':', $message['user_ip']) !== FALSE) { +/** + * despite a load of documentation to the contrary, the following line + * ***doesn't work at all***. + * Which is okay for now: We force IPv4 on payments. + * + * @TODO eventually: Actually handle IPv6 here. + */ +// $message['user_ip'] = inet_pton($message['user_ip']); - watchdog( - 'fredge', - 'Weird. Somehow an ipv6 address got through on payments. ' . - "Caught in antifraud consumer. $id", - array(), - WATCHDOG_WARNING - ); - $message['user_ip'] = 0; - } else { - $message['user_ip'] = ip2long( $message['user_ip'] ); - } - } +watchdog( + 'fredge', + 'Weird. Somehow an ipv6 address got through on payments. ' . + "Caught in antifraud consumer. $id", + array(), + WATCHDOG_WARNING +); +$message['user_ip'] = 0; + } + else { +$message['user_ip'] = ip2long($message['user_ip']); + } +} - $this->insertAntifraudData( $message, $id ); - } +$this->insertAntifraudData($message, $id); + } - /** -* take a message and insert or update rows in payments_fraud and payments_fraud_breakdown. -* If there is not yet an antifraud row for this ct_id and order_id, all fields -* in the table must be present in the message. -* @param array $msg the message that you want to upsert. -* @param string $logIdentifier Some small string for the log that will help id -* the message if something goes amiss and we have to log about it. -* @throws FredgeDataValidationException -*/ - prot