Code Duplication    Length = 10-10 lines in 3 locations

src/Gateways/Alipay.php 3 locations

@@ 125-134 (lines=10) @@
122
     *
123
     * @return Collection
124
     */
125
    public function find($order): Collection
126
    {
127
        $this->payload['method'] = 'alipay.trade.query';
128
        $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
129
        $this->payload['sign'] = Support::generateSign($this->payload, $this->config->get('private_key'));
130
131
        Log::debug('Find An Order:', [$this->gateway, $this->payload]);
132
133
        return Support::requestApi($this->payload, $this->config->get('ali_public_key'));
134
    }
135
136
    /**
137
     * Refund an order.
@@ 165-174 (lines=10) @@
162
     *
163
     * @return Collection
164
     */
165
    public function cancel($order): Collection
166
    {
167
        $this->payload['method'] = 'alipay.trade.cancel';
168
        $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
169
        $this->payload['sign'] = Support::generateSign($this->payload, $this->config->get('private_key'));
170
171
        Log::debug('Cancel An Order:', [$this->gateway, $this->payload]);
172
173
        return Support::requestApi($this->payload, $this->config->get('ali_public_key'));
174
    }
175
176
    /**
177
     * Close an order.
@@ 185-194 (lines=10) @@
182
     *
183
     * @return Collection
184
     */
185
    public function close($order): Collection
186
    {
187
        $this->payload['method'] = 'alipay.trade.close';
188
        $this->payload['biz_content'] = json_encode(is_array($order) ? $order : ['out_trade_no' => $order]);
189
        $this->payload['sign'] = Support::generateSign($this->payload, $this->config->get('private_key'));
190
191
        Log::debug('Close An Order:', [$this->gateway, $this->payload]);
192
193
        return Support::requestApi($this->payload, $this->config->get('ali_public_key'));
194
    }
195
196
    /**
197
     * Reply success to alipay.