|
|
|
|
@ -15,7 +15,7 @@ class AlipayF2F
|
|
|
|
|
$auth_code = request()->auth_code;
|
|
|
|
|
$config = $this->getOptions();
|
|
|
|
|
Log::info((array)$config);
|
|
|
|
|
$result = Factory::setOptions($config)::payment()->faceToFace()->pay("TestGoods", time(), "0.1", $auth_code);
|
|
|
|
|
$result = Factory::setOptions($config)::payment()->faceToFace()->pay("TestGoods", time(), 0.1, $auth_code);
|
|
|
|
|
$responseChecker = new ResponseChecker();
|
|
|
|
|
//处理响应或异常
|
|
|
|
|
if ($responseChecker->success($result)) {
|
|
|
|
|
@ -48,15 +48,15 @@ class AlipayF2F
|
|
|
|
|
$options->signType = 'RSA2';
|
|
|
|
|
|
|
|
|
|
// 为避免私钥随源码泄露,推荐从文件中读取私钥字符串而不是写入源码中
|
|
|
|
|
$options->merchantPrivateKey = env("ALI_PRIVATE_KEY");
|
|
|
|
|
$options->merchantPrivateKey = env("ALI_MERCHANT_KEY");
|
|
|
|
|
|
|
|
|
|
$options->appId = env("ALI_APP_ID");
|
|
|
|
|
$options->alipayCertPath = env("ALI_CERT_ALIPAY");
|
|
|
|
|
$options->alipayRootCertPath = env("ALI_CERT_ROOT");
|
|
|
|
|
$options->merchantCertPath = env("ALI_CERT_APP");
|
|
|
|
|
//$options->alipayCertPath = env("ALI_CERT_ALIPAY");
|
|
|
|
|
//$options->alipayRootCertPath = env("ALI_CERT_ROOT");
|
|
|
|
|
//$options->merchantCertPath = env("ALI_CERT_APP");
|
|
|
|
|
|
|
|
|
|
//注:如果采用非证书模式,则无需赋值上面的三个证书路径,改为赋值如下的支付宝公钥字符串即可
|
|
|
|
|
//$options->alipayPublicKey = env("ALI_PUBLIC_KEY");
|
|
|
|
|
$options->alipayPublicKey = env("ALI_ALIPAY_KEY");
|
|
|
|
|
|
|
|
|
|
//可设置异步通知接收服务地址(可选)
|
|
|
|
|
$options->notifyUrl = "";
|
|
|
|
|
|