Files
pingan_unionpay_new/app/Admin/Controllers/PetroController.php
2022-02-28 13:40:32 +08:00

59 lines
1.4 KiB
PHP

<?php
namespace App\Admin\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use XuanChen\Petro;
class PetroController
{
public function index(Request $request)
{
try {
// $res = Petro::Bill()->setParams([
// 'matchDate' => Carbon::now()->format('Ymd'),
// 'pageNo' => 1,
// 'dzmaxResult' => 1000,
// 'random' => Str::random(6),
// ])->start();
// dd($res);
// dd('作废');
// $res = Petro::Invalid()->setParams([
// 'cxcouponNo' => '61578832475977235',
// 'random' => Str::random(6),
// ])->start();
// dd($res);
// dd('查询');
$res = Petro::Detail()->setParams([
'couponNo' => '61578832475977235',
'random' => Str::random(6),
])->start();
//
dd($res);
// $grant = [
// 'requestCode' => 'Z591xRQ9fv1u',
// 'tradeId' => 111222,
// 'ticketSum' => 1,
// 'amount' => 10,
// 'random' => Str::random(6),
// ];
//
// $res = Petro::Grant()->setParams($grant)->start();
// dd($res);
} catch (\Exception $exception) {
dd('error'.$exception->getMessage());
}
}
}