瀏覽代碼

update

master
DengBiao 11 月之前
父節點
當前提交
89941dfc75
共有 2 個文件被更改,包括 41 次插入0 次删除
  1. +40
    -0
      src/applet/app/controllers/Alipay/PayController.php
  2. +1
    -0
      src/common/Service/AliBPass/demo/AliEcoService.php

+ 40
- 0
src/applet/app/controllers/Alipay/PayController.php 查看文件

@@ -66,6 +66,46 @@ class PayController extends ControllerBase
$this->api(Msg::NewError(500, '提交方式错误!'));
}


public function tradeCreateForErpAction()
{
if ($this->request->isPost()) {
$args = $this->request->getJsonRawBody(true);
$this->logger($args, 'tradeCreate', true);

$config["pay_ali_app_id"] = $args["config"]["pay_ali_app_id"] ?? "2021004101651996";
$config["pay_ali_private_key"] = $args["config"]["pay_ali_private_key"] ?? "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSGJ9ob4kmGy6y4YeynjKJc/LSg02EXjLErPZSfVrAOy69FTRfBDbazlxpfl6YCAxDdT5ZcspB5kS2XYOY4dmqqPmF4VywmcjmZM8IxZFl1p7YC8BOlP6JrzDPwVl3hn4z3Em1byj8ANLY/AxAaW9W43FSIX+cSfdJThTlxGcbHZFM3kqu++hgFc/E+ar1nB0garqh03ESjatO4b6tuHM57ou7M+fXsoIf3gaL1IDZpeAoRh5sLCBLIbLz55tF0DcOaFsK7NUImnabJDRtrM1IN0lDZkQYAzL+JFsAq+ncRJm60Vd1jq/pXML/cFVHQQgdnjUd2u2NJTSMiCKCftmdAgMBAAECggEARzt+LduEEXJbeJiCI1MC7QX9tSqUFyAevMpgZ6P7JZM1nLfECzfwzwqjAES/Nn1mDVYTCmXvu+XcRtadnWMxUAaHcwGIwgqZa8xnLa220OKuHETOhQIcgWFL+WAakS6gRgT4Y2BJqWV1aJqsFpPR15mZ3SO8JqXhznolsknqw8sO+DBJu+QXn1HdntSGWrLU4GblPlYAs64y/MzPMUWfA4ShDRn9MZK6ypnh2GB5ezgnFxx1jRGOy96IqikI8f+M/CVdgzErLIl+qTd/IbfL8B6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3ODgM8DfdKDHD5b1T6VbcRGFobXQBqVtW008ocUnSOZzE67a73l6mKT3FbmhRsbrgwcUuOHEJUZaLFxPibJgFl7fkOjBcIiz+Wc+9VDTt8O4YxIZhAL6L6ppXcrVrCkOaiIiuHGyp7FjQ+5s3Lk3NLSO3TfXw1WEX2F+IHnw32ZN/FlC8rF8HVlgM0w/PZJ9RuadoLqn5H6z/iqrurbtxscnx0Qbdt8CBzREabJnWxHjxO936AXu9njIPvsXkTfaJJIXxRGGb0b8peSiCljwi8UEODe8mjl2c/LzLel6RuLQIDAQAB";
$config["ali_notify_url"] = $args["notify_url"] ?? "http://smart_canteen_pay.dengbiao.top//callBack/alipayAsyncNotifyCallBack"; //异步回调

$op_app_id = $args["op_app_id"] ?? "";
$buyer_id = $args["buyer_id"] ?? "";
$total_amount = $args["total_amount"] ?? "";
$out_trade_no = $args["out_trade_no"] ?? "";
$subject = $args["subject"] ?? "";
$app_auth_token = $args["app_auth_token"] ?? "";
$notify_url = $args["notify_url"] ?? "";

$result = (new AlipayService($config))->alipayTradeCreateRequest($op_app_id, $subject, $out_trade_no, $total_amount, $buyer_id, $app_auth_token, $notify_url);

$this->logger(["config" => $config, "args" => [
"op_app_id" => $op_app_id,
"buyer_id" => $buyer_id,
"total_amount" => $total_amount,
"out_trade_no" => $out_trade_no,
"subject" => $subject,
"app_auth_token" => $app_auth_token,
], "resp" => $result
], 'tradeCreate', true);

if (!$result["status"]) {
$this->api(["statusCode" => 500, "code" => $result["data"]["code"] * 1, "msg" => $result["msg"] ?? $result["sub_msg"]]);
}
$this->api($result["data"]);
}
$this->api(Msg::NewError(500, '提交方式错误!'));
}

public function tradeCommonQueryAction()
{
if ($this->request->isPost()) {


+ 1
- 0
src/common/Service/AliBPass/demo/AliEcoService.php 查看文件

@@ -278,6 +278,7 @@ class AliEcoService extends BaseService
//获取签名
$sign = $client->generateSign($params, $this->signType);

$this->logger($params, 'alipayPlanetEcocampusApiDebtRepay', true);
// 调用ECOAPI
$result = $client->call($params);



Loading…
取消
儲存