File tree Expand file tree Collapse file tree 3 files changed +62
-0
lines changed Expand file tree Collapse file tree 3 files changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,11 @@ public function checkCard(array $parameters = array())
126
126
return $ this ->createRequest (\Omnipay \ComfortPay \Message \CheckCardRequest::class, $ parameters );
127
127
}
128
128
129
+ public function unRegisterCard (array $ parameters = array ())
130
+ {
131
+ return $ this ->createRequest (\Omnipay \ComfortPay \Message \UnRegisterCardRequest::class, $ parameters );
132
+ }
133
+
129
134
public function listOfExpirePerId (array $ parameters = array ())
130
135
{
131
136
return $ this ->createRequest (\Omnipay \ComfortPay \Message \ListOfExpirePerIdRequest::class, $ parameters );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Omnipay \ComfortPay \Message ;
4
+
5
+ class UnRegisterCardRequest extends AbstractSoapRequest
6
+ {
7
+ public function getCardId ()
8
+ {
9
+ return $ this ->getParameter ('cardId ' );
10
+ }
11
+
12
+ public function setCardId ($ value )
13
+ {
14
+ return $ this ->setParameter ('cardId ' , $ value );
15
+ }
16
+
17
+ public function getData ()
18
+ {
19
+ $ this ->validate ('cardId ' );
20
+
21
+ $ data = parent ::getData ();
22
+ $ data ['cardId ' ] = $ this ->getCardId ();
23
+ return $ data ;
24
+ }
25
+
26
+ public function sendData ($ data )
27
+ {
28
+ if ($ this ->getTestmode ()) {
29
+ if ((int ) $ data ['cardId ' ] % 2 === 0 ) {
30
+ return $ this ->response = new UnRegisterCardResponse ($ this , 0 );
31
+ }
32
+ return $ this ->response = new UnRegisterCardResponse ($ this , 5 );
33
+ }
34
+
35
+ $ request = new \stdClass ();
36
+ $ request ->idOfCard = $ data ['cardId ' ];
37
+
38
+ $ client = $ this ->getSoapClient ();
39
+ $ response = $ client ->unRegisterCard ($ request );
40
+
41
+ return $ this ->response = new UnRegisterCardResponse ($ this , $ response );
42
+ }
43
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Omnipay \ComfortPay \Message ;
4
+
5
+ use Omnipay \Common \Message \AbstractResponse ;
6
+ use Omnipay \Common \Message \ResponseInterface ;
7
+
8
+ class UnRegisterCardResponse extends AbstractResponse implements ResponseInterface
9
+ {
10
+ public function isSuccessful ()
11
+ {
12
+ return (bool ) $ this ->data ;
13
+ }
14
+ }
You can’t perform that action at this time.
0 commit comments