Index: trunk/extensions/DonationInterface/gateway_common/gateway.adapter.php |
— | — | @@ -799,15 +799,19 @@ |
800 | 800 | $this->executeIfFunctionExists( 'pre_process_' . $transaction ); |
801 | 801 | |
802 | 802 | if ( $this->getValidationAction() != 'process' ) { |
803 | | - return array( |
| 803 | + |
| 804 | + self::log( "Failed failed pre-process checks.", LOG_CRIT ); |
| 805 | + |
| 806 | + $this->transaction_results = array( |
804 | 807 | 'status' => false, |
805 | | - //TODO: appropriate messages. |
806 | | - 'message' => "$transaction : Failed failed pre-process checks. Somebody PLEASE override me!", |
| 808 | + 'message' => $this->getErrorMapByCodeAndTranslate( 'internal-0000' ), |
807 | 809 | 'errors' => array( |
808 | | - '1000000' => 'pre-process failed you.' //...stupid code. |
| 810 | + 'internal-0000' => $this->getErrorMapByCodeAndTranslate( 'internal-0000' ), |
809 | 811 | ), |
810 | 812 | 'action' => $this->getValidationAction(), |
811 | 813 | ); |
| 814 | + |
| 815 | + return $this->getTransactionAllResults(); |
812 | 816 | } |
813 | 817 | |
814 | 818 | //TODO: Maybe move this to the pre_process functions? |
— | — | @@ -827,16 +831,19 @@ |
828 | 832 | $this->saveCommunicationStats( "buildRequestNameValueString", $transaction ); // save profiling data |
829 | 833 | } |
830 | 834 | } catch ( MWException $e ) { |
| 835 | + |
831 | 836 | self::log( "Malformed gateway definition. Cannot continue: Aborting.\n" . $e->getMessage(), LOG_CRIT ); |
832 | | - return array( |
| 837 | + |
| 838 | + $this->transaction_results = array( |
833 | 839 | 'status' => false, |
834 | | - //TODO: appropriate messages. |
835 | | - 'message' => "$transaction : Malformed gateway definition. Cannot continue: Aborting.\n" . $e->getMessage(), |
| 840 | + 'message' => $this->getErrorMapByCodeAndTranslate( 'internal-0001' ), |
836 | 841 | 'errors' => array( |
837 | | - '1000000' => 'Transaction could not be processed due to an internal error.' |
| 842 | + 'internal-0001' => $this->getErrorMapByCodeAndTranslate( 'internal-0001' ), |
838 | 843 | ), |
839 | 844 | 'action' => $this->getValidationAction(), |
840 | 845 | ); |
| 846 | + |
| 847 | + return $this->getTransactionAllResults(); |
841 | 848 | } |
842 | 849 | |
843 | 850 | //start looping here, if we're the sort of transaction that needs to do that. |
— | — | @@ -892,14 +899,19 @@ |
893 | 900 | $this->saveCommunicationStats( __FUNCTION__, $transaction, "counter = $counter" ); |
894 | 901 | |
895 | 902 | if ( $txn_ok === false ) { //nothing to process, so we have to build it manually |
896 | | - return array( |
| 903 | + |
| 904 | + self::log( "$transaction Communication Failed!", LOG_CRIT ); |
| 905 | + |
| 906 | + $this->transaction_results = array( |
897 | 907 | 'status' => false, |
898 | | - 'message' => "$transaction Communication Failed!", |
| 908 | + 'message' => $this->getErrorMapByCodeAndTranslate( 'internal-0002' ), |
899 | 909 | 'errors' => array( |
900 | | - '1000000' => 'communication failure' //...stupid code. |
| 910 | + 'internal-0002' => $this->getErrorMapByCodeAndTranslate( 'internal-0002' ), |
901 | 911 | ), |
902 | 912 | 'action' => $this->getValidationAction(), |
903 | 913 | ); |
| 914 | + |
| 915 | + return $this->getTransactionAllResults(); |
904 | 916 | } |
905 | 917 | |
906 | 918 | //If we have any special post-process instructions for this |