Files
pingan_unionpay_new/app/Admin/Controllers/PetroController.php
2022-05-24 16:19:12 +08:00

104 lines
2.8 KiB
PHP

<?php
namespace App\Admin\Controllers;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use XuanChen\Petro;
use XuanChen\PetroYsd;
class PetroController
{
public function index(Request $request)
{
try {
$res = PetroYsd::Invalid()
->setParams([
'requestId' => Str::random(32),
'couponId' => '2830025247791780434',
'couponType' => 0,
])->start();
dd($res);
// $res = PetroYsd::Query()
// ->setParams([
// 'requestId' => Str::random(32),
// 'thirdOrderId' => 'B6Q1rzCITRretxUFkIlFUtEciW7kNnq5',
// ])->start();
//
// dd($res);
// $res = PetroYsd::Detail()
// ->setParams([
// 'requestId' => Str::random(32),
// 'couponId' => '2830025247791780426',
// 'couponType' => 0,
// ])->start();
//
// dd($res);
$res = PetroYsd::Grant()->setParams([
'requestId' => Str::random(32),
'productNo' => 'hljlt_hlj6yypcs',
'mobile' => '15663876870',
'num' => 1,
'thirdOrderId' => Str::random(32),
])->start();
dd($res);
dd('老板程序');
//获取动态码
// $res = Petro::Check()->setParams([
// 'ticketNum' => '61578832475977235',
// 'random' => Str::random(6),
// ])->start();
//
// dd($res);
// $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());
}
}
}