WeChatDeveloper/AliPay/Transfer.php

79 lines
2.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | WeChatDeveloper
// +----------------------------------------------------------------------
// | 版权所有 2014~2026 ThinkAdmin [ thinkadmin.top ]
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/WeChatDeveloper
// | github 代码仓库https://github.com/zoujingli/WeChatDeveloper
// +----------------------------------------------------------------------
namespace AliPay;
use WeChat\Contracts\BasicAliPay;
/**
* 支付宝转账到账户
* @package AliPay
*/
class Transfer extends BasicAliPay
{
/**
* 旧版向支付宝账户转账toaccount.transfer
* @param array $options 转账参数out_biz_no, payee_type, payee_account, amount, remark 等)
* @return array|bool 转账结果
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function apply($options)
{
$this->options->set('method', 'alipay.fund.trans.toaccount.transfer');
return $this->getResult($options);
}
/**
* 新版统一转账接口uni.transfer
* @param array $options 转账参数out_biz_no, trans_amount, product_code, payee_info 等)
* @return array|bool 转账结果
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function create($options = [])
{
$this->options->set('method', 'alipay.fund.trans.uni.transfer');
return $this->getResult($options);
}
/**
* 新版:转账业务单据查询
* @param array $options 查询参数out_biz_no 或 order_id
* @return array|bool 查询结果
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function queryResult($options = [])
{
$this->options->set('method', 'alipay.fund.trans.common.query');
return $this->getResult($options);
}
/**
* 新版:资金账户余额查询
* @param array $options 查询参数alipay_user_id 或 user_id可选 account_type
* @return array|bool 账户余额等信息
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function queryAccount($options = [])
{
$this->options->set('method', 'alipay.fund.account.query');
return $this->getResult($options);
}
}