You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
2.9 KiB

5 years ago
<?php
require __DIR__.'/../vendor/autoload.php';
use EasyAlipay\Factory;
$options = [
5 years ago
'app_id' => '2018070360570197',
5 years ago
'gateway_url' => "https://openapi.alipaydev.com/gateway.do",//示例中使用的是沙箱环境网关,线上gateway_url:https://openapi.alipay.com/gateway.do
5 years ago
'sign_type' => "RSA2",
'encrypt_key' =>'oZXL/lMFlvG818o1jbgM2w==',
'response_type' => 'collection',
'alipay_public_key' => 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsDos+q5ZZa2JWtNLNluV8R6WqJSPUcJ39HpflCb8AEpSLTcjxsWG0RG3nvv7xBAHEOSRET8dTKPoWZXy1TAstv7WY4epiWZwogRzpNEPRbKyEBmbzkiOENW/27IdD6GFQ6e+MPE/BOPqd+hjR5SFghrQNpwZECWuCDFpsJq9G7EtTBUB1av52o/wYqWU1eCeUq+3MrtAD7p0Sh2V/B9jdmkpZhwGI/yHL23MHJI5J2aCNCfEQF520IHwHELrIq7xRv2hVE53APB/dueTTsIKNIWnbA8QbK3MUOgykG80UVxtZMl14Y3eB7RyzY70I5NimszSTSG6OQ2P78PMZjd77wIDAQAB',
'merchant_private_key' => 'MIIEogIBAAKCAQEAi6lTghhlFBWvrp3hjxzdr4+tUaeDbAilxjOsyCWCfmDdqP7vypN1ZFphJwRx41639/VEpMxe7yMoUwVJPR7VpmWCm1V/sfExU+9pBAtVrGRUZLwS+dkB9vlEH9dYRjeMOmw4hXvf9X9JlQEpH4HkHpE5BjVk1OexY9zwzfoa0lV8uDId/vxYoRpSU9Hm8CdgZMySizrEicD+5isBiad8uKIZ3fPRb9v60L7xL1LuaCjyY2t8BehscI4cND1D5BQZyqkXY19a4qD5zYjRRK26jOYxu5X/jIREK9SYjb5n3b6G8/NU1zMO5vQA8wkqjMLi1xj+Zla2Qlx3Qth5docPwQIDAQABAoIBAHhmJxm2U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m8MIbFdOKykd4aqHiSE15kmJDsmKoFedlOZYXKqm+bA+kii2AKokrnd1H+I2xnqZnZWMB64bHwPZQA9fIPpvyvHgXYY9bxp4oAMHPwrvbY2nRpplO3Jz7Oax2LFBBLBQY=',
5 years ago
// ...
];
//本测试用例提供的是沙箱环境的配置信息,线上调用请更改为自己应用对应的信息
//app_id,alipay_public_key(支付宝公钥),merchant_private_key(应用私钥)为必填项
//gateway_url不设置就默认线上网关
//sign_type 不设置就默认RSA2(目前线上环境支持RSA)
//charset 不设置就默认UTF-8
//接口测试用例
$app = Factory::payment($options);
5 years ago
5 years ago
var_dump($app['query']->query("1561946980099_demo_pay"));