Remove the unique index of the pays table in the database.

-- 1. Delete the original unique index
ALTER TABLE `pays`
  DROP INDEX `idx_pay_check`;

-- 2. (Optional) If you still want to keep an index for pay_check to speed up queries, create a regular index
CREATE INDEX `idx_pay_check` ON `pays` (`pay_check`);

Then add the Yipay payment channel record in the backend.

For example, if you add a new Yipay Alipay channel, the channel name can be anything, such as Yipay Alipay 2, but the payment identifier must be alipay. Changing it to anything else won't work. Yipay won't recognize it.

The same logic applies to other payment channels.

For example, if you need two Alipay Face-to-Face channels, the same approach applies.

If you don't do it this way, you can create a mapping in the Yipay controller:

 $this->loadGateWay($orderSN, $payway);

            // 2. Mapping from internal identifier to third-party type
            $typeMap = [
                'alipay'  => 'alipay',
                'alipay8' => 'alipay',
                'alipay9' => 'alipay',
                // To add more, continue here
            ];
            $thirdType = $typeMap[$payway] ?? $payway;

            // 3. Construct the basic parameters to submit to Yipay
            $parameter = [
                'pid'           => $this->payGateway->merchant_id,
                'type'          => $thirdType,
                'out_trade_no'  => $this->order->order_sn,
                'return_url'    => route('yipay-return', ['order_id' => $this->order->order_sn]),
                'notify_url'    => url($this->payGateway->pay_handleroute . '/notify_url'),
                'name'          => $this->order->order_sn,
                'money'         => (float)$this->order->actual_price,
                'sign'          => $this->payGateway->merchant_pem,
                'sign_type'     => 'MD5',
            ];

This way, you can add any number of Yipay channels. Add as many channels as you need.

'alipay8' => 'alipay',
 alipay9' => 'alipay',