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

@@ 122-128 (lines=7) @@
119
        ];
120
    }
121
122
    public function _doCreate($subPath, $params)
123
    {
124
        $fullPath = $this->_config->merchantPath() . $subPath;
125
        $response = $this->_http->post($fullPath, $params);
126
127
        return $this->_verifyGatewayResponse($response);
128
    }
129
130
    private function _doUpdate($subPath, $params)
131
    {
@@ 130-136 (lines=7) @@
127
        return $this->_verifyGatewayResponse($response);
128
    }
129
130
    private function _doUpdate($subPath, $params)
131
    {
132
        $fullPath = $this->_config->merchantPath() . $subPath;
133
        $response = $this->_http->put($fullPath, $params);
134
135
        return $this->_verifyGatewayResponse($response);
136
    }
137
138
    private function _verifyGatewayResponse($response)
139
    {

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

@@ 183-189 (lines=7) @@
180
     * @param array $params
181
     * @return mixed
182
     */
183
    public function _doCreate($subPath, $params)
184
    {
185
        $fullPath = $this->_config->merchantPath() . $subPath;
186
        $response = $this->_http->post($fullPath, $params);
187
188
        return $this->_verifyGatewayResponse($response);
189
    }
190
191
    /**
192
     * sends the update request to the gateway
@@ 199-205 (lines=7) @@
196
     * @param array $params
197
     * @return mixed
198
     */
199
    public function _doUpdate($subPath, $params)
200
    {
201
        $fullPath = $this->_config->merchantPath() . $subPath;
202
        $response = $this->_http->put($fullPath, $params);
203
204
        return $this->_verifyGatewayResponse($response);
205
    }
206
207
    /**
208
     * generic method for validating incoming gateway responses

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

@@ 464-470 (lines=7) @@
461
     * @param array $params
462
     * @return mixed
463
     */
464
    public function _doCreate($subPath, $params)
465
    {
466
        $fullPath = $this->_config->merchantPath() . $subPath;
467
        $response = $this->_http->post($fullPath, $params);
468
469
        return $this->_verifyGatewayResponse($response);
470
    }
471
472
    /**
473
     * verifies that a valid transaction id is being used