Code Duplication    Length = 7-7 lines in 10 locations

catalog/includes/apps/braintree/lib/Braintree/AddressGateway.php 1 location

@@ 277-283 (lines=7) @@
274
     * @param array $params
275
     * @return Result\Successful|Result\Error
276
     */
277
    private function _doCreate($subPath, $params)
278
    {
279
        $fullPath = $this->_config->merchantPath() . $subPath;
280
        $response = $this->_http->post($fullPath, $params);
281
282
        return $this->_verifyGatewayResponse($response);
283
    }
284
285
    /**
286
     * generic method for validating incoming gateway responses

catalog/includes/apps/braintree/lib/Braintree/ClientTokenGateway.php 1 location

@@ 58-64 (lines=7) @@
55
     * @param array $params
56
     * @return mixed
57
     */
58
    public function _doGenerate($subPath, $params)
59
    {
60
        $fullPath = $this->_config->merchantPath() . $subPath;
61
        $response = $this->_http->post($fullPath, $params);
62
63
        return $this->_verifyGatewayResponse($response);
64
    }
65
66
    /**
67
     *

catalog/includes/apps/braintree/lib/Braintree/CreditCardGateway.php 1 location

@@ 414-420 (lines=7) @@
411
     * @param array $params
412
     * @return mixed
413
     */
414
    public function _doCreate($subPath, $params)
415
    {
416
        $fullPath = $this->_config->merchantPath() . $subPath;
417
        $response = $this->_http->post($fullPath, $params);
418
419
        return $this->_verifyGatewayResponse($response);
420
    }
421
422
    /**
423
     * verifies that a valid credit card identifier is being used

catalog/includes/apps/braintree/lib/Braintree/CustomerGateway.php 2 locations

@@ 551-557 (lines=7) @@
548
     * @param array $params
549
     * @return mixed
550
     */
551
    public function _doCreate($subPath, $params)
552
    {
553
        $fullPath = $this->_config->merchantPath() . $subPath;
554
        $response = $this->_http->post($fullPath, $params);
555
556
        return $this->_verifyGatewayResponse($response);
557
    }
558
559
    /**
560
     * verifies that a valid customer id is being used
@@ 589-595 (lines=7) @@
586
     * @param array $params
587
     * @return mixed
588
     */
589
    private function _doUpdate($httpVerb, $subPath, $params)
590
    {
591
        $fullPath = $this->_config->merchantPath() . $subPath;
592
        $response = $this->_http->$httpVerb($fullPath, $params);
593
594
        return $this->_verifyGatewayResponse($response);
595
    }
596
597
    /**
598
     * generic method for validating incoming gateway responses

catalog/includes/apps/braintree/lib/Braintree/MerchantAccountGateway.php 2 locations

@@ 147-153 (lines=7) @@
144
        ];
145
    }
146
147
    public function _doCreate($subPath, $params)
148
    {
149
        $fullPath = $this->_config->merchantPath() . $subPath;
150
        $response = $this->_http->post($fullPath, $params);
151
152
        return $this->_verifyGatewayResponse($response);
153
    }
154
155
    private function _doUpdate($subPath, $params)
156
    {
@@ 155-161 (lines=7) @@
152
        return $this->_verifyGatewayResponse($response);
153
    }
154
155
    private function _doUpdate($subPath, $params)
156
    {
157
        $fullPath = $this->_config->merchantPath() . $subPath;
158
        $response = $this->_http->put($fullPath, $params);
159
160
        return $this->_verifyGatewayResponse($response);
161
    }
162
163
    private function _verifyGatewayResponse($response)
164
    {

catalog/includes/apps/braintree/lib/Braintree/PaymentMethodGateway.php 2 locations

@@ 193-199 (lines=7) @@
190
     * @param array $params
191
     * @return mixed
192
     */
193
    public function _doCreate($subPath, $params)
194
    {
195
        $fullPath = $this->_config->merchantPath() . $subPath;
196
        $response = $this->_http->post($fullPath, $params);
197
198
        return $this->_verifyGatewayResponse($response);
199
    }
200
201
    /**
202
     * sends the update request to the gateway
@@ 209-215 (lines=7) @@
206
     * @param array $params
207
     * @return mixed
208
     */
209
    public function _doUpdate($subPath, $params)
210
    {
211
        $fullPath = $this->_config->merchantPath() . $subPath;
212
        $response = $this->_http->put($fullPath, $params);
213
214
        return $this->_verifyGatewayResponse($response);
215
    }
216
217
218
    /**

catalog/includes/apps/braintree/lib/Braintree/TransactionGateway.php 1 location

@@ 474-480 (lines=7) @@
471
     * @param array $params
472
     * @return mixed
473
     */
474
    public function _doCreate($subPath, $params)
475
    {
476
        $fullPath = $this->_config->merchantPath() . $subPath;
477
        $response = $this->_http->post($fullPath, $params);
478
479
        return $this->_verifyGatewayResponse($response);
480
    }
481
482
    /**
483
     * verifies that a valid transaction id is being used