Skip to content

Commit fde8636

Browse files
committed
PSR correction
1 parent 2efb500 commit fde8636

9 files changed

+21
-49
lines changed

src/Omnipay/Ecopayz/Gateway.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
class Gateway extends AbstractGateway
1515
{
16-
1716
/**
1817
* {@inheritdoc}
1918
*/

src/Omnipay/Ecopayz/Message/AbstractRequest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212
abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
1313
{
14-
1514
/**
1615
* Get the Merchant ID
1716
*
@@ -129,9 +128,6 @@ protected function calculateArrayChecksum(array $data)
129128
*/
130129
protected function calculateXmlChecksum($string)
131130
{
132-
133-
return md5(str_replace(array("\r\n", "\r", "\n"), '', trim($string)));
134-
131+
return md5(str_replace(array("\r\n", "\r", "\n"), '', trim($string)));
135132
}
136-
137133
}

src/Omnipay/Ecopayz/Message/CompletePurchaseRequest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
class CompletePurchaseRequest extends FetchTransactionRequest
1515
{
16-
1716
private $trustedIps = array(
1817
'213.129.76.104', '213.129.76.105',
1918
'217.21.162.163', '217.21.162.164',
@@ -28,7 +27,6 @@ class CompletePurchaseRequest extends FetchTransactionRequest
2827
*/
2928
public function getData()
3029
{
31-
3230
$this->validate(
3331
'merchantId',
3432
'merchantPassword'
@@ -58,7 +56,6 @@ public function getData()
5856
throw new InvalidRequestException('Missing XML');
5957

6058
}
61-
6259
}
6360

6461
/**
@@ -69,7 +66,6 @@ public function getData()
6966
*/
7067
public function sendData($data)
7168
{
72-
7369
if (isset($data->StatusReport)) {
7470

7571
if (in_array($data->StatusReport->Status, array(1, 2, 3))) {
@@ -87,7 +83,6 @@ public function sendData($data)
8783
} else {
8884
return new CompletePurchaseResponse($this, $data);
8985
}
90-
9186
}
9287

9388
/**
@@ -106,7 +101,6 @@ public function sendData($data)
106101
*/
107102
public function createResponse($status, $errorCode, $errorDescription)
108103
{
109-
110104
$document = new \DOMDocument('1.0', 'utf-8');
111105
$document->formatOutput = false;
112106

@@ -141,7 +135,6 @@ public function createResponse($status, $errorCode, $errorDescription)
141135
$checksum->nodeValue = $this->calculateXmlChecksum($document->saveXML());
142136

143137
return $document->saveXML();
144-
145138
}
146139

147140
/**
@@ -152,13 +145,10 @@ public function createResponse($status, $errorCode, $errorDescription)
152145
*/
153146
public function validateChecksum($string)
154147
{
155-
156148
$xml = new \SimpleXMLElement($string);
157149
$checksum = (string) $xml->Authentication->Checksum;
158150
$original = str_replace($checksum, $this->getMerchantPassword(), $string);
159151

160152
return md5($original) == $checksum;
161-
162153
}
163-
164154
}

src/Omnipay/Ecopayz/Message/CompletePurchaseResponse.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
*/
1212
class CompletePurchaseResponse extends FetchTransactionResponse
1313
{
14-
1514
/**
16-
* Get the Merchant’s transaction ID.
15+
* Get the Merchant transaction ID.
1716
*
1817
* @return string transaction reference
1918
*/
@@ -31,5 +30,4 @@ public function getTransactionReference()
3130
{
3231
return (string) $this->data->SvsTxID;
3332
}
34-
3533
}

src/Omnipay/Ecopayz/Message/FetchTransactionRequest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
class FetchTransactionRequest extends AbstractRequest
1616
{
17-
1817
protected $endpoint = 'https://secure.ecopayz.com/services/MerchantAPI/MerchantAPIService.asmx';
1918

2019
/**
@@ -25,7 +24,6 @@ class FetchTransactionRequest extends AbstractRequest
2524
*/
2625
public function getData()
2726
{
28-
2927
$this->validate(
3028
'merchantId',
3129
'merchantPassword'
@@ -97,7 +95,6 @@ public function getData()
9795
}
9896

9997
return $document->saveXML();
100-
10198
}
10299

103100
/**
@@ -110,7 +107,6 @@ public function getData()
110107
*/
111108
public function sendData($data)
112109
{
113-
114110
if (strpos($data, 'QueryBySVSTransactionID') !== false) {
115111

116112
$headers = array(
@@ -132,9 +128,12 @@ public function sendData($data)
132128
throw new InvalidResponseException('Missing element in XML response');
133129
}
134130

135-
return new FetchTransactionResponse($this, $xmlResponse
136-
->QueryBySVSTransactionIDResponse
137-
->TransactionResponse);
131+
return new FetchTransactionResponse(
132+
$this,
133+
$xmlResponse
134+
->QueryBySVSTransactionIDResponse
135+
->TransactionResponse
136+
);
138137

139138
} elseif (strpos($data, 'QueryByCustomerTransactionID') !== false) {
140139

@@ -157,16 +156,17 @@ public function sendData($data)
157156
throw new InvalidResponseException('Missing element in XML response');
158157
}
159158

160-
return new FetchTransactionResponse($this, $xmlResponse
161-
->QueryByCustomerTransactionIDResponse
162-
->TransactionResponse);
159+
return new FetchTransactionResponse(
160+
$this,
161+
$xmlResponse
162+
->QueryByCustomerTransactionIDResponse
163+
->TransactionResponse
164+
);
163165

164166
} else {
165167

166168
throw new InvalidRequestException('The transactionId or transactionReference parameter is required');
167169

168170
}
169-
170171
}
171-
172172
}

src/Omnipay/Ecopayz/Message/FetchTransactionResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414
class FetchTransactionResponse extends AbstractResponse
1515
{
16-
1716
/**
1817
* Is the response successful?
1918
*
@@ -136,5 +135,4 @@ public function getProcessingTime()
136135
{
137136
return (string) $this->data->ProcessingTime;
138137
}
139-
140138
}

src/Omnipay/Ecopayz/Message/PayoutRequest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
*/
99
class PayoutRequest extends AbstractRequest
1010
{
11-
1211
protected $endpoint = 'https://secure.ecopayz.com/services/MerchantAPI/MerchantAPIService.asmx';
1312

1413
/**
1514
* Get the Client Account Number
1615
*
17-
* Client’s account number (who receive funds) in the ecoPayz system.
16+
* Client account number (who receive funds) in the ecoPayz system.
1817
*
1918
* @return string client account number
2019
*/
@@ -26,7 +25,7 @@ public function getClientAccountNumber()
2625
/**
2726
* Set the Client Account Number
2827
*
29-
* Client’s account number (who receive funds) in the ecoPayz system.
28+
* Client account number (who receive funds) in the ecoPayz system.
3029
*
3130
* @param string $value client account number
3231
* @return self
@@ -39,7 +38,7 @@ public function setClientAccountNumber($value)
3938
/**
4039
* Get the Client Account Number at Merchant
4140
*
42-
* Client’s account number at merchant.
41+
* Client account number at merchant.
4342
*
4443
* @return string client account number at merchant
4544
*/
@@ -51,7 +50,7 @@ public function getClientAccountNumberAtMerchant()
5150
/**
5251
* Set the Client Account Number at Merchant
5352
*
54-
* Client’s account number at merchant.
53+
* Client account number at merchant.
5554
*
5655
* @param string $value client account number at merchant
5756
* @return self
@@ -68,7 +67,6 @@ public function setClientAccountNumberAtMerchant($value)
6867
*/
6968
public function getData()
7069
{
71-
7270
$this->validate(
7371
'merchantId',
7472
'merchantPassword',
@@ -142,7 +140,6 @@ public function getData()
142140
}
143141

144142
return $document->saveXML();
145-
146143
}
147144

148145
/**
@@ -154,7 +151,6 @@ public function getData()
154151
*/
155152
public function sendData($data)
156153
{
157-
158154
$headers = array(
159155
'Content-Type' => 'text/xml; charset=utf-8',
160156
'SOAPAction' => 'http://www.ecocard.com/merchantAPI/Payout'
@@ -175,6 +171,5 @@ public function sendData($data)
175171
}
176172

177173
return new FetchTransactionResponse($this, $xmlResponse->PayoutResponse->TransactionResponse);
178-
179174
}
180175
}

src/Omnipay/Ecopayz/Message/PurchaseRequest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Ecopayz Purchase Request
66
*
77
* When a client connects to the merchant's WEB store and chooses something to purchase,
8-
* the merchants application needs to obtain the money amount of this purchase operation,
8+
* the merchant's application needs to obtain the money amount of this purchase operation,
99
* so it offers various payment methods to the client (for example, ecoPayz).
1010
* When the client chooses ecoPayz, the next step can be executed.
1111
*
@@ -16,11 +16,10 @@
1616
*/
1717
class PurchaseRequest extends AbstractRequest
1818
{
19-
2019
/**
2120
* Get the Customer ID at Merchant
2221
*
23-
* The clients account number at the merchant site.
22+
* The client's account number at the merchant site.
2423
*
2524
* @return string customer id at merchant
2625
*/
@@ -32,7 +31,7 @@ public function getCustomerIdAtMerchant()
3231
/**
3332
* Set the Customer ID at Merchant
3433
*
35-
* The clients account number at the merchant site.
34+
* The client's account number at the merchant site.
3635
*
3736
* @param string $value customer id at merchant
3837
* @return self
@@ -49,7 +48,6 @@ public function setCustomerIdAtMerchant($value)
4948
*/
5049
public function getData()
5150
{
52-
5351
$this->validate(
5452
'merchantId',
5553
'merchantAccountNumber',

src/Omnipay/Ecopayz/Message/PurchaseResponse.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
1818
{
19-
2019
protected $endpoint = 'https://secure.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx';
2120

2221
public function __construct(RequestInterface $request, $data)
@@ -49,5 +48,4 @@ public function getRedirectData()
4948
{
5049
return null;
5150
}
52-
5351
}

0 commit comments

Comments
 (0)