2017 © Pedro Peláez
 

library wx-pay-api

WXPay library build on office sdk

image

ouranoshong/wx-pay-api

WXPay library build on office sdk

  • Friday, May 18, 2018
  • by ouranoshong
  • Repository
  • 1 Watchers
  • 0 Stars
  • 87 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 18 Forks
  • 0 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

WXPayAPI

Build Status, (*1)

wxpay_v3 api library, (*2)

more detail see wx office document, (*3)

Usage

Installation

$ composer require ouranoshong/wx-pay-api

UnifiedOrderPay Api

$client = new \WXPay\WXPayClient();

$config = new \WXPay\WXPayConfig();

$config->appId = '';
$config->mchId = '';
$config->key = '';
$config->notifyUrl = '';

$request = new \WXPay\Request\UnifiedOrderRequest();

$request->setBody('');
$request->setOutTradeNo('');
$request->setTotalFee();
$request->setSpBillCreateIp('');
$request->setOpenid('');

// or set other api parameter
$request->setXXX();

$response = new \WXPay\Response\UnifiedOrderResponse();

$client->setConfiguration($config);

$client->setHandlerName(\WXPay\Handler\UnifiedOrderHandler::class);

$client->handle($request, $response);

// print all response default
var_dump(json_encode($response->getResult(), JSON_PRETTY_PRINT));

// get specify reponse message (in camlcase)
$response->getXXX();

Notify Entity

// don't check signature
$notify = \WXPay\WXPayNotify::createFromXml('<xml>...</xml>');

// check signature
$notify = \WXPay\WXPayNotify::createFromXml('<xml>...</xml>', 'key');

// get signature from wei xin server push
$notify->sign;

// get something else
$nofiy->getXXX();

Reply Entity

// reply success message to wx server
echo \WXPay\WXPayReply::createSuccessReply();

// reply fail messge to wx server
echo \WXPay\WXPayReply::createFailReply('fail message');

Functions

// sign `$data` with `$key` use md5
\WXPay\signature($data, $key);

// generate nonce string
\WXPay\generate_nonce_str($len);

// convert asocc array to xml
\WXPay\convert_arr_to_xml($arr);

// convert xml to asocc array
\WXPay\convert_xml_to_arr($xml);

The Versions

18/05 2018

dev-master

9999999-dev

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

by Avatar ouranoshong

sdk wx pay v3

15/03 2018

v0.4.6

0.4.6.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

08/03 2018

v0.4.5

0.4.5.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

07/12 2017

v0.4.4

0.4.4.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

07/12 2017

v0.4.3

0.4.3.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

06/12 2017

v0.4.2

0.4.2.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

16/10 2017

v0.4.1

0.4.1.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

19/06 2017

v0.4.0

0.4.0.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

19/06 2017

v0.2.1

0.2.1.0

WXPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong

sdk wx pay v3

16/06 2017

v0.2.0

0.2.0.0

WxPay library build on office sdk

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Avatar ouranoshong