Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php // +---------------------------------------------------------------------- // | WeC..
Decoded Output download
<?php
// +----------------------------------------------------------------------
// | WeChatDeveloper
// +----------------------------------------------------------------------
// | 2014~2024 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 WePay;
use WeChat\Contracts\BasicWePay;
use WeChat\Contracts\Tools;
use WeChat\Exceptions\InvalidDecryptException;
use WeChat\Exceptions\InvalidResponseException;
/**
*
* Class Refund
* @package WePay
*/
class Refund extends BasicWePay
{
/**
*
* @param array $options
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function create(array $options)
{
$url = 'https://api.mch.weixin.qq.com/secapi/pay/refund';
return $this->callPostApi($url, $options, true);
}
/**
*
* @param array $options
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function query(array $options)
{
$url = 'https://api.mch.weixin.qq.com/pay/refundquery';
return $this->callPostApi($url, $options);
}
/**
*
* @param string $xml
* @return array
* @throws \WeChat\Exceptions\InvalidDecryptException
* @throws \WeChat\Exceptions\InvalidResponseException
*/
public function getNotify($xml = '')
{
$data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml);
if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS') {
throw new InvalidResponseException('XML');
}
try {
$key = md5($this->config->get('mch_key'));
$decrypt = base64_decode($data['req_info']);
$response = openssl_decrypt($decrypt, 'aes-256-ecb', $key, OPENSSL_RAW_DATA);
$data['result'] = Tools::xml2arr($response);
return $data;
} catch (\Exception $exception) {
throw new InvalidDecryptException($exception->getMessage(), $exception->getCode());
}
}
} ?>
Did this file decode correctly?
Original Code
<?php
// +----------------------------------------------------------------------
// | WeChatDeveloper
// +----------------------------------------------------------------------
// | 2014~2024 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 WePay;
use WeChat\Contracts\BasicWePay;
use WeChat\Contracts\Tools;
use WeChat\Exceptions\InvalidDecryptException;
use WeChat\Exceptions\InvalidResponseException;
/**
*
* Class Refund
* @package WePay
*/
class Refund extends BasicWePay
{
/**
*
* @param array $options
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function create(array $options)
{
$url = 'https://api.mch.weixin.qq.com/secapi/pay/refund';
return $this->callPostApi($url, $options, true);
}
/**
*
* @param array $options
* @return array
* @throws \WeChat\Exceptions\InvalidResponseException
* @throws \WeChat\Exceptions\LocalCacheException
*/
public function query(array $options)
{
$url = 'https://api.mch.weixin.qq.com/pay/refundquery';
return $this->callPostApi($url, $options);
}
/**
*
* @param string $xml
* @return array
* @throws \WeChat\Exceptions\InvalidDecryptException
* @throws \WeChat\Exceptions\InvalidResponseException
*/
public function getNotify($xml = '')
{
$data = Tools::xml2arr(empty($xml) ? Tools::getRawInput() : $xml);
if (!isset($data['return_code']) || $data['return_code'] !== 'SUCCESS') {
throw new InvalidResponseException('XML');
}
try {
$key = md5($this->config->get('mch_key'));
$decrypt = base64_decode($data['req_info']);
$response = openssl_decrypt($decrypt, 'aes-256-ecb', $key, OPENSSL_RAW_DATA);
$data['result'] = Tools::xml2arr($response);
return $data;
} catch (\Exception $exception) {
throw new InvalidDecryptException($exception->getMessage(), $exception->getCode());
}
}
}
Function Calls
None |
Stats
MD5 | b0dda904fe1cacf0a573cd24ab74d74e |
Eval Count | 0 |
Decode Time | 80 ms |