PHP code example of lvdengxia / wechatpaypoint

1. Go to this page and download the library: Download lvdengxia/wechatpaypoint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lvdengxia / wechatpaypoint example snippets




use WxPayPoint\Request\WxPayPointRequest;

$config = [
	'appid'       => 'wx0f3a4b0dcafxxxx',//公众账号ID
	'mch_id'      => '157952xxxx',   //支付商户号
	'service_id'  => '0000200000000015984369xxxxxxxxxx',//服务ID
	'key'         => '009DA8BDD9A5AECFED72F3xxxxxxxxxx',//支付key
	'v3key'       => '1BA00441A40AD15D1D2C54xxxxxxxxxx',//支付v3key
	'serial_no'   => '3F389F9F2D414CF22E156Dxxxxxxxxxxxxxxxxx',//证书序号
	'private_key' => '/cert/apiclient_key.pem',//证书
	'public_key'  => '/cert/apiclient_cert.pem',
];

$app = WxPayPointRequest::getInstance( $config );


$param = [
	'out_order_no'         => '202009171036252525',
	'service_introduction' => '租借飞机服务',
	'time_range'           => [
		'start_time' => date( "YmdHis" )
	],
	'risk_fund'            => [
		'name'   => 'DEPOSIT',
		'amount' => 9900,
	],
	'notify_url'           => 'https://www.baidu.com'
];
$data = $app->createBill($param);

$data = $app->directComplete($param);

$data = $app->userServiceState($param);

$data = $app->terminate($param);

$data = $app->permission($param);

$data = $app->authCodePermission($param);

$data = $app->authCodeTerminate($param);

$data = $app->openidPermission($param);

$data = $app->openidTerminate($param);

$data = $app->createBill($param);

$data = $app->queryBill($param);

$data = $app->cancelBill($param);

$data = $app->modifyBill($param);

$data = $app->completeBill($param);

$data = $app->payBill($param);

$data = $app->syncBill($param);

$data = $app->applyRefund($param);

$data = $app->queryRefund($param);

$data=NotifyHandle::notifyDecode($associatedData, $nonce, $ciphertext, $v3key);

#成功
return NotifyHandle::sendSuccessReturn();
#失败
return NotifyHandle::sendFailReturn("FAIL","ORDER_ERROR");