Commit b54a2bd1 authored by mattwire's avatar mattwire

Major refactor of MJWIPNTrait. Add function to set transaction ID for a payment

parent e7615148
This diff is collapsed.
......@@ -17,6 +17,11 @@ trait CRM_Core_Payment_MJWTrait {
*/
protected $_params = [];
/**
* @var string The unique charge/trxn reference from the payment processor
*/
private $paymentProcessorTrxnID;
/**
* @var string The unique invoice/order reference from the payment processor
*/
......@@ -391,10 +396,28 @@ trait CRM_Core_Payment_MJWTrait {
*
* @return string
*/
protected function getPaymentProcessorLabel() {
public function getPaymentProcessorLabel() {
return $this->_paymentProcessor['name'];
}
/**
* Set the payment processor Transaction ID
*
* @param string $trxnID
*/
protected function setPaymentProcessorTrxnID($trxnID) {
$this->paymentProcessorTrxnID = $trxnID;
}
/**
* Get the payment processor Transaction ID
*
* @return string
*/
protected function getPaymentProcessorTrxnID() {
return $this->paymentProcessorTrxnID;
}
/**
* Set the payment processor Order ID
*
......@@ -448,7 +471,7 @@ trait CRM_Core_Payment_MJWTrait {
* @return array
* @throws \CiviCRM_API3_Exception
*/
protected function endDoPayment($params, $contributionParams) {
protected function endDoPayment($params, $contributionParams = []) {
$contributionParams['trxn_id'] = $this->getPaymentProcessorOrderID();
if ($this->getContributionId($params)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment