|
|
@@ -13,26 +13,37 @@ class pay
|
|
|
|
|
|
public static function thirdPay($payWay, $capitalType, $orderSn, $totalFee, $attach)
|
|
|
{
|
|
|
- //流水类型列表
|
|
|
- switch ($capitalType) {
|
|
|
- case dict::getDict('capitalType', 'xhRecharge', 'id'):
|
|
|
- //零售和供货商充值
|
|
|
- RechargeClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
- break;
|
|
|
- case dict::getDict('capitalType', 'xhPurchase', 'id'):
|
|
|
- //零售采购订单
|
|
|
- PurchaseClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
- break;
|
|
|
- case dict::getDict('capitalType', 'hdPurchaseClear', 'id'):
|
|
|
- //零售采购订单结算
|
|
|
- PurchaseClearClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
- break;
|
|
|
- case dict::getDict('capitalType', 'xhOrder', 'id'):
|
|
|
- //零售订单
|
|
|
- OrderClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
- break;
|
|
|
- default:
|
|
|
+ $connection = Yii::$app->db;
|
|
|
+ $transaction = $connection->beginTransaction();
|
|
|
+ try {
|
|
|
+
|
|
|
+ //流水类型列表
|
|
|
+ switch ($capitalType) {
|
|
|
+ case dict::getDict('capitalType', 'xhRecharge', 'id'):
|
|
|
+ //零售和供货商充值
|
|
|
+ RechargeClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
+ break;
|
|
|
+ case dict::getDict('capitalType', 'xhPurchase', 'id'):
|
|
|
+ //零售采购订单
|
|
|
+ PurchaseClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
+ break;
|
|
|
+ case dict::getDict('capitalType', 'hdPurchaseClear', 'id'):
|
|
|
+ //零售采购订单结算
|
|
|
+ PurchaseClearClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
+ break;
|
|
|
+ case dict::getDict('capitalType', 'xhOrder', 'id'):
|
|
|
+ //零售订单
|
|
|
+ OrderClass::thirdPay($payWay, $orderSn, $totalFee, $attach);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ }
|
|
|
+
|
|
|
+ $transaction->commit();
|
|
|
+ } catch (Exception $exception) {
|
|
|
+ $transaction->rollBack();
|
|
|
+ util::fail("支付回调处理失败 orderSn:{$orderSn} capitalType:{$capitalType}");
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|