@@ -23,7 +23,7 @@ public function setUp()
2323 /** @var Gateway gateway */
2424 $ this ->gateway = new Gateway (null , $ this ->getHttpRequest ());
2525 $ this ->gateway ->setMerchantId ('7000679 ' );
26- $ this ->gateway ->setTerminalId ('030691297 ' );
26+ $ this ->gateway ->setTerminalId ('30691297 ' );
2727 $ this ->gateway ->setTestMode (true );
2828 }
2929
@@ -32,63 +32,61 @@ public function testAuthorize()
3232 {
3333 $ this ->options = [
3434 'card ' => $ this ->getCardInfo (),
35- 'orderId ' => '8443343542 ' ,
35+ 'orderId ' => '10082020_114109 ' ,
3636 'username ' => 'PROVAUT ' ,
37- 'password ' => '123qweASD ' ,
37+ 'password ' => '123qweASD/ ' ,
3838 'amount ' => "1 " ,
3939 'currency ' => 'TRY ' ,
40- 'installment ' => "1 " ,
41- 'paymentType ' => ''
40+ 'installment ' => "" ,
41+ 'clientIp ' => '10.241.19.2 '
4242 ];
4343
4444 /** @var AuthorizeResponse $response */
4545 $ response = $ this ->gateway ->authorize ($ this ->options )->send ();
4646 $ this ->assertTrue ($ response ->isSuccessful ());
4747 }
4848
49- public function testCompletePurchase ()
49+ public function testCapture ()
5050 {
5151 $ this ->options = [
5252 'card ' => $ this ->getCardInfo (),
53- 'orderId ' => '8443343542 ' ,
53+ 'orderId ' => '10082020_1141 ' ,
5454 'username ' => 'PROVAUT ' ,
55- 'password ' => '123qweASD ' ,
55+ 'password ' => '123qweASD/ ' ,
5656 'amount ' => "1 " ,
5757 'currency ' => 'TRY ' ,
58- 'installment ' => "1 " ,
59- 'cavv ' => '1 ' ,
60- 'eci ' => '1 ' ,
61- 'xid ' => '1 ' ,
62- 'md ' => '1 ' ,
63- 'paymentType ' => ''
58+ 'installment ' => "" ,
59+ 'clientIp ' => '10.241.19.2 '
6460 ];
6561
66- /** @var CompletePurchaseResponse $response */
67- $ response = $ this ->gateway ->completePurchase ($ this ->options )->send ();
62+ /** @var CaptureResponse $response */
63+ $ response = $ this ->gateway ->capture ($ this ->options )->send ();
6864 $ this ->assertTrue ($ response ->isSuccessful ());
6965 }
7066
7167 public function testPurchase ()
7268 {
7369 $ this ->options = [
7470 'card ' => $ this ->getCardInfo (),
75- 'orderId ' => '8443343542 ' ,
71+ 'orderId ' => '10082020_114108 ' ,
7672 'username ' => 'PROVAUT ' ,
77- 'password ' => '123qweASD ' ,
78- 'amount ' => "1 " ,
73+ 'password ' => '123qweASD/ ' ,
74+ 'amount ' => "100 " ,
7975 'currency ' => 'TRY ' ,
8076 'returnUrl ' => "www.backref.com.tr " ,
8177 'cancelUrl ' => "www.backref.com.tr " ,
82- 'installment ' => "1 "
78+ 'installment ' => "" ,
79+ 'paymentType ' => '' ,
80+ 'clientIp ' => '10.241.19.2 '
8381 ];
8482
8583 /** @var PurchaseResponse $response */
8684 $ response = $ this ->gateway ->purchase ($ this ->options )->send ();
85+
8786 $ this ->assertTrue ($ response ->isSuccessful ());
8887 }
8988
90-
91- public function testCapture ()
89+ public function testCompletePurchase ()
9290 {
9391 $ this ->options = [
9492 'card ' => $ this ->getCardInfo (),
@@ -98,11 +96,15 @@ public function testCapture()
9896 'amount ' => "1 " ,
9997 'currency ' => 'TRY ' ,
10098 'installment ' => "1 " ,
99+ 'cavv ' => '1 ' ,
100+ 'eci ' => '1 ' ,
101+ 'xid ' => '1 ' ,
102+ 'md ' => '1 ' ,
101103 'paymentType ' => ''
102104 ];
103105
104- /** @var CaptureResponse $response */
105- $ response = $ this ->gateway ->capture ($ this ->options )->send ();
106+ /** @var CompletePurchaseResponse $response */
107+ $ response = $ this ->gateway ->completePurchase ($ this ->options )->send ();
106108 $ this ->assertTrue ($ response ->isSuccessful ());
107109 }
108110
@@ -112,12 +114,12 @@ public function testCapture()
112114 private function getCardInfo (): CreditCard
113115 {
114116 $ cardInfo = $ this ->getValidCard ();
115- $ cardInfo ['number ' ] = '5406675406675403 ' ;
116- $ cardInfo ['expiryMonth ' ] = "12 " ;
117- $ cardInfo ['expiryYear ' ] = "2015 " ;
118- $ cardInfo ['cvv ' ] = "000 " ;
117+ $ cardInfo ['number ' ] = '5549608789641500 ' ;
118+ $ cardInfo ['expiryMonth ' ] = "03 " ;
119+ $ cardInfo ['expiryYear ' ] = "2023 " ;
120+ $ cardInfo ['cvv ' ] = "712 " ;
119121 $ card = new CreditCard ($ cardInfo );
120- $ card ->setEmail ("mail@mail .com " );
122+ $ card ->setEmail ("emrez@garanti .com.tr " );
121123 $ card ->setFirstName ('Test name ' );
122124 $ card ->setLastName ('Test lastname ' );
123125
0 commit comments