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/Helper/Efps/Api.php

24 lines
777 B
PHTML

2 years ago
<?php
namespace App\Helper\Efps;
use App\Helper\Efps\Request\UnifiedPaymentRequest;
2 years ago
use App\Helper\StringHelper;
2 years ago
2 years ago
class Api extends AbstractApi
2 years ago
{
public static function unifiedPayment($outTradeNo, $orderInfo, $payAmount, $notifyUrl, $redirectUrl)
{
$request = new UnifiedPaymentRequest();
$request->setVersion('3.0');
$request->setOutTradeNo($outTradeNo);
$request->setOrderInfo($orderInfo);
$request->setPayAmount($payAmount);
$request->setNotifyUrl($notifyUrl);
$request->setRedirectUrl($redirectUrl);
2 years ago
$request->setTransactionStartTime(date('YmdHis'));
$request->setAreaInfo([]);
$request->setNonceStr(StringHelper::getRandomString(32));
2 years ago
return self::request($request);
}
}