Download the PHP package yng/alipay-global without Composer

On this page you can find all versions of the php package yng/alipay-global. 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 alipay-global

PHP版支付宝国际版SDK

基于支付宝国际版PHP SDK 官方SDK主要展示如何访问支付宝网关,并无授权、自动借记等完整功能,因此我简单的优化部分接口,原接口保留,进一步实现了支付宝全球A+的标准接口,更加简单实用,如有不正确的还请提issue!

安装

文档

货币单位

MCC

支付方式表格中国家对应Enum value值

支付宝帮助

所有api数据字典(会有部分未更新)

配置问题

支付宝有沙盒工具可以测试,但是它们有版本区分,互不兼容,为了对应官方全球支付包所以这里使用国际版的沙盒,国内版就请参考国内版文档

国际版

国内版


merchantPrivateKey

merchantPrivateKey 商户私钥: 工具生成, 请自行保存好, 去掉头和尾, 只要中间那行代码

alipayPublicKey

alipayPublicKey 支付宝公钥: 沙盒首页 -> Integration Settings -> 找到Integration Information下面有个配置public key的按钮, 点击然后使用官方提供的工具生成公钥秘钥, 把工具生成的公钥复制到网页对应位置,提交后会有两个公钥, 一个是商户公钥一个支付宝公钥, 支付宝公钥是根据你提供的公钥生成的,所以配置里的支付宝公钥就是这里来的, 请自行保存好, 去掉头和尾, 只要中间那行代码

auth_client_id

auth_client_id 二级商家id: 如果是二级商户,需要填写此字段

client_id

client_id 客户端id: 沙盒首页的Client ID


生成RSA2工具

windows

mac


测试工具

文档地址

Android

IOS安装教程:

  1. 从App Store安装TestFlight。
  2. 使用 iPhone 浏览器打开此链接:https://testflight.apple.com/join/r1wEDEAS
  3. 单击“开始测试”开始测试。
  4. 在测试飞行中安装IAP_Wallet。

测试账号

账号 密码
[email protected] Alipay123
[email protected] Alipay123
[email protected] Alipay123

DEMO示例

只展示常用的授权,支付使用示例,所展示的示例里的参数全是基础必填参,可选参里的必填参请自行参考文档。

官方sdk或多或少存留着已删除的一些api或字段,请参考地址

支付宝官方原接口保留,如想使用官方php-sdk-api请自行参考github官方文档

所有model方法列表
方法名 描述
AuthConsult 授权
ApplyToken 申请token或刷新token
RevokeToken 撤销token令牌
ConsultPay 在线支付--查询支持支付的可选项
CreatePay 在线支付--创建支付订单
CapturePay 在线支付--付款请求
PayByDebit 在线支付--自动借记
PayEntryCode 店内支付--EntryCode模式
PayOrderCode 店内支付--OrderCode模式
PayPaymentCode 店内支付--PaymentCode模式
Declare 海关申报
CheckDeclareStatus 查询海关申报状态
Refund 退款(通用)
CheckRefundStatus 查询退款状态
RegisterMerchant 注册二级商家
CheckRegisterStatus 查询注册二级商家状态
CheckRegisterInfo 查询注册二级商家信息
授权
获取token或者刷新token
撤销授权令牌
在线支付---创建支付
取消支付
查询订单状态
在线支付--自动借记
店内支付---Entry Code

另外两种模式可能在order参数里的不一样,具体参考文档

退款
查询退款状态
FAQ
  1. 设置支付密码

  2. 设置支付密码是为了拿到md5 key或RSA2公钥, 官方建议使用RSA2方式签名, 新版无RSA, 只有RSA2

  3. 正式环境的就需要将配置里的进行替换, 秘钥公钥都不需要头部和尾部, 只需中间部分

  4. 沙盒配置的一定要使用沙盒的信息, 正式环境也一样, 不然会报签名失败或其他错误

  5. 在沙盒首页 -> 左侧边栏Development Tools, 只有部分api可测, 暂无验签工具, 需自行调试, 参考 https://global.alipay.com/docs/ac/ams/digital_signature

  6. 错误码看官方文档API最下面部分https://global.alipay.com/docs/ac/ams/api

  7. 如果报错信息为 Response signature verify fail. 说明你的商户私钥和支付宝公钥不匹配导致的,所以一定要配对,如第4点所说。

All versions of alipay-global with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
ext-curl Version *
ext-json Version *
ext-openssl Version *
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 yng/alipay-global contains the following files

Loading the files please wait ....