You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
861 B
PHP
28 lines
861 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request;
|
|
|
|
use Hyperf\Validation\Rule;
|
|
|
|
class JsapiPayRequest extends ApiRequest
|
|
{
|
|
public function rules(): array
|
|
{
|
|
$amountList = [10, 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'],
|
|
];
|
|
}
|
|
}
|