Code Monkey home page Code Monkey logo

alipay-sdk-php-2's Introduction

Alipay SDK for PHP

Build Status StyleCI Scrutinizer Code Quality Code Coverage Latest Stable Version Latest Unstable Version Total Downloads License FOSSA Status

📦 接入支付宝最新接口完成的扩展包,简化对接支付宝接口的操作,让代码看起更清晰。sdk还会自动记录每次请求支付宝网关的request和response的参数日志。自动校验返回值等...

说明

  • 在使用SDK之前请确认你已经仔细阅读了:支付宝开放平台文档

  • 在使用中出现问题,那么可以在这里提问 Issues

  • 欢迎 Star,欢迎 PR!

运行环境

  • PHP 7.0+
  • composer
  • openssl 拓展

开发工具

PhpStorm

安装

composer require wannanbigpig/alipay-sdk-php

使用

use EasyAlipay\Alipay;

// 配置(包含支付宝的公共配置,日志配置,http配置等)
$config = [
    'sys_params' => [
        'app_id' => '888888888888888',
        'notify_url' => 'http://alipay.docs.wannanbigpig.com/',
        'return_url' => 'http://alipay.docs.wannanbigpig.com/',
    ],
    'private_key_path' => STORAGE_ROOT.'private_key.pem',
    'alipay_public_Key_path' => STORAGE_ROOT.'alipay_public_key.pem',
];

$app = Alipay::payment($config);

// 当面付 统一收单交易支付接口
$response = $app->pay([
    'out_trade_no' => \WannanBigPig\Supports\Str::getRandomInt(),
    'scene' => 'bar_code',
    'auth_code' => '283867319836385922',
    'subject' => 'ceshiapi',
    'total_amount' => '100',
]);

if($response['code'] === '10000'){
    echo $response['trade_no'];    // 2019072722001491681000180973
}

更多请参考:详细开发文档

代码贡献

目前只对接各类支付,资金预授权等相关接口。如果您有其它支付宝相关接口的需求,或者发现本项目中需要改进的代码,欢迎 Fork 并提交 PR!

LICENSE

MIT

FOSSA Status

alipay-sdk-php-2's People

Contributors

fossabot avatar liumenglei avatar wannanbigpig avatar

Watchers

 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.