Code Duplication    Length = 7-7 lines in 2 locations

src/Gateways/Alipay/Support.php 2 locations

@@ 175-181 (lines=7) @@
172
            throw new InvalidConfigException('Missing Alipay Config -- [private_key]');
173
        }
174
175
        if (Str::endsWith($privateKey, '.pem')) {
176
            $privateKey = openssl_pkey_get_private($privateKey);
177
        } else {
178
            $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n".
179
                wordwrap($privateKey, 64, "\n", true).
180
                "\n-----END RSA PRIVATE KEY-----";
181
        }
182
183
        openssl_sign(self::getSignContent($params), $sign, $privateKey, OPENSSL_ALGO_SHA256);
184
@@ 213-219 (lines=7) @@
210
            throw new InvalidConfigException('Missing Alipay Config -- [ali_public_key]');
211
        }
212
213
        if (Str::endsWith($publicKey, '.pem')) {
214
            $publicKey = openssl_pkey_get_public($publicKey);
215
        } else {
216
            $publicKey = "-----BEGIN PUBLIC KEY-----\n".
217
                wordwrap($publicKey, 64, "\n", true).
218
                "\n-----END PUBLIC KEY-----";
219
        }
220
221
        $sign = $sign ?? $data['sign'];
222