Code Duplication    Length = 28-29 lines in 2 locations

src/Traits/SmartLoad.php 2 locations

@@ 64-91 (lines=28) @@
61
     *
62
     * @return array
63
     */
64
    public function cashup($dealerMsisdn, $start, $end)
65
    {
66
        try {
67
            $response = $this->post(
68
                '/webservice/smartload/cashup',
69
                [
70
                    'headers' => [
71
                        'Authorization' => $this->bearerOrBasic(),
72
                    ],
73
                    'json'    => [
74
                        'smartloadId' => $dealerMsisdn,
75
                        'startDate'   => $start,
76
                        'endDate'     => $end,
77
                    ],
78
                ]
79
            );
80
81
            return [
82
                'status'    => 'ok',
83
                'http_code' => $response->getStatusCode(),
84
                'body'      => (string) $response->getBody(),
85
            ];
86
        } catch (\GuzzleHttp\Exception\ClientException $e) {
87
            return $this->clientError($e);
88
        } catch (\GuzzleHttp\Exception\ServerException $e) {
89
            return $this->parseError($e);
90
        }
91
    }
92
93
    /**
94
     * Authenticate and request current day cashup report.
@@ 141-169 (lines=29) @@
138
     *
139
     * @return array
140
     */
141
    public function fundstransfer($fromDealerMsisdn, $toDealerMsisdn, $amount, $sendSms)
142
    {
143
        try {
144
            $response = $this->post(
145
                '/webservice/smartload/fundstransfer',
146
                [
147
                    'headers' => [
148
                        'Authorization' => $this->bearerOrBasic(),
149
                    ],
150
                    'json' => [
151
                        'sourceSmartloadId'    => $fromDealerMsisdn,
152
                        'recipientSmartloadId' => $toDealerMsisdn,
153
                        'amount'               => $amount,
154
                        'sendSms'              => $sendSms,
155
                    ],
156
                ]
157
            );
158
159
            return [
160
                'status'    => 'ok',
161
                'http_code' => $response->getStatusCode(),
162
                'body'      => (string) $response->getBody(),
163
            ];
164
        } catch (\GuzzleHttp\Exception\ClientException $e) {
165
            return $this->clientError($e);
166
        } catch (\GuzzleHttp\Exception\ServerException $e) {
167
            return $this->parseError($e);
168
        }
169
    }
170
171
    /**
172
     * Authenticate and retrieves a list of all available networks.