Code Duplication    Length = 7-7 lines in 2 locations

src/baokim/PaymentGateway.php 1 location

@@ 293-299 (lines=7) @@
290
    {
291
        if ($command === self::VRC_IPN) {
292
293
            if ($request === null) {
294
                if (Yii::$app instanceof \yii\web\Application) {
295
                    $request = Yii::$app->getRequest();
296
                } else {
297
                    throw new InvalidArgumentException('Request instance arg must be set to verify return request is valid or not!');
298
                }
299
            }
300
301
            $content = $this->getHttpClient()->post(self::VERIFY_IPN_URL, $request->post())->send()->getContent();
302

src/BasePaymentGateway.php 1 location

@@ 331-337 (lines=7) @@
328
        if (in_array($command, $this->verifyRequestCommands(), true)) {
329
            $client = $this->getClient($clientId);
330
331
            if ($request === null) {
332
                if (Yii::$app instanceof \yii\web\Application) {
333
                    $request = Yii::$app->getRequest();
334
                } else {
335
                    throw new InvalidArgumentException('Request instance arg must be set to verify return request is valid or not!');
336
                }
337
            }
338
339
            $data = $this->getVerifyRequestData($command, $request);
340
            /** @var VerifiedData $requestData */