Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/226920

Change subject: Check error['context'] to place error messages
......................................................................

Check error['context'] to place error messages

We got hacks on hacks on hacks.
Not fixing this in a more comprehensive way right now, cos I've got
my hopes up for shoving a ton of stuff into SmashPig
TODO: can we get rid of getTransactionErrors now?

Bug: T106053
Change-Id: Ic6a72d9e80e07d2b3e4e6997b4ab9cd3f2766cbe
---
M gateway_common/GatewayPage.php
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface 
refs/changes/20/226920/1

diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php
index 75f5758..63c0811 100644
--- a/gateway_common/GatewayPage.php
+++ b/gateway_common/GatewayPage.php
@@ -472,10 +472,12 @@
                } elseif ( $errors = $result->getErrors() ) {
                        // FIXME: Creepy.  Currently, the form inspects adapter 
errors.  Use
                        // the stuff encapsulated in PaymentResult instead.
-                       foreach ( $this->adapter->getTransactionErrors() as 
$code => $message ) {
-
+                       foreach ( 
$this->adapter->getTransactionResponse()->getErrors() as $code => 
$transactionError ) {
+                               $message = $transactionError['message'];
                                $error = array();
-                               if ( strpos( $code, 'internal' ) === 0 ) {
+                               if ( !empty( $transactionError['context'] ) ) {
+                                       $error[$transactionError['context']] = 
$message;
+                               } else if ( strpos( $code, 'internal' ) === 0 ) 
{
                                        $error['retryMsg'][ $code ] = $message;
                                }
                                else {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic6a72d9e80e07d2b3e4e6997b4ab9cd3f2766cbe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>

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

Reply via email to