public MallCaptureResponse Capture(string childCommerceCode, string childBuyOrder, string authorizationCode, decimal captureAmount) { ValidationUtil.hasTextWithMaxLength(childCommerceCode, ApiConstants.COMMERCE_CODE_LENGTH, "childCommerceCode"); ValidationUtil.hasTextWithMaxLength(childBuyOrder, ApiConstants.BUY_ORDER_LENGTH, "childBuyOrder"); ValidationUtil.hasTextWithMaxLength(authorizationCode, ApiConstants.AUTHORIZATION_CODE_LENGTH, "authorizationCode"); return(ExceptionHandler.Perform <MallCaptureResponse, MallCaptureException>(() => { long.TryParse(childCommerceCode, out long ccode); var mallCaptureRequest = new MallCaptureRequest(ccode, childBuyOrder, captureAmount, authorizationCode); return _requestService.Perform <MallCaptureResponse, MallCaptureException>(mallCaptureRequest, Options); })); }
public MallCaptureResponse Capture(string childCommerceCode, string token, string buyOrder, string authorizationCode, decimal captureAmount) { ValidationUtil.hasTextWithMaxLength(token, ApiConstants.TOKEN_LENGTH, "token"); ValidationUtil.hasTextWithMaxLength(childCommerceCode, ApiConstants.COMMERCE_CODE_LENGTH, "childCommerceCode"); ValidationUtil.hasTextWithMaxLength(buyOrder, ApiConstants.BUY_ORDER_LENGTH, "buyOrder"); ValidationUtil.hasTextWithMaxLength(authorizationCode, ApiConstants.AUTHORIZATION_CODE_LENGTH, "authorizationCode"); return(ExceptionHandler.Perform <MallCaptureResponse, MallTransactionCaptureException>(() => { var mallCaptureRequest = new MallCaptureRequest(token, childCommerceCode, buyOrder, authorizationCode, captureAmount); return _requestService.Perform <MallCaptureResponse, MallTransactionCaptureException>(mallCaptureRequest, Options); })); }