[fix]商户端支付秘钥支持刷新

master
hellolujian 6 years ago
parent aa2e4bc37e
commit 562840ceda

@ -560,7 +560,7 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
};
}]);
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', 'commonDialog', function ($scope, $http, commonDialog) {
app.controller('clientPaymentInfoCtrl', ['$scope', '$http', '$state', 'commonDialog', function ($scope, $http, $state, commonDialog) {
$scope.paymentInfo = $scope.partner;
$scope.old_customer_surcharge_rate = angular.copy($scope.partner.customer_surcharge_rate);
$scope.qrConfig = {currency: 'AUD'};
@ -829,7 +829,25 @@ define(['angular', 'decimal', 'uiRouter', 'ngBootSwitch', 'ngFileUpload'], funct
$scope.bankshow = false;
};
// 新增需求,商户端刷新支付秘钥
$scope.refreshCredential = function () {
commonDialog.confirm({
title: 'Warning',
content: 'Refresh Credential will expire the current one, ' +
'which will cause the current payment service disabled. ' +
'Are you sure going on?'
}).then(function () {
$http.put('/sys/partners/' + $scope.partner.client_moniker + '/credential_code').then(function () {
$state.reload();
}, function (resp) {
commonDialog.alert({
title: 'Error',
content: resp.data.message,
type: 'error'
})
})
})
};
}]);
app.controller('clientPaymentMaterialCtrl', ['$scope', '$http', 'partner', function ($scope, $http, partner) {

@ -87,7 +87,15 @@
<div class="form-group">
<label class="control-label col-sm-2">Gateway Credential</label>
<div class="col-sm-10">
<p class="form-control-static" ng-bind="partner.credential_code"></p>
<p class="form-control-static">
<span ng-bind="partner.credential_code"></span>
<a role="button"
ng-click="refreshCredential()"
title="refresh"
ng-if="'111'|withRole">
<i class="fa fa-refresh"></i>
</a>
</p>
</div>
</div>
</div>

Loading…
Cancel
Save