This commit is contained in:
gaofeng
2026-09-09 10:42:06 +08:00
parent 9ea99da9c6
commit 8a02b7fd11
4 changed files with 51 additions and 19 deletions

View File

@@ -28,6 +28,7 @@ $native = VisaApplicationService::nativePaymentForCheck([
],
]);
if ($native !== ['target_table' => 'singapore', 'order_sn' => '2026090412000012', 'money' => '79.00']) throw new RuntimeException('native payment target failed');
if (VisaApplicationService::nativePaymentForCheck(['requires_payment'=>true,'total_price'=>15800,'target_orders'=>[['target_table'=>'singapore','target_order_sn'=>'1','applicant_index'=>0],['target_table'=>'singapore','target_order_sn'=>'2','applicant_index'=>1]]]) !== []) throw new RuntimeException('must not charge the batch against its first applicant');
if (VisaApplicationService::nativePaymentForCheck(['requires_payment' => true, 'total_price' => 7900, 'target_orders' => [['target_table' => 'bad-table', 'target_order_sn' => '1']]]) !== []) throw new RuntimeException('unsafe payment target accepted');
if (VisaApplicationService::dataSourceQueryForCheck('inac.city', ['model' => 'region', 'source_code' => 'jnwxmini', 'state_id' => '11', 'hotel_state' => '12', 'provinceCode' => '13', 'country' => 'CN', 'application_token' => 'secret', 'user_token' => 'secret']) !== ['type' => 'inac.city', 'model' => 'region', 'source_code' => 'jnwxmini', 'state_id' => '11', 'hotel_state' => '12', 'provinceCode' => '13', 'country' => 'CN']) throw new RuntimeException('miniapi data source filtering failed');
$controllerSource = (string)file_get_contents(dirname(__DIR__) . '/app/miniapi/controller/VisaApplication.php');