Code Duplication    Length = 7-7 lines in 2 locations

src/Gateways/Alipay/Support.php 2 locations

@@ 194-200 (lines=7) @@
191
            throw new InvalidConfigException('Missing Alipay Config -- [private_key]');
192
        }
193
194
        if (Str::endsWith($privateKey, '.pem')) {
195
            $privateKey = openssl_pkey_get_private($privateKey);
196
        } else {
197
            $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n".
198
                wordwrap($privateKey, 64, "\n", true).
199
                "\n-----END RSA PRIVATE KEY-----";
200
        }
201
202
        openssl_sign(self::getSignContent($params), $sign, $privateKey, OPENSSL_ALGO_SHA256);
203
@@ 232-238 (lines=7) @@
229
            throw new InvalidConfigException('Missing Alipay Config -- [ali_public_key]');
230
        }
231
232
        if (Str::endsWith($publicKey, '.pem')) {
233
            $publicKey = openssl_pkey_get_public($publicKey);
234
        } else {
235
            $publicKey = "-----BEGIN PUBLIC KEY-----\n".
236
                wordwrap($publicKey, 64, "\n", true).
237
                "\n-----END PUBLIC KEY-----";
238
        }
239
240
        $sign = $sign ?? $data['sign'];
241