Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/292501
Change subject: [WIP] Clean up how redirects are performed
......................................................................
[WIP] Clean up how redirects are performed
Now it's possible to include parameters on the redirect--which is usually what
we want.
Change-Id: If78dcdaafd7777f2602cf79c6389a37d7be3e267
---
M gateway_common/gateway.adapter.php
M paypal_gateway/legacy/paypal_legacy.adapter.php
2 files changed, 11 insertions(+), 20 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/01/292501/1
diff --git a/gateway_common/gateway.adapter.php
b/gateway_common/gateway.adapter.php
index 8ca6001..dfa63a3 100644
--- a/gateway_common/gateway.adapter.php
+++ b/gateway_common/gateway.adapter.php
@@ -1035,7 +1035,15 @@
$this->session_pushFormName(
$this->getData_Unstaged_Escaped( 'ffname' ) );
$this->transaction_response->setCommunicationStatus( true );
- $this->transaction_response->setRedirect(
$this->getCommunicationUrl() );
+
+ $redirectUrl = $this->getCommunicationUrl();
+ $redirectParams = $this->buildRequestParams();
+ if ( $redirectParams ) {
+ $redirectUrl += '?' . http_build_query(
$redirectParams );
+ }
+
+ $this->transaction_response->setRedirect(
$redirectUrl );
+
return $this->transaction_response;
} elseif ( $commType === 'xml' ) {
@@ -1216,21 +1224,6 @@
} else {
$this->current_transaction = $transaction_name;
}
-
- // XXX WIP
- $override_options = array(
- 'url',
- );
- foreach ( $override_options as $key ) {
- $override_val = $this->transaction_option( $key );
- // XXX this hack should probably be pushed down to
something
- // like "setTransactionOptions" so that we can override
with
- // a NULL value when we need to
- if ( $override_val !== NULL ) {
- $this->$key = $override_val;
- }
- }
-
}
public function getCurrentTransaction() {
diff --git a/paypal_gateway/legacy/paypal_legacy.adapter.php
b/paypal_gateway/legacy/paypal_legacy.adapter.php
index ad5e8c4..a1fc674 100644
--- a/paypal_gateway/legacy/paypal_legacy.adapter.php
+++ b/paypal_gateway/legacy/paypal_legacy.adapter.php
@@ -187,12 +187,10 @@
case 'Donate':
case 'DonateXclick':
case 'DonateRecurring':
- // FIXME: Push into a standard
namevalue+redirect handler.
- $this->transactions[$transaction]['url'] =
- $this->getCommunicationUrl() . '?'
- . http_build_query(
$this->buildRequestParams() );
$result = parent::do_transaction( $transaction
);
+
$this->finalizeInternalStatus(
FinalStatus::COMPLETE );
+
return $result;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/292501
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If78dcdaafd7777f2602cf79c6389a37d7be3e267
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits