1. Go to this page and download the library: Download gaemma/alipay library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gaemma / alipay example snippets
use Gaemma\Alipay\Signer\MD5Signer;
$md5Signer = new MD5Signer('a2d9bm4jfk0slemvpaq23');
$alipay->addSigner($md5Signer);
use Gaemma\Alipay\Signer\RSASigner;
$rsaSigner = new RSASigner(__DIR__ . '/my_private_key', __DIR__ . '/alipay_pub_key');
$alipay->addSigner($rsaSigner);
use Gaemma\Alipay\Alipay;
use Gaemma\Alipay\Signer\SignerInterface;
// 生成 Alipay 实例,签名方式包括`md5`和`rsa`,默认`md5`方式签名
$alipay = Alipay::create('2008...', [$md5Signer, $rsaSigner], SignerInterface::TYPE_MD5);