1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace DansMaCulotte\Monetico\Exceptions; |
4
|
|
|
|
5
|
|
|
class PurchaseException extends \Exception |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* @param string $ThreeDSecureChallenge |
9
|
|
|
* @return PurchaseException |
10
|
|
|
*/ |
11
|
|
|
public static function invalidThreeDSecureChallenge(string $ThreeDSecureChallenge): self |
12
|
|
|
{ |
13
|
|
|
return new self("ThreeDSecureChallenge value is invalid: ${ThreeDSecureChallenge}"); |
14
|
|
|
} |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @param string $returnCode |
18
|
|
|
* @return PurchaseException |
19
|
|
|
*/ |
20
|
|
|
public static function invalidResponseReturnCode(string $returnCode): self |
21
|
|
|
{ |
22
|
|
|
return new self("code-retour value is invalid: ${returnCode}"); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* @param string $status |
27
|
|
|
* @return PurchaseException |
28
|
|
|
*/ |
29
|
|
|
public static function invalidResponseCardVerificationStatus(string $status): self |
30
|
|
|
{ |
31
|
|
|
return new self("cvx value is invalid: ${status}"); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @param string $brand |
36
|
|
|
* @return PurchaseException |
37
|
|
|
*/ |
38
|
|
|
public static function invalidResponseCardBrand(string $brand): self |
39
|
|
|
{ |
40
|
|
|
return new self("brand value is invalid: ${brand}"); |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param string $rejectReason |
45
|
|
|
* @return PurchaseException |
46
|
|
|
*/ |
47
|
|
|
public static function invalidResponseRejectReason(string $rejectReason): self |
48
|
|
|
{ |
49
|
|
|
return new self("motifrefus value is invalid: ${rejectReason}"); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @param string $paymentMethod |
54
|
|
|
* |
55
|
|
|
* @return PurchaseException |
56
|
|
|
*/ |
57
|
|
|
public static function invalidResponsePaymentMethod(string $paymentMethod): self |
58
|
|
|
{ |
59
|
|
|
return new self("modepaiement value is invalid: ${paymentMethod}"); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @param string $filteredReason |
64
|
|
|
* |
65
|
|
|
* @return PurchaseException |
66
|
|
|
*/ |
67
|
|
|
public static function invalidResponseFilteredReason(string $filteredReason): self |
68
|
|
|
{ |
69
|
|
|
return new self("filtragecause value is invalid: ${filteredReason}"); |
70
|
|
|
} |
71
|
|
|
} |
72
|
|
|
|