|
|
@@ -35,6 +35,42 @@ class CgRefundClass extends BaseClass
|
|
|
const REFUND_TYPE_MONEY_GOOD = 1; //退款退货
|
|
|
const REFUND_TYPE_MONEY = 2; // 仅退款
|
|
|
|
|
|
+ public static function onlyRefundMoney($ghsShop, $cg)
|
|
|
+ {
|
|
|
+ $refundOrderSn = orderSn::getCgRefundSn();
|
|
|
+ $refundPrice = $cg->actPrice ?? 0;
|
|
|
+ $orderSn = $cg->orderSn ?? '';
|
|
|
+ $transaction_id = $cg->thirdNo ?? '';
|
|
|
+ $refundFee = bcmul($refundPrice, 100);
|
|
|
+ $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
|
|
|
+ $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
|
|
|
+ $params = [
|
|
|
+ 'appid' => 'OP00002119',
|
|
|
+ 'serial_no' => '018b08cfddbd',
|
|
|
+ 'merchant_no' => $ghsShop->lklSjNo,
|
|
|
+ 'term_no' => $ghsShop->lklScanTermNo,
|
|
|
+ 'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
|
|
|
+ 'lklCertificatePath' => $lklCertificatePath,
|
|
|
+ ];
|
|
|
+ $laResource = new Lakala($params);
|
|
|
+ $refundReason = '';
|
|
|
+ $aliParams = [
|
|
|
+ 'refundSn' => $refundOrderSn,
|
|
|
+ 'orderSn' => $orderSn,
|
|
|
+ 'refundAmount' => $refundFee,
|
|
|
+ 'refundReason' => $refundReason,
|
|
|
+ 'thirdNo' => $transaction_id,
|
|
|
+ ];
|
|
|
+ $response = $laResource->refund($aliParams);
|
|
|
+ if (!isset($response['code']) || $response['code'] != 'BBS00000') {
|
|
|
+ $errMsg = $response['msg'] ?? '';
|
|
|
+ return ['status' => 0, 'msg' => $errMsg];
|
|
|
+ } else {
|
|
|
+ return ['status' => 1, 'msg' => '退款成功'];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//审核通过 ssh 20230811
|
|
|
public static function passRefund($cgRefund, $cg)
|
|
|
{
|