{"id":18431266,"url":"https://github.com/zhan3333/alipay","last_synced_at":"2025-07-04T09:04:04.482Z","repository":{"id":57090556,"uuid":"83374195","full_name":"zhan3333/alipay","owner":"zhan3333","description":"个人使用的支付宝支付库","archived":false,"fork":false,"pushed_at":"2017-03-01T02:27:57.000Z","size":195,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T00:50:05.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhan3333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-28T01:13:42.000Z","updated_at":"2024-03-29T04:23:15.000Z","dependencies_parsed_at":"2022-08-22T20:40:24.736Z","dependency_job_id":null,"html_url":"https://github.com/zhan3333/alipay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhan3333/alipay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhan3333%2Falipay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhan3333%2Falipay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhan3333%2Falipay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhan3333%2Falipay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhan3333","download_url":"https://codeload.github.com/zhan3333/alipay/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhan3333%2Falipay/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263480854,"owners_count":23473162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:24:09.358Z","updated_at":"2025-07-04T09:04:04.408Z","avatar_url":"https://github.com/zhan3333.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 库目的\n1. 导入阿里支付宝新版sdk\n2. 增加一些配置入口，让配置更简单\n3. 添加example示例\n\n# 配置文件\n```php\n\u003c?php\nreturn [\n    // 通用配置\n    'signType' =\u003e 'RSA2',\n\n    // 配置\n    \n    // 异步通知地址\n//    'notifyUrl' =\u003e 'https://local.ykxing.com/zhan/yiyuan/AliPay_notify',\n    // 支付宝提供的appId\n//    'appId' =\u003e '2017021705720667'\n    // rsa签名验证的私钥地址\n//    'rsaPrivateKey' =\u003e file_get_contents(__DIR__ . '/key/rsa_private_key'),\n    // 支付宝提供的公钥地址\n//    'rsaAliPubPath' =\u003e file_get_contents(__DIR__ . '/key/ali_pay_rsa_public_key'),\n\n    // 沙箱配置\n    'notifyUrl' =\u003e 'https://local.ykxng.com/zhan/zhan/example/notify.php',\n    'appId' =\u003e '2016080100139922',\n    'getewayUrl' =\u003e 'https://openapi.alipaydev.com/gateway.do',\n    'rsaPrivateKey' =\u003e file_get_contents(__DIR__ . '/sandboxKey/rsa_private_key'),\n    'rsaAliPubPath' =\u003e file_get_contents(__DIR__ . '/sandboxKey/ali_pay_rsa_public_key'),\n];\n```\n\n# 创建订单\n```php\n\u003c?php\nrequire_once '../vendor/autoload.php';\n\n$aliConfig = require_once 'alipayConfig.php';           // 配置文件\n$payment = new \\Payment\\Payment($aliConfig);            // 获取payment对象\n$bizcontent = new \\Payment\\Common\\AliPayBizContent([    // 设置一些订单属性\n    'out_trade_no' =\u003e (string)time(),\n    'total_amount' =\u003e '0.01',\n    'subject' =\u003e '测试商品',\n    'timeout_express' =\u003e '30m',\n    'body' =\u003e '我是测试数据'\n]);\n$order = $payment-\u003egetPayOrder($bizcontent);        // 获取订单信息返回前端\necho $order;\n```\n\n# 接收支付宝异步回调数据\n```php\n\u003c?php\nrequire '../vendor/autoload.php';\nuse Monolog\\Logger;\nuse Monolog\\Handler\\StreamHandler;\n\n$log = new Logger('name');\n$log-\u003epushHandler(new StreamHandler(__DIR__ . '/log/notify.log'));\n\n$aop = new \\Payment\\api\\AopClient();\n$aop-\u003ealipayrsaPublicKey = file_get_contents(__DIR__ . '/key/ali_pay_rsa_public_key');\n$log-\u003edebug('11', []);\n$flag = $aop-\u003ersaCheckV2($_POST, null, 'RSA2'); // 签名验证\n$log-\u003edebug('post data', ['flag' =\u003e $flag, 'POST' =\u003e $_POST]);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhan3333%2Falipay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhan3333%2Falipay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhan3333%2Falipay/lists"}