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/Baofu/NotifyList.php

102 lines
4.5 KiB
PHTML

1 year ago
<?php
namespace App\Helper\Baofu;
use Exception;
class NotifyList
{
private static $list = [
1 year ago
'apply-auth' => [
1 year ago
'description' => '企业实名开户-小额鉴权',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo|customerName|email|mobile|authFlag'
],
1 year ago
'apply-open-card' => [
1 year ago
'description' => '企业实名开户-小额打款',
'signParams' => 'orgNo|merchantNo|terminalNo|loginNo|applyNo|noticeType|successFlag'
],
'apply' => [
'description' => '企业实名开户成功通知(待激活)',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo|customerName|email|mobile'
],
'register' => [
'description' => '注册(H5)',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo',
],
1 year ago
'card-bind' => [
1 year ago
'description' => '绑卡(H5/API)',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo|bindCardFlag',
1 year ago
'url' => 'bind-card',
1 year ago
],
'recharge' => [
'description' => '个人充值(API)',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|loginId|finishTime|orderId|errorMsg',
],
'withdraw' => [
'description' => '个人提现(API)',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|loginId|finishTime|orderId|errorMsg',
],
1 year ago
'enterprise-withdraw' => [
1 year ago
'description' => '企业提现(API)',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|orderStatus|loginId|finishTime',
],
1 year ago
'confirm-split' => [
1 year ago
'description' => '确认分账',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|subOutOrderNo|orderStatus|loginId|finishTime|confirmType',
],
1 year ago
'confirm-escrow-split' => [
1 year ago
'description' => '自助交易确认分账',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|subOutOrderNo|orderStatus|loginId|finishTime|confirmType',
],
1 year ago
'confirm-assure-portfolio-pay' => [
'description' => '确认分账',
1 year ago
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|subOutOrderNo|orderStatus|loginId|finishTime|confirmType',
1 year ago
],
1 year ago
'refund' => [
'description' => '退款',
'signParams' => 'orgNo|merchantNo|terminalNo|refundOrderId|refundTradeId|refundMoney|refundStatus|refundSuccTime|refundType|errorMsg',
],
1 year ago
'escrow-refund' => [
1 year ago
'description' => '退款',
'signParams' => 'orgNo|merchantNo|terminalNo|refundOrderId|refundTradeId|refundMoney|refundStatus|refundSuccTime|refundType|errorMsg',
],
1 year ago
'unify-refund' => [
1 year ago
'description' => '匿名支付退款',
'signParams' => 'orgNo|merchantNo|terminalNo|refundOrderId|refundTradeId|refundMoney|refundStatus|refundSuccTime|refundType|errorMsg',
],
'payment' => [
'description' => '支付',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|loginId|finishTime|orderId|errorMsg',
],
1 year ago
'escrow-payment' => [
1 year ago
'description' => '自助交易支付',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|loginId|finishTime|orderId|errorMsg',
],
1 year ago
'unify-payment' => [
1 year ago
'description' => '匿名支付',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|finishTime|orderId|errorMsg',
],
1 year ago
'enterprise-unbind-card' => [
1 year ago
'description' => '企业对公卡解绑',
'signParams' => 'orgNo|merchantNo|terminalNo|loginNo|noticeType|successFlag|agreementNo'
],
1 year ago
'apply-bind-card' => [
1 year ago
'description' => '企业对公卡绑定',
'signParams' => 'orgNo|merchantNo|terminalNo|loginNo|applyNo|noticeType|successFlag'
]
];
public static function get($notifyName)
{
return self::$list[$notifyName] ?: null;
}
public static function getNotifyUrl($notifyName, $token)
{
$notifyItem = self::get($notifyName);
if (is_null($notifyItem)) {
throw new Exception('回调不存在');
}
1 year ago
return env('WEB_HOST') . '/notify/' . ($notifyItem['url'] ?? $notifyName) . '/' . $token;
1 year ago
}
}