toParams(); $result = $this->post('/api/hfpwallet/pay033', $params); if (!$result->isSuccess()) { return null; } return UnifiedOrder::make($result->getBody()); } /** * 延时分账确认 * * @param DelayDivideRequest $request * * @return DelayDivide|null * @throws ParamsException * * @see https://hfpay.cloudpnr.com/customers/nft/#/transaction/delayDivideConfirm */ function delayDivideConfirm(DelayDivideRequest $request): ?DelayDivide { $params = $request->toParams(); $result = $this->post('/api/hfpwallet/pay033', $params); if (!$result->isSuccess()) { return null; } return DelayDivide::make($result->getBody()); } /** * 关闭订单 * * @param string $orderId * @param string $orderDate * @param string $merPriv * * @return CloseOrder|null * * @see https://hfpay.cloudpnr.com/customers/nft/#/transaction/closeOrder */ function closeOrder(string $orderId, string $orderDate, string $merPriv = ''): ?CloseOrder { $params = [ 'order_id' => $orderId, 'order_date' => $orderDate, ]; if (!empty($merPriv)) { $params['mer_priv'] = $merPriv; } $result = $this->post('/api/hfpwallet/pay034', $params); if (!$result->isSuccess()) { return null; } return CloseOrder::make($result->getBody()); } /** * 退款 * * @param RefundRequest $request * * @return RefundInfo|null * @throws ParamsException * * @see https://hfpay.cloudpnr.com/customers/nft/#/transaction/refund */ function refund(RefundRequest $request): ?RefundInfo { $params = $request->toParams(); $result = $this->post('/api/hfpay/reb001', $params); if (!$result->isSuccess()) { return null; } return RefundInfo::make($result->getBody()); } /** * 退货 * * @param RefundGoodsRequest $request * * @return RefundGoodsResponse|null * @throws ParamsException * * @see https://hfpay.cloudpnr.com/customers/nft/#/transaction/refundGoods */ function refundGoods(RefundGoodsRequest $request): ?RefundGoodsResponse { $params = $request->toParams(); $result = $this->post('/api/hfpay/reb002', $params); if (!$result->isSuccess()) { return null; } return RefundGoodsResponse::make($result->getBody()); } /** * 取现 * * @param WithdrawCashRequest $request * * @return WithdrawCashResponse|null * @throws ParamsException * * @see https://hfpay.cloudpnr.com/customers/nft/#/transaction/withdrawCash */ function withdrawCash(WithdrawCashRequest $request): ?WithdrawCashResponse { $params = $request->toParams(); $result = $this->post('/api/acou/cash01', $params); if (!$result->isSuccess()) { return null; } return WithdrawCashResponse::make($result->getBody()); } }