wp-pay-gateways /
ogone
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Pronamic\WordPress\Pay\Gateways\Ingenico; |
||
| 4 | |||
| 5 | use Pronamic\WordPress\Pay\Payments\PaymentStatus as Core_Statuses; |
||
|
0 ignored issues
–
show
|
|||
| 6 | |||
| 7 | /** |
||
| 8 | * Title: Ingenico statuses constants |
||
| 9 | * Description: |
||
| 10 | * Copyright: 2005-2019 Pronamic |
||
| 11 | * Company: Pronamic |
||
| 12 | * |
||
| 13 | * @author Remco Tolsma |
||
| 14 | * @version 2.0.0 |
||
| 15 | * @see http://pronamic.nl/wp-content/uploads/2012/11/ABN-AMRO-List-of-the-payment-statuses-and-error-codes.pdf |
||
| 16 | */ |
||
| 17 | class Statuses { |
||
| 18 | /** |
||
| 19 | * Incomplete or invalid. |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | const INCOMPLETE_OR_INVALID = '0'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Cancelled by client. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | const CANCELLED_BY_CLIENT = '1'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Authorization refused. |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | const AUTHORIZATION_REFUSED = '2'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Order stored. |
||
| 41 | * |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | const ORDER_STORED = '4'; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Stored waiting external result. |
||
| 48 | * |
||
| 49 | * @var string |
||
| 50 | */ |
||
| 51 | const STORED_WAITING_EXTERNAL_RESULT = '40'; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Waiting client payment. |
||
| 55 | * |
||
| 56 | * @var string |
||
| 57 | */ |
||
| 58 | const WAITING_CLIENT_PAYMENT = '41'; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Authorized. |
||
| 62 | * |
||
| 63 | * @var string |
||
| 64 | */ |
||
| 65 | const AUTHORIZED = '5'; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Authorized waiting external result. |
||
| 69 | * |
||
| 70 | * @var string |
||
| 71 | */ |
||
| 72 | const AUHTORIZED_WAITING_EXTERNAL_RESULT = '50'; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Authorization waiting. |
||
| 76 | * |
||
| 77 | * @var string |
||
| 78 | */ |
||
| 79 | const AUTHORIZATION_WAITING = '51'; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Authorization not known. |
||
| 83 | * |
||
| 84 | * @var string |
||
| 85 | */ |
||
| 86 | const AUTHORIZATION_NOT_KNOWN = '52'; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Stand-by. |
||
| 90 | * |
||
| 91 | * @var string |
||
| 92 | */ |
||
| 93 | const STAND_BY = '55'; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * OK with scheduled payments. |
||
| 97 | * |
||
| 98 | * @var string |
||
| 99 | */ |
||
| 100 | const OK_WITH_SCHEDULED_PAYMENTS = '56'; |
||
| 101 | |||
| 102 | /** |
||
| 103 | * Error in scheduled payments. |
||
| 104 | * |
||
| 105 | * @var string |
||
| 106 | */ |
||
| 107 | const ERROR_IN_SCHEDULED_PAYMENTS = '57'; |
||
| 108 | |||
| 109 | /** |
||
| 110 | * Authoriz. to get manually. |
||
| 111 | * |
||
| 112 | * @var string |
||
| 113 | */ |
||
| 114 | const AUHORIZ_TO_GET_MANUALLY = '59'; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * Authorized and cancelled. |
||
| 118 | * |
||
| 119 | * @var string |
||
| 120 | */ |
||
| 121 | const AUTHORIZED_AND_CANCELLED = '6'; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * Author. deletion waiting. |
||
| 125 | * |
||
| 126 | * @var string |
||
| 127 | */ |
||
| 128 | const AUTHOR_DELETION_WAITING = '61'; |
||
| 129 | |||
| 130 | /** |
||
| 131 | * Author. deletion uncertain. |
||
| 132 | * |
||
| 133 | * @var string |
||
| 134 | */ |
||
| 135 | const AUTHOR_DELETION_UNCERTAIN = '62'; |
||
| 136 | |||
| 137 | /** |
||
| 138 | * Author. deletion refused. |
||
| 139 | * |
||
| 140 | * @var string |
||
| 141 | */ |
||
| 142 | const AUTHOR_DELETION_REFUSED = '63'; |
||
| 143 | |||
| 144 | /** |
||
| 145 | * Authorized and cancelled. |
||
| 146 | * |
||
| 147 | * @var string |
||
| 148 | */ |
||
| 149 | const AUTHORIZED_AND_CANCELLED_64 = '64'; |
||
| 150 | |||
| 151 | /** |
||
| 152 | * Payment deleted. |
||
| 153 | * |
||
| 154 | * @var string |
||
| 155 | */ |
||
| 156 | const PAYMENT_DELETED = '7'; |
||
| 157 | |||
| 158 | /** |
||
| 159 | * Payment deletion pending. |
||
| 160 | * |
||
| 161 | * @var string |
||
| 162 | */ |
||
| 163 | const PAYMENT_DELETION_PENDING = '71'; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * Payment deletion uncertain. |
||
| 167 | * |
||
| 168 | * @var string |
||
| 169 | */ |
||
| 170 | const PAYMENT_DELETION_UNCERTAIN = '72'; |
||
| 171 | |||
| 172 | /** |
||
| 173 | * Payment deletion refused. |
||
| 174 | * |
||
| 175 | * @var string |
||
| 176 | */ |
||
| 177 | const PAYMENT_DELETION_REFUSED = '73'; |
||
| 178 | |||
| 179 | /** |
||
| 180 | * Payment deleted. |
||
| 181 | * |
||
| 182 | * @var string |
||
| 183 | */ |
||
| 184 | const PAYMENT_DELETED_74 = '74'; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * Deletion processed by merchant. |
||
| 188 | * |
||
| 189 | * @var string |
||
| 190 | */ |
||
| 191 | const DELETION_PROCESSED_BY_MERCHANT = '75'; |
||
| 192 | |||
| 193 | /** |
||
| 194 | * Refund. |
||
| 195 | * |
||
| 196 | * @var string |
||
| 197 | */ |
||
| 198 | const REFUND = '8'; |
||
| 199 | |||
| 200 | /** |
||
| 201 | * Refund pending. |
||
| 202 | * |
||
| 203 | * @var string |
||
| 204 | */ |
||
| 205 | const REFUND_PENDING = '81'; |
||
| 206 | |||
| 207 | /** |
||
| 208 | * Refund uncertain. |
||
| 209 | * |
||
| 210 | * @var string |
||
| 211 | */ |
||
| 212 | const REFUND_UNCERTAIN = '82'; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * Refund refused. |
||
| 216 | * |
||
| 217 | * @var string |
||
| 218 | */ |
||
| 219 | const REFUND_REFUSED = '83'; |
||
| 220 | |||
| 221 | /** |
||
| 222 | * Payment declined by the acquirer. |
||
| 223 | * |
||
| 224 | * @var string |
||
| 225 | */ |
||
| 226 | const PAYMENT_DECLIEND_BY_THE_ACQUIRER = '84'; |
||
| 227 | |||
| 228 | /** |
||
| 229 | * Refund processed by merchant. |
||
| 230 | * |
||
| 231 | * @var string |
||
| 232 | */ |
||
| 233 | const REFUND_PROCESSED_BY_MERCHANT = '85'; |
||
| 234 | |||
| 235 | /** |
||
| 236 | * Payment requested. |
||
| 237 | * |
||
| 238 | * @var string |
||
| 239 | */ |
||
| 240 | const PAYMENT_REQUESTED = '9'; |
||
| 241 | |||
| 242 | /** |
||
| 243 | * Payment processing. |
||
| 244 | * |
||
| 245 | * @var string |
||
| 246 | */ |
||
| 247 | const PAYMENT_PROCESSING = '91'; |
||
| 248 | |||
| 249 | /** |
||
| 250 | * Payment uncertain. |
||
| 251 | * |
||
| 252 | * @var string |
||
| 253 | */ |
||
| 254 | const PAYMENT_UNCERTAIN = '92'; |
||
| 255 | |||
| 256 | /** |
||
| 257 | * Payment refused. |
||
| 258 | * |
||
| 259 | * @var string |
||
| 260 | */ |
||
| 261 | const PAYMENT_REFUSED = '93'; |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Refund declined by the acquirer. |
||
| 265 | * |
||
| 266 | * @var string |
||
| 267 | */ |
||
| 268 | const REFUND_DECLINED_BY_THE_ACQUIRER = '94'; |
||
| 269 | |||
| 270 | /** |
||
| 271 | * Payment processed by merchant. |
||
| 272 | * |
||
| 273 | * @var string |
||
| 274 | */ |
||
| 275 | const PAYMENT_PROCESSED_BY_MERCHANT = '95'; |
||
| 276 | |||
| 277 | /** |
||
| 278 | * Being processed. |
||
| 279 | * |
||
| 280 | * @var string |
||
| 281 | */ |
||
| 282 | const BEING_PROCESSED = '99'; |
||
| 283 | |||
| 284 | /** |
||
| 285 | * Transform an Ogone status to an Pronamic Pay status. |
||
| 286 | * |
||
| 287 | * @param string $status Status. |
||
| 288 | */ |
||
| 289 | 39 | public static function transform( $status ) { |
|
| 290 | switch ( $status ) { |
||
| 291 | 39 | case self::INCOMPLETE_OR_INVALID: |
|
| 292 | 38 | case self::AUTHORIZATION_REFUSED: |
|
| 293 | 37 | case self::AUTHOR_DELETION_REFUSED: |
|
| 294 | 36 | case self::PAYMENT_DELETION_REFUSED: |
|
| 295 | 35 | case self::REFUND_REFUSED: |
|
| 296 | 34 | case self::PAYMENT_DECLIEND_BY_THE_ACQUIRER: |
|
| 297 | 33 | case self::PAYMENT_REFUSED: |
|
| 298 | 32 | case self::REFUND_DECLINED_BY_THE_ACQUIRER: |
|
| 299 | 8 | return Core_Statuses::FAILURE; |
|
| 300 | 31 | case self::CANCELLED_BY_CLIENT: |
|
| 301 | 30 | case self::AUTHORIZED_AND_CANCELLED: |
|
| 302 | 29 | case self::AUTHORIZED_AND_CANCELLED_64: |
|
| 303 | 3 | return Core_Statuses::CANCELLED; |
|
| 304 | 28 | case self::ORDER_STORED: |
|
| 305 | 27 | case self::STORED_WAITING_EXTERNAL_RESULT: |
|
| 306 | 26 | case self::WAITING_CLIENT_PAYMENT: |
|
| 307 | 25 | case self::AUHTORIZED_WAITING_EXTERNAL_RESULT: |
|
| 308 | 24 | case self::AUTHORIZATION_WAITING: |
|
| 309 | 23 | case self::AUTHORIZATION_NOT_KNOWN: |
|
| 310 | 22 | case self::STAND_BY: |
|
| 311 | 21 | case self::OK_WITH_SCHEDULED_PAYMENTS: |
|
| 312 | 20 | case self::ERROR_IN_SCHEDULED_PAYMENTS: |
|
| 313 | 19 | case self::AUHORIZ_TO_GET_MANUALLY: |
|
| 314 | 18 | case self::AUTHOR_DELETION_WAITING: |
|
| 315 | 17 | case self::AUTHOR_DELETION_UNCERTAIN: |
|
| 316 | 16 | case self::PAYMENT_DELETION_PENDING: |
|
| 317 | 15 | case self::PAYMENT_DELETION_UNCERTAIN: |
|
| 318 | 14 | case self::PAYMENT_DELETED_74: |
|
| 319 | 13 | case self::DELETION_PROCESSED_BY_MERCHANT: |
|
| 320 | 12 | case self::REFUND_PENDING: |
|
| 321 | 11 | case self::REFUND_UNCERTAIN: |
|
| 322 | 10 | case self::PAYMENT_UNCERTAIN: |
|
| 323 | 9 | case self::PAYMENT_PROCESSING: |
|
| 324 | 8 | case self::BEING_PROCESSED: |
|
| 325 | 21 | return Core_Statuses::OPEN; |
|
| 326 | 7 | case self::AUTHORIZED: |
|
| 327 | 6 | case self::PAYMENT_DELETED: |
|
| 328 | 5 | case self::REFUND: |
|
| 329 | 4 | case self::REFUND_PROCESSED_BY_MERCHANT: |
|
| 330 | 3 | case self::PAYMENT_REQUESTED: |
|
| 331 | 2 | case self::PAYMENT_PROCESSED_BY_MERCHANT: |
|
| 332 | 6 | return Core_Statuses::SUCCESS; |
|
| 333 | default: |
||
| 334 | 1 | return null; |
|
| 335 | } |
||
| 336 | } |
||
| 337 | } |
||
| 338 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths