This commit is contained in:
xl
2023-11-14 00:15:27 +08:00
parent fbdbcbccd9
commit e721fe4f36
53 changed files with 1 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace wchat\wx\V3\Notify;
class GoodsDetail
{
public string $goods_remark = "商品备注信息";
public int $quantity = 1;
public int $discount_amount = 1;
public string $goods_id = "M1006";
public int $unit_price = 100;
/**
* @param array $value
*/
public function __construct(readonly public array $value)
{
$this->goods_remark = $this->value['goods_remark'];
$this->quantity = $this->value['quantity'];
$this->discount_amount = $this->value['discount_amount'];
$this->goods_id = $this->value['goods_id'];
$this->unit_price = $this->value['unit_price'];
}
}
+93
View File
@@ -0,0 +1,93 @@
<?php
namespace wchat\wx\V3\Notify;
use JetBrains\PhpStorm\ArrayShape;
class NotifyModel
{
//公众号支付
const PAY_TYPE_JSAPI = 'JSAPI';
//扫码支付
const PAY_TYPE_NATIVE = 'NATIVE';
//App支付
const PAY_TYPE_App = 'App';
//付款码支付
const PAY_TYPE_MICROPAY = 'MICROPAY';
//H5支付
const PAY_TYPE_MWEB = 'MWEB';
//刷脸支付
const PAY_TYPE_FACEPAY = 'FACEPAY';
// 支付成功
const PAY_RESULT_SUCCESS = 'SUCCESS';
// 转入退款
const PAY_RESULT_REFUND = 'REFUND';
// 未支付
const PAY_RESULT_NOTPAY = 'NOTPAY';
// 已关闭
const PAY_RESULT_CLOSED = 'CLOSED';
// 已撤销(付款码支付)
const PAY_RESULT_REVOKED = 'REVOKED';
// 用户支付中(付款码支付)
const PAY_RESULT_USERPAYING = 'USERPAYING';
// 支付失败(其他原因,如银行返回失败)
const PAY_RESULT_PAYERROR = 'PAYERROR';
public string $appid;
public string $mchid;
public string $out_trade_no;
public string $transaction_id;
public string $trade_type;
public string $trade_state;
public string $trade_state_desc;
public string $bank_type;
public string $attach;
public string $success_time;
/**
* @var array|string[]
*/
#[ArrayShape(['openid' => 'string'])]
public array $payer = ['openid' => ''];
/**
* @var array
*/
#[ArrayShape(['payer_total' => 'int', 'total' => 'int', 'currency' => 'string', 'payer_currency' => 'string'])]
public array $amount = [
"payer_total" => 100,
"total" => 100,
"currency" => "CNY",
"payer_currency" => "CNY"
];
/**
* @var array|string[]
*/
#[ArrayShape(['device_id' => 'string'])]
public array $scene_info = [
'device_id' => ''
];
/**
* @var array<PromotionDetail>
*/
public array $promotion_detail = [];
}
+23
View File
@@ -0,0 +1,23 @@
<?php
namespace wchat\wx\V3\Notify;
class PromotionDetail
{
public int $amount = 100;
public int $wechatpay_contribute = 0;
public string $coupon_id = "109519";
public string $scope = "GLOBAL";
public int $merchant_contribute = 0;
public string $name = "单品惠-6";
public int $other_contribute = 0;
public string $currency = "CNY";
public string $stock_id = "931386";
/**
* @var array<GoodsDetail>
*/
public array $goods_detail = [];
}