|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Request;
|
|
|
|
|
|
|
|
use Hyperf\Validation\Rule;
|
|
|
|
|
|
|
|
class JsapiPayRequest extends ApiRequest
|
|
|
|
{
|
|
|
|
public function rules(): array
|
|
|
|
{
|
|
|
|
$amountList = [500, 1000, 2000, 3000, 5000, 8000, 9800, 19800, 29800, 39800, 49800, 59800, 69800, 79800, 89800, 99800];
|
|
|
|
return [
|
|
|
|
'order_name' => ['required', 'max:64'],
|
|
|
|
'out_order_no' => ['required', 'max:32'],
|
|
|
|
'amount' => ['required', Rule::in($amountList)],
|
|
|
|
'currency' => ['required', Rule::in(['CNY'])],
|
|
|
|
'show_pc_pay_url' => ['integer', Rule::in([1, 2])],
|
|
|
|
'direct_pay' => ['integer', Rule::in([1, 2])],
|
|
|
|
'notify_url' => ['required', 'url'],
|
|
|
|
'redirect_url' => ['required', 'url'],
|
|
|
|
'o_number' => ['max:32'],
|
|
|
|
'pos_no' => ['max:32'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|