moneris-eselectplus-api icon indicating copy to clipboard operation
moneris-eselectplus-api copied to clipboard

Transaction DECLINED but was_successful() returned OK

Open isaac-manubag opened this issue 7 years ago • 1 comments

as the title goes the transaction still was_successful() even though the response code was 481, DECLINED.

using version 0.1.1

isaac-manubag avatar Sep 08 '17 13:09 isaac-manubag

Maybe try creating an SCCEE to illustrate this issue?

Going through the codebase, it seems 481 is handled as Declined:

// was it a successful transaction?
// any response code greater than 49 is an error code:
if ((int) $receipt->ResponseCode >= 50 || (int) $receipt->ResponseCode == 0) {
	// trying to make some sense of this... grouping them as best as I can:
	switch ($receipt->ResponseCode) {
		// ...
		case '481':
		case '483':
			$this->error_code(Moneris_Result::ERROR_DECLINED);
			break;
		// ...
	}
	return $this->was_successful(false);
}

https://github.com/ironkeith/moneris-eselectplus-api/blob/master/lib/Moneris/Result.php#L328

MarkyC avatar Sep 28 '17 21:09 MarkyC