File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -56,4 +56,9 @@ public function completePurchase(array $parameters = array())
5656 {
5757 return $ this ->createRequest ('\Omnipay\Netaxept\Message\CompletePurchaseRequest ' , $ parameters );
5858 }
59+
60+ public function capture (array $ parameters = array ())
61+ {
62+ return $ this ->createRequest ('\Omnipay\Netaxept\Message\CaptureRequest ' , $ parameters );
63+ }
5964}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Omnipay \Netaxept \Message ;
4+
5+ /**
6+ * Netaxept Capture Request
7+ *
8+ * @author Antonio Peric-Mazar <antonio@locastic.com>
9+ */
10+ class CaptureRequest extends PurchaseRequest
11+ {
12+ public function getData ()
13+ {
14+ $ data = array ();
15+ $ data ['transactionAmount ' ] = $ this ->getAmountInteger ();
16+ $ data ['transactionId ' ] = $ this ->getTransactionId ();
17+ $ data ['merchantId ' ] = $ this ->getMerchantId ();
18+ $ data ['token ' ] = $ this ->getPassword ();
19+ $ data ['operation ' ] = 'CAPTURE ' ;
20+
21+ return $ data ;
22+ }
23+
24+ public function sendData ($ data )
25+ {
26+ $ url = $ this ->getEndpoint ().'/Netaxept/Process.aspx? ' ;
27+ $ httpResponse = $ this ->httpClient ->get ($ url .http_build_query ($ data ))->send ();
28+
29+ return $ this ->response = new Response ($ this , $ httpResponse ->xml ());
30+ }
31+ }
You can’t perform that action at this time.
0 commit comments