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

97 lines
4.3 KiB
PHP

<?php
namespace App\Helper\Baofu;
use Exception;
class NotifyList
{
private static $list = [
'apply-auth' => [
'description' => '企业实名开户-小额鉴权',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo|customerName|email|mobile|authFlag'
],
'apply-open-card' => [
'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',
],
'card-bind' => [
'description' => '绑卡(H5/API)',
'signParams' => 'orgNo|merchantNo|terminalNo|contractNo|loginNo|bindCardFlag',
],
'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',
],
'enterprise-withdraw' => [
'description' => '企业提现(API)',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|orderStatus|loginId|finishTime',
],
'confirm-split' => [
'description' => '确认分账',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|subOutOrderNo|orderStatus|loginId|finishTime|confirmType',
],
'confirm-escrow-split' => [
'description' => '自助交易确认分账',
'signParams' => 'orgNo|merchantNo|terminalNo|tradeId|subOutOrderNo|orderStatus|loginId|finishTime|confirmType',
],
'refund' => [
'description' => '退款',
'signParams' => 'orgNo|merchantNo|terminalNo|refundOrderId|refundTradeId|refundMoney|refundStatus|refundSuccTime|refundType|errorMsg',
],
'escrow-refund' => [
'description' => '退款',
'signParams' => 'orgNo|merchantNo|terminalNo|refundOrderId|refundTradeId|refundMoney|refundStatus|refundSuccTime|refundType|errorMsg',
],
'unify-refund' => [
'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',
],
'escrow-payment' => [
'description' => '自助交易支付',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|loginId|finishTime|orderId|errorMsg',
],
'unify-payment' => [
'description' => '匿名支付',
'signParams' => 'orgNo|merchantNo|terminalNo|orderStatus|tradeId|paidType|orderMoney|finishTime|orderId|errorMsg',
],
'enterprise-unbind-card' => [
'description' => '企业对公卡解绑',
'signParams' => 'orgNo|merchantNo|terminalNo|loginNo|noticeType|successFlag|agreementNo'
],
'apply-bind-card' => [
'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('回调不存在');
}
return env('WEB_HOST') . '/notify/' . ($notifyItem['url'] ?? $notifyName) . '/' . $token;
}
}