Download the PHP package itc/weixin-payment without Composer

On this page you can find all versions of the php package itc/weixin-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package weixin-payment

weixin-payment

WeChat payment client library for PHP 5.5+

Build Status

Features

What it does (and doesn't)

The client exposes a simple programming interface to WeChat's payment-related web service calls. It transparently handles boilerplate stuff like request signing and XML serialization so you can focus on things that matter.

This package does not perform authentication; it will not help you get a user's OpenID. Fortunately, there are plenty of other packages that already do this. overtrue/wechat is a pretty good one.

Usage

Create a Client instance

Start a payment

The $jsbridge_params object can then be JSON-serialized and supplied directly to the WeixinJSBridge global in the Javascript space. Here's an example:

Messages

This library represents XML payloads transported between the client and the WeChat web service as messages. A Message is an object that:

How to create a Message instance

How to add message attributes

How to convert a message to XML

How to sign a message

How to authenticate a signed message

Generally, whenever you execute a Command (see below), you will want to authenticate the result:

Commands

The various web service calls to the payment API are commands. A Command is an object that has an execute method which returns a Message.

Installation

Composer

composer require itc/weixin-payment:1.3.0

Laravel

The package ships with a Laravel 5 service provider that registers the Client on the application service container. Install the service provider by adding the following line to the providers array in config/app.php:

ITC\Weixin\Payment\ServiceProvider::class

Then publish the package configuration via:

php artisan vendor:publish

Now you can access the client instance via dependency injection or through the service container:

Contributing

Feel free to fork this project and create a pull request!

How to implement a Command

  1. Implement a concrete ITC\Weixin\Payment\Contracts\Command. Feel free to extend ITC\Weixin\Payment\Command\Command.

  2. Register the command inside Client::instance():

How to run tests

./phpunit

License

MIT


All versions of weixin-payment with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.0
psr/log Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package itc/weixin-payment contains the following files

Loading the files please wait ....