wp-pay-gateways /
buckaroo
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Pronamic\WordPress\Pay\Gateways\Buckaroo; |
||
| 4 | |||
| 5 | use Pronamic\WordPress\Pay\Payments\PaymentStatus as Core_Statuses; |
||
|
0 ignored issues
–
show
|
|||
| 6 | |||
| 7 | /** |
||
| 8 | * Title: Buckaroo statuses constants |
||
| 9 | * Description: |
||
| 10 | * Copyright: 2005-2019 Pronamic |
||
| 11 | * Company: Pronamic |
||
| 12 | * |
||
| 13 | * @author Remco Tolsma |
||
| 14 | * @version 2.0.0 |
||
| 15 | * @since 1.0.0 |
||
| 16 | */ |
||
| 17 | class Statuses { |
||
| 18 | /** |
||
| 19 | * Payment success |
||
| 20 | * |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | const PAYMENT_SUCCESS = '190'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Payment failure |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | const PAYMENT_FAILURE = '490'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Validation error |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | const VALIDATION_FAILURE = '491'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Technical error |
||
| 41 | * |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | const TECHNICAL_ERROR = '492'; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Payment rejected |
||
| 48 | * |
||
| 49 | * @var string |
||
| 50 | */ |
||
| 51 | const PAYMENT_REJECTED = '690'; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Waiting for user input |
||
| 55 | * |
||
| 56 | * @var string |
||
| 57 | */ |
||
| 58 | const WAITING_FOR_USER_INPUT = '790'; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Waiting for processor |
||
| 62 | * |
||
| 63 | * @var string |
||
| 64 | */ |
||
| 65 | const WAITING_FOR_PROCESSOR = '791'; |
||
| 66 | |||
| 67 | /** |
||
| 68 | * Waiting on consumer action (e.g.: initiate money transfer) |
||
| 69 | * |
||
| 70 | * @var string |
||
| 71 | */ |
||
| 72 | const WAITING_ON_CONSUMER_ACTION = '792'; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Payment on hold (e.g. waiting for sufficient balance) |
||
| 76 | * |
||
| 77 | * @var string |
||
| 78 | */ |
||
| 79 | const PAYMENT_ON_HOLD = '793'; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * Cancelled by consumer |
||
| 83 | * |
||
| 84 | * @var string |
||
| 85 | */ |
||
| 86 | const CANCELLED_BY_CONSUMER = '890'; |
||
| 87 | |||
| 88 | /** |
||
| 89 | * Cancelled by merchant |
||
| 90 | * |
||
| 91 | * @var string |
||
| 92 | */ |
||
| 93 | const CANCELLED_BY_MERCHANT = '891'; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * Transform an Buckaroo state to an more global status |
||
| 97 | * |
||
| 98 | * @param string $status_code |
||
| 99 | * |
||
| 100 | * @return null|string |
||
| 101 | */ |
||
| 102 | 12 | public static function transform( $status_code ) { |
|
| 103 | switch ( $status_code ) { |
||
| 104 | 12 | case self::PAYMENT_SUCCESS: |
|
| 105 | 1 | return Core_Statuses::SUCCESS; |
|
| 106 | |||
| 107 | 11 | case self::PAYMENT_FAILURE: |
|
| 108 | 10 | case self::VALIDATION_FAILURE: |
|
| 109 | 9 | case self::TECHNICAL_ERROR: |
|
| 110 | 8 | case self::PAYMENT_REJECTED: |
|
| 111 | 4 | return Core_Statuses::FAILURE; |
|
| 112 | |||
| 113 | 7 | case self::WAITING_FOR_USER_INPUT: |
|
| 114 | 6 | case self::WAITING_FOR_PROCESSOR: |
|
| 115 | 5 | case self::WAITING_ON_CONSUMER_ACTION: |
|
| 116 | 4 | case self::PAYMENT_ON_HOLD: |
|
| 117 | 4 | return Core_Statuses::OPEN; |
|
| 118 | |||
| 119 | 3 | case self::CANCELLED_BY_CONSUMER: |
|
| 120 | 2 | case self::CANCELLED_BY_MERCHANT: |
|
| 121 | 2 | return Core_Statuses::CANCELLED; |
|
| 122 | |||
| 123 | default: |
||
| 124 | 1 | return null; |
|
| 125 | } |
||
| 126 | } |
||
| 127 | } |
||
| 128 |
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