GET
GET = 'get'
Class API.
$http : \EasyWeChat\Core\Http
Http instance.
$accessToken : \EasyWeChat\Core\AccessToken
The request token.
$merchant : \EasyWeChat\Payment\Merchant
Merchant instance.
$cache : \Doctrine\Common\Cache\Cache
Cache.
__construct(\EasyWeChat\Payment\Merchant $merchant, \Doctrine\Common\Cache\Cache|null $cache = null)
API constructor.
\EasyWeChat\Payment\Merchant | $merchant | |
\Doctrine\Common\Cache\Cache|null | $cache |
getHttp() : \EasyWeChat\Core\Http
Return the http instance.
setHttp(\EasyWeChat\Core\Http $http) : $this
Set the http instance.
\EasyWeChat\Core\Http | $http |
getAccessToken() : \EasyWeChat\Core\AccessToken
Return the current accessToken.
setAccessToken(\EasyWeChat\Core\AccessToken $accessToken) : $this
Set the request token.
\EasyWeChat\Core\AccessToken | $accessToken |
parseJSON(string $method, array $args) : \EasyWeChat\Support\Collection
Parse JSON from response and check error.
string | $method | |
array | $args |
pay(\EasyWeChat\Payment\Order $order) : \EasyWeChat\Support\Collection
Pay the order.
\EasyWeChat\Payment\Order | $order |
prepare(\EasyWeChat\Payment\Order $order) : \EasyWeChat\Support\Collection
Prepare order to pay.
\EasyWeChat\Payment\Order | $order |
query(string $orderNo, string $type = self::OUT_TRADE_NO) : \EasyWeChat\Support\Collection
Query order.
string | $orderNo | |
string | $type |
queryByTransactionId(string $transactionId) : \EasyWeChat\Support\Collection
Query order by transaction_id.
string | $transactionId |
close( $tradeNo) : \EasyWeChat\Support\Collection
Close order by out_trade_no.
$tradeNo |
reverse(string $orderNo, string $type = self::OUT_TRADE_NO) : \EasyWeChat\Support\Collection
Reverse order.
string | $orderNo | |
string | $type |
reverseByTransactionId(integer $transactionId) : \EasyWeChat\Support\Collection
Reverse order by transaction_id.
integer | $transactionId |
refund(string $orderNo, string $refundNo, float $totalFee, float $refundFee = null, string $opUserId = null, string $type = self::OUT_TRADE_NO, string $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS', string $refundReason = '') : \EasyWeChat\Support\Collection
Make a refund request.
string | $orderNo | |
string | $refundNo | |
float | $totalFee | |
float | $refundFee | |
string | $opUserId | |
string | $type | |
string | $refundAccount | |
string | $refundReason |
refundByTransactionId(string $orderNo, string $refundNo, float $totalFee, float $refundFee = null, string $opUserId = null, string $refundAccount = 'REFUND_SOURCE_UNSETTLED_FUNDS', string $refundReason = '') : \EasyWeChat\Support\Collection
Refund by transaction id.
string | $orderNo | |
string | $refundNo | |
float | $totalFee | |
float | $refundFee | |
string | $opUserId | |
string | $refundAccount | |
string | $refundReason |
queryRefund(string $orderNo, string $type = self::OUT_TRADE_NO) : \EasyWeChat\Support\Collection
Query refund status.
string | $orderNo | |
string | $type |
queryRefundByRefundNo(string $refundNo) : \EasyWeChat\Support\Collection
Query refund status by out_refund_no.
string | $refundNo |
queryRefundByTransactionId(string $transactionId) : \EasyWeChat\Support\Collection
Query refund status by transaction_id.
string | $transactionId |
queryRefundByRefundId(string $refundId) : \EasyWeChat\Support\Collection
Query refund status by refund_id.
string | $refundId |
downloadBill(string $date, string $type = self::BILL_TYPE_ALL) : \Psr\Http\Message\ResponseInterface
Download bill history as a table file.
string | $date | |
string | $type |
urlShorten(string $url) : \EasyWeChat\Support\Collection
Convert long url to short url.
string | $url |
report(string $api, integer $timeConsuming, string $resultCode, string $returnCode, array $other = array()) : \EasyWeChat\Support\Collection
Report API status to WeChat.
string | $api | |
integer | $timeConsuming | |
string | $resultCode | |
string | $returnCode | |
array | $other | ex: err_code,err_code_des,out_trade_no,user_ip... |
authCodeToOpenId(string $authCode) : \EasyWeChat\Support\Collection
Get openid by auth code.
string | $authCode |
setMerchant(\EasyWeChat\Payment\Merchant $merchant) : $this
Merchant setter.
\EasyWeChat\Payment\Merchant | $merchant |
getMerchant() : \EasyWeChat\Payment\Merchant
Merchant getter.
getCache() : \Doctrine\Common\Cache\Cache
Return the cache manager.
request(string $api, array $params, string $method = 'post', array $options = array(), boolean $returnResponse = false) : \EasyWeChat\Support\Collection|\Psr\Http\Message\ResponseInterface
Make a API request.
string | $api | |
array | $params | |
string | $method | |
array | $options | |
boolean | $returnResponse |
safeRequest(string $api, array $params, string $method = 'post') : \EasyWeChat\Support\Collection
Request with SSL.
string | $api | |
array | $params | |
string | $method |
parseResponse(\Psr\Http\Message\ResponseInterface $response) : \EasyWeChat\Support\Collection
Parse Response XML to array.
\Psr\Http\Message\ResponseInterface | $response |