Giter VIP home page Giter VIP logo

wxpay-php's Introduction

wxpay-php

php项目基于微信支付JS SDK和JS API的接入开发


前言

因为抢红包风波,微信封杀了支付宝链接,不得不紧急加入微信支付。

微信支付的开发文档太坑,不才已被虐哭,趁现在还在坑里,记录一下留个纪念。

开发相关资料(排名不分先后)

注意点

  • 微信大小写非常敏感,timestamp和timeStamp以及appId和appid不要弄错,要在对的接口使用对的大小写,里面是混着用的。

  • 商户号和微信商户号要区分出来,也就是MCHID

分享代码

因为目前用的项目的框架是比较奇葩的,我之前已经把官方的代码临时整合并修改成适合项目的代码,不能直接用了,后面的日子将逐步等工作闲暇的时候,整理出直接能用的来分享给还没入坑有需要的童鞋们。


代码相关

开发环境

本地相关开发环境如下:

  • 编辑器: MacVim

  • php: 5.5.13,接入微信支付的相关扩展都装了,主要应该是curl扩展

  • nginx: 1.4.2

  • 操作系统: Yosemite 10.0.2

创建相关文件

WxPay.pub.config.sample.php => WxPay.pub.config.php // 配置文件
access_token.sample.json => access_token.json       // 临时存储access_token
jsapi_ticket.sample.json => jsapi_ticket.json       // 临时存储jsapi_ticket

代码文件结构

.
├── LICENSE
├── README.md
├── conf
│   ├── WxPay.pub.config.php
│   └── WxPay.pub.config.sample.php
├── index.php
├── lib
│   ├── CommonUtilPub.php
│   ├── JsSdk.php
│   ├── SDKRuntimeException.php
│   ├── UnifiedOrderPub.php
│   └── WxpayClientPub.php
└── log
    ├── access_token.json
    ├── access_token.sample.json
    ├── jsapi_ticket.json
    └── jsapi_ticket.sample.json

3 directories, 14 files

wxpay-php's People

Contributors

biangbiang avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.