jenkins-bot has submitted this change and it was merged.
Change subject: Get rid of more setTransactionResult calls
......................................................................
Get rid of more setTransactionResult calls
Potentially funky, if transaction_response is null. Should we set
that to a new PaymentTransactionResponse object in the gateway
constructor?
Bug: T98063
Change-Id: Id5e0f5f9a01b892dbd6673ec356399d5b0e4c858
---
M amazon_gateway/amazon.adapter.php
M astropay_gateway/astropay.adapter.php
M globalcollect_gateway/globalcollect.adapter.php
M globalcollect_gateway/scripts/orphan_adapter.php
M worldpay_gateway/worldpay.adapter.php
5 files changed, 7 insertions(+), 6 deletions(-)
Approvals:
Awight: Looks good to me, approved
jenkins-bot: Verified
diff --git a/amazon_gateway/amazon.adapter.php
b/amazon_gateway/amazon.adapter.php
index 6454599..07a6e66 100644
--- a/amazon_gateway/amazon.adapter.php
+++ b/amazon_gateway/amazon.adapter.php
@@ -215,6 +215,7 @@
$this->session_addDonorData();
$this->setCurrentTransaction( $transaction );
+ $this->transaction_response = new PaymentTransactionResponse();
$override_url = $this->transaction_option( 'url' );
if ( !empty( $override_url ) ) {
@@ -312,7 +313,7 @@
if ( $this->getFinalStatus() === false ) {
$txnid = $this->dataObj->getVal_Escaped(
'gateway_txn_id' );
- $this->setTransactionResult( $txnid, 'gateway_txn_id' );
+ $this->transaction_response->setGatewayTransactionId(
$txnid );
// Second make sure that the inbound request had a
matching outbound session. If it
// doesn't we drop it.
diff --git a/astropay_gateway/astropay.adapter.php
b/astropay_gateway/astropay.adapter.php
index a058566..5756465 100644
--- a/astropay_gateway/astropay.adapter.php
+++ b/astropay_gateway/astropay.adapter.php
@@ -472,7 +472,7 @@
case 'NewInvoice':
$this->processNewInvoiceResponse( $response );
if ( isset( $response['link'] ) ) {
- $this->setTransactionResult( $response['link'],
'redirect' );
+ $this->transaction_response->setRedirect(
$response['link'] );
}
break;
}
diff --git a/globalcollect_gateway/globalcollect.adapter.php
b/globalcollect_gateway/globalcollect.adapter.php
index b2c4e34..b0c9807 100644
--- a/globalcollect_gateway/globalcollect.adapter.php
+++ b/globalcollect_gateway/globalcollect.adapter.php
@@ -1357,7 +1357,7 @@
if ( isset( $final['status'] ) &&
$final['status'] === true ) {
$this->finalizeInternalStatus(
FinalStatus::COMPLETE );
//get the old status from the first
txn, and add in the part where we set the payment.
- $this->setTransactionResult( "Original
Response Status (pre-SET_PAYMENT): " . $original_status_code, 'txn_message' );
+
$this->transaction_response->setTxnMessage( "Original Response Status
(pre-SET_PAYMENT): " . $original_status_code );
$this->runPostProcessHooks(); //
Queueing is in here.
} else {
$this->finalizeInternalStatus(
FinalStatus::FAILED );
@@ -1446,7 +1446,7 @@
} else {
$this->finalizeInternalStatus(
FinalStatus::FAILED );
//get the old status from the
first txn, and add in the part where we set the payment.
- $this->setTransactionResult(
"Original Response Status (pre-SET_PAYMENT): " . $original_status_code,
'txn_message' );
+
$this->transaction_response->setTxnMessage( "Original Response Status
(pre-SET_PAYMENT): " . $original_status_code );
}
// We won't need the limbo message
again, either way, so cancel it.
diff --git a/globalcollect_gateway/scripts/orphan_adapter.php
b/globalcollect_gateway/scripts/orphan_adapter.php
index bc700b8..545e23a 100644
--- a/globalcollect_gateway/scripts/orphan_adapter.php
+++ b/globalcollect_gateway/scripts/orphan_adapter.php
@@ -45,7 +45,7 @@
public function loadDataAndReInit( $data, $useDB = true ) {
//re-init all these arrays, because this is a batch thing.
$this->session_killAllEverything(); // just to be sure
- $this->setTransactionResult();
+ $this->transaction_response = new PaymentTransactionResponse();
$this->hard_data = array( );
$this->unstaged_data = array( );
$this->staged_data = array( );
diff --git a/worldpay_gateway/worldpay.adapter.php
b/worldpay_gateway/worldpay.adapter.php
index 8bd8076..a0e2b49 100644
--- a/worldpay_gateway/worldpay.adapter.php
+++ b/worldpay_gateway/worldpay.adapter.php
@@ -764,7 +764,7 @@
case 'QueryAuthorizeDeposit':
$result =
$this->do_transaction_QueryAuthorizeDeposit();
- $this->setTransactionResult(
$this->getData_Unstaged_Escaped( 'order_id' ), 'gateway_txn_id' );
+
$this->transaction_response->setGatewayTransactionId(
$this->getData_Unstaged_Escaped( 'order_id' ) );
$this->runPostProcessHooks();
return $result;
break;
--
To view, visit https://gerrit.wikimedia.org/r/209779
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id5e0f5f9a01b892dbd6673ec356399d5b0e4c858
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits