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.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Helper\Efps;
|
|
|
|
|
|
|
|
use App\Helper\Efps\Request\UnifiedPaymentRequest;
|
|
|
|
use App\Helper\StringHelper;
|
|
|
|
|
|
|
|
class Api extends AbstractApi
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
$request->setTransactionStartTime(date('YmdHis'));
|
|
|
|
$request->setAreaInfo([]);
|
|
|
|
$request->setNonceStr(StringHelper::getRandomString(32));
|
|
|
|
return self::request($request);
|
|
|
|
}
|
|
|
|
}
|