1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Copyright notice: |
5
|
|
|
* (c) Copyright 2017 RocketGate |
6
|
|
|
* All rights reserved. |
7
|
|
|
* |
8
|
|
|
* The copyright notice must not be removed without specific, prior |
9
|
|
|
* written permission from RocketGate. |
10
|
|
|
* |
11
|
|
|
* This software is protected as an unpublished work under the U.S. copyright |
12
|
|
|
* laws. The above copyright notice is not intended to effect a publication of |
13
|
|
|
* this work. |
14
|
|
|
* This software is the confidential and proprietary information of RocketGate. |
15
|
|
|
* Neither the binaries nor the source code may be redistributed without prior |
16
|
|
|
* written permission from RocketGate. |
17
|
|
|
* |
18
|
|
|
* The software is provided "as-is" and without warranty of any kind, express, implied |
19
|
|
|
* or otherwise, including without limitation, any warranty of merchantability or fitness |
20
|
|
|
* for a particular purpose. In no event shall RocketGate be liable for any direct, |
21
|
|
|
* special, incidental, indirect, consequential or other damages of any kind, or any damages |
22
|
|
|
* whatsoever arising out of or in connection with the use or performance of this software, |
23
|
|
|
* including, without limitation, damages resulting from loss of use, data or profits, and |
24
|
|
|
* whether or not advised of the possibility of damage, regardless of the theory of liability. |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
namespace RocketGate\Sdk; |
28
|
|
|
|
29
|
|
|
abstract class GatewayAbstract |
30
|
|
|
{ |
31
|
|
|
const RESPONSE_SUCCESS = 0; |
32
|
|
|
const RESPONSE_BANK_FAIL = 1; |
33
|
|
|
const RESPONSE_RISK_FAIL = 2; |
34
|
|
|
const RESPONSE_SYSTEM_ERROR = 3; |
35
|
|
|
const RESPONSE_REQUEST_ERROR = 4; |
36
|
|
|
const REASON_SUCCESS = 0; |
37
|
|
|
const REASON_NOMATCHING_XACT = 100; |
38
|
|
|
const REASON_CANNOT_VOID = 101; |
39
|
|
|
const REASON_CANNOT_CREDIT = 102; |
40
|
|
|
const REASON_CANNOT_TICKET = 103; |
41
|
|
|
const REASON_DECLINED = 104; |
42
|
|
|
const REASON_DECLINED_OVERLIMIT = 105; |
43
|
|
|
const REASON_DECLINED_CVV2 = 106; |
44
|
|
|
const REASON_DECLINED_EXPIRED = 107; |
45
|
|
|
const REASON_DECLINED_CALL = 108; |
46
|
|
|
const REASON_DECLINED_PICKUP = 109; |
47
|
|
|
const REASON_DECLINED_EXCESSIVEUSE = 110; |
48
|
|
|
const REASON_DECLINED_INVALID_CARDNO = 111; |
49
|
|
|
const REASON_DECLINED_INVALID_EXPIRATION = 112; |
50
|
|
|
const REASON_BANK_UNAVAILABLE = 113; |
51
|
|
|
const REASON_EMPTY_BATCH = 114; |
52
|
|
|
const REASON_BATCH_REJECTED = 115; |
53
|
|
|
const REASON_DUPLICATE_BATCH = 116; |
54
|
|
|
const REASON_DECLINED_AVS = 117; |
55
|
|
|
const REASON_RISK_FAIL = 200; |
56
|
|
|
const REASON_DNS_FAILURE = 300; |
57
|
|
|
const REASON_UNABLE_TO_CONNECT = 301; |
58
|
|
|
const REASON_REQUEST_XMIT_ERROR = 302; |
59
|
|
|
const REASON_RESPONSE_READ_TIMEOUT = 303; |
60
|
|
|
const REASON_RESPONSE_READ_ERROR = 304; |
61
|
|
|
const REASON_SERVICE_UNAVAILABLE = 305; |
62
|
|
|
const REASON_CONNECTION_UNAVAILABLE = 306; |
63
|
|
|
const REASON_BUGCHECK = 307; |
64
|
|
|
const REASON_UNHANDLED_EXCEPTION = 308; |
65
|
|
|
const REASON_SQL_EXCEPTION = 309; |
66
|
|
|
const REASON_SQL_INSERT_ERROR = 310; |
67
|
|
|
const REASON_BANK_CONNECT_ERROR = 311; |
68
|
|
|
const REASON_BANK_XMIT_ERROR = 312; |
69
|
|
|
const REASON_BANK_READ_ERROR = 313; |
70
|
|
|
const REASON_BANK_DISCONNECT_ERROR = 314; |
71
|
|
|
const REASON_BANK_TIMEOUT_ERROR = 315; |
72
|
|
|
const REASON_BANK_PROTOCOL_ERROR = 316; |
73
|
|
|
const REASON_ENCRYPTION_ERROR = 317; |
74
|
|
|
const REASON_BANK_XMIT_RETRIES = 318; |
75
|
|
|
const REASON_BANK_RESPONSE_RETRIES = 319; |
76
|
|
|
const REASON_BANK_REDUNDANT_RESPONSES = 320; |
77
|
|
|
const REASON_XML_ERROR = 400; |
78
|
|
|
const REASON_INVALID_URL = 401; |
79
|
|
|
const REASON_INVALID_TRANSACTION = 402; |
80
|
|
|
const REASON_INVALID_CARDNO = 403; |
81
|
|
|
const REASON_INVALID_EXPIRATION = 404; |
82
|
|
|
const REASON_INVALID_AMOUNT = 405; |
83
|
|
|
const REASON_INVALID_MERCHANT_ID = 406; |
84
|
|
|
const REASON_INVALID_MERCHANT_ACCOUNT = 407; |
85
|
|
|
const REASON_INCOMPATABLE_CARDTYPE = 408; |
86
|
|
|
const REASON_NO_SUITABLE_ACCOUNT = 409; |
87
|
|
|
const REASON_INVALID_REFGUID = 410; |
88
|
|
|
const REASON_INVALID_ACCESS_CODE = 411; |
89
|
|
|
const REASON_INVALID_CUSTDATA_LENGTH = 412; |
90
|
|
|
const REASON_INVALID_EXTDATA_LENGTH = 413; |
91
|
|
|
const REASON_INVALID_CUSTOMER_ID = 414; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @var string |
95
|
|
|
*/ |
96
|
|
|
public $versionNo = 'P6.3m'; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return string |
100
|
|
|
*/ |
101
|
|
|
public function getVersion() |
102
|
|
|
{ |
103
|
|
|
return $this->versionNo; |
104
|
|
|
} |
105
|
|
|
} |
106
|
|
|
|