wp-pay-gateways /
multisafepay
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Pronamic\WordPress\Pay\Gateways\MultiSafepay; |
||
| 4 | |||
| 5 | use Pronamic\WordPress\Pay\Payments\PaymentStatus as Core_Statuses; |
||
|
0 ignored issues
–
show
|
|||
| 6 | |||
| 7 | /** |
||
| 8 | * Title: MultiSafepay statuses constants |
||
| 9 | * Description: |
||
| 10 | * Copyright: 2005-2019 Pronamic |
||
| 11 | * Company: Pronamic |
||
| 12 | * |
||
| 13 | * @author Remco Tolsma |
||
| 14 | * @version 2.0.2 |
||
| 15 | */ |
||
| 16 | class Statuses { |
||
| 17 | /** |
||
| 18 | * Completed successfully |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | const COMPLETED = 'completed'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Created, but uncompleted |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | const INITIALIZED = 'initialized'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Created, but not yet exempted (credit cards) |
||
| 33 | * |
||
| 34 | * @var string |
||
| 35 | */ |
||
| 36 | const UNCLEARED = 'uncleared'; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Cancelled |
||
| 40 | * |
||
| 41 | * @var string |
||
| 42 | */ |
||
| 43 | const VOID = 'void'; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Rejected |
||
| 47 | * |
||
| 48 | * @var string |
||
| 49 | */ |
||
| 50 | const DECLINED = 'declined'; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Refunded |
||
| 54 | * |
||
| 55 | * @var string |
||
| 56 | */ |
||
| 57 | const REFUNDED = 'refunded'; |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Expired |
||
| 61 | * |
||
| 62 | * @var string |
||
| 63 | */ |
||
| 64 | const EXPIRED = 'expired'; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Transform an MultiSafepay state to an more global status |
||
| 68 | * |
||
| 69 | * @param string $status |
||
| 70 | * |
||
| 71 | * @return null|string |
||
| 72 | */ |
||
| 73 | 8 | public static function transform( $status ) { |
|
| 74 | switch ( $status ) { |
||
| 75 | 8 | case self::COMPLETED: |
|
| 76 | 1 | return Core_Statuses::SUCCESS; |
|
| 77 | |||
| 78 | 7 | case self::INITIALIZED: |
|
| 79 | 1 | return Core_Statuses::OPEN; |
|
| 80 | |||
| 81 | 6 | case self::UNCLEARED: |
|
| 82 | 1 | return Core_Statuses::OPEN; |
|
| 83 | |||
| 84 | 5 | case self::VOID: |
|
| 85 | 1 | return Core_Statuses::CANCELLED; |
|
| 86 | |||
| 87 | 4 | case self::DECLINED: |
|
| 88 | 1 | return Core_Statuses::FAILURE; |
|
| 89 | |||
| 90 | 3 | case self::REFUNDED: |
|
| 91 | 1 | return Core_Statuses::CANCELLED; |
|
| 92 | |||
| 93 | 2 | case self::EXPIRED: |
|
| 94 | 1 | return Core_Statuses::EXPIRED; |
|
| 95 | |||
| 96 | default: |
||
| 97 | 1 | return null; |
|
| 98 | } |
||
| 99 | } |
||
| 100 | } |
||
| 101 |
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