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.
payment/app/Request/JsapiPayRequest.php

28 lines
857 B
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Request;
use Hyperf\Validation\Rule;
class JsapiPayRequest extends ApiRequest
{
public function rules(): array
{
2 years ago
$amountList = [500, 1000, 2000, 3000, 5000, 8000, 9800, 19800, 29800, 39800, 49800, 59800, 69800, 79800, 89800, 99800];
2 years ago
return [
'order_name' => ['required', 'max:64'],
'out_order_no' => ['required', 'max:32'],
2 years ago
'amount' => ['required', Rule::in($amountList)],
2 years ago
'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'],
];
}
}