亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? paymentgatewayservices.java

?? Sequoia ERP是一個真正的企業級開源ERP解決方案。它提供的模塊包括:電子商務應用(e-commerce), POS系統(point of sales),知識管理,存貨與倉庫管理
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
/* * $Id: PaymentGatewayServices.java 7233 2006-04-07 14:26:24Z sichen $ * *  Copyright (c) 2001-2005 The Open For Business Project - www.ofbiz.org * *  Permission is hereby granted, free of charge, to any person obtaining a *  copy of this software and associated documentation files (the "Software"), *  to deal in the Software without restriction, including without limitation *  the rights to use, copy, modify, merge, publish, distribute, sublicense, *  and/or sell copies of the Software, and to permit persons to whom the *  Software is furnished to do so, subject to the following conditions: * *  The above copyright notice and this permission notice shall be included *  in all copies or substantial portions of the Software. * *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *  THE USE OR OTHER DEALINGS IN THE SOFTWARE. */package org.ofbiz.accounting.payment;import java.text.DecimalFormat;import java.text.ParseException;import java.util.ArrayList;import java.util.Collection;import java.util.Date;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import java.util.Calendar;import java.util.Set;import java.math.BigDecimal;import java.sql.Timestamp;import org.ofbiz.accounting.invoice.InvoiceWorker;import org.ofbiz.base.util.Debug;import org.ofbiz.base.util.GeneralException;import org.ofbiz.base.util.UtilDateTime;import org.ofbiz.base.util.UtilMisc;import org.ofbiz.base.util.UtilNumber;import org.ofbiz.base.util.UtilProperties;import org.ofbiz.base.util.UtilValidate;import org.ofbiz.entity.GenericDelegator;import org.ofbiz.entity.GenericEntityException;import org.ofbiz.entity.GenericValue;import org.ofbiz.entity.condition.EntityCondition;import org.ofbiz.entity.condition.EntityConditionList;import org.ofbiz.entity.condition.EntityExpr;import org.ofbiz.entity.condition.EntityJoinOperator;import org.ofbiz.entity.condition.EntityOperator;import org.ofbiz.entity.util.EntityListIterator;import org.ofbiz.entity.util.EntityUtil;import org.ofbiz.order.order.OrderChangeHelper;import org.ofbiz.order.order.OrderReadHelper;import org.ofbiz.party.contact.ContactHelper;import org.ofbiz.product.store.ProductStoreWorker;import org.ofbiz.security.Security;import org.ofbiz.service.DispatchContext;import org.ofbiz.service.GenericServiceException;import org.ofbiz.service.LocalDispatcher;import org.ofbiz.service.ModelService;import org.ofbiz.service.ServiceUtil;/** * PaymentGatewayServices * * @author     <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a> * @version    $Rev: 7233 $ * @since      2.0 */public class PaymentGatewayServices {    public static final String module = PaymentGatewayServices.class.getName();    public static final String AUTH_SERVICE_TYPE = "PRDS_PAY_AUTH";    public static final String REAUTH_SERVICE_TYPE = "PRDS_PAY_REAUTH";    public static final String RELEASE_SERVICE_TYPE = "PRDS_PAY_RELEASE";    public static final String CAPTURE_SERVICE_TYPE = "PRDS_PAY_CAPTURE";    public static final String REFUND_SERVICE_TYPE = "PRDS_PAY_REFUND";    public static final String CREDIT_SERVICE_TYPE = "PRDS_PAY_CREDIT";    private static final int TX_TIME = 300;    private static BigDecimal ZERO = new BigDecimal("0");    private static int decimals = -1;    private static int rounding = -1;    static {        decimals = UtilNumber.getBigDecimalScale("order.decimals");        rounding = UtilNumber.getBigDecimalRoundingMode("order.rounding");        // set zero to the proper scale        if (decimals != -1) ZERO.setScale(decimals);    }        /**     * Helper method to parse total remaining balance in an order from order read helper.     */    private static double getTotalRemaining(OrderReadHelper orh) throws ParseException, NumberFormatException {        String currencyFormat = UtilProperties.getPropertyValue("general.properties", "currency.decimal.format", "##0.00");        DecimalFormat formatter = new DecimalFormat(currencyFormat);        String grandTotalString = formatter.format(orh.getOrderGrandTotal());        Double grandTotal = new Double(formatter.parse(grandTotalString).doubleValue());        return grandTotal.doubleValue();    }    /**     * Authorizes a single order preference with an option to specify an amount. The result map has the Booleans     * "errors" and "finished" which notify the user if there were any errors and if the authorizatoin was finished.     * There is also a List "messages" for the authorization response messages and a Double, "processAmount" as the      * amount processed. TODO: it might be nice to return the paymentGatewayResponseId     */    public static Map authOrderPaymentPreference(DispatchContext dctx, Map context) {        GenericDelegator delegator = dctx.getDelegator();        LocalDispatcher dispatcher = dctx.getDispatcher();        GenericValue userLogin = (GenericValue) context.get("userLogin");        String orderPaymentPreferenceId = (String) context.get("orderPaymentPreferenceId");        Double overrideAmount = (Double) context.get("overrideAmount");        // validate overrideAmount if its available        if (overrideAmount != null) {            if (overrideAmount.doubleValue()  < 0) return ServiceUtil.returnError("Amount entered (" + overrideAmount + ") is negative.");            if (overrideAmount.doubleValue()  == 0) return ServiceUtil.returnError("Amount entered (" + overrideAmount + ") is zero.");        }        GenericValue orderHeader = null;        GenericValue orderPaymentPreference = null;        try {            orderPaymentPreference = delegator.findByPrimaryKey("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId));            orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader");        } catch (GenericEntityException e) {            Debug.logError(e, module);            return ServiceUtil.returnError("Problems getting required information: orderPaymentPreference [" + orderPaymentPreferenceId + "]");        }        OrderReadHelper orh = new OrderReadHelper(orderHeader);        // get the total remaining        double totalRemaining = 0.0;        try {            totalRemaining = getTotalRemaining(orh);        } catch (Exception e) {            Debug.logError(e, "Problem getting parsed grand total amount", module);            return ServiceUtil.returnError("ERROR: Cannot parse grand total from formatted string; see logs");        }        // get the process attempts so far        Long procAttempt = orderPaymentPreference.getLong("processAttempt");        if (procAttempt == null) {            procAttempt = new Long(0);        }        // update the process attempt count        orderPaymentPreference.set("processAttempt", new Long(procAttempt.longValue() + 1));        try {            orderPaymentPreference.store();        } catch (GenericEntityException e) {            Debug.logError(e, module);            return ServiceUtil.returnError("Unable to update OrderPaymentPreference record!");        }        // if we are already authorized, then this is a re-auth request        boolean reAuth = false;        if (orderPaymentPreference.get("statusId") != null && "PAYMENT_AUTHORIZED".equals(orderPaymentPreference.getString("statusId"))) {            reAuth = true;        }        // use overrideAmount or maxAmount        Double transAmount = null;        if (overrideAmount != null) {            transAmount = overrideAmount;        } else {            transAmount = orderPaymentPreference.getDouble("maxAmount");        }        // prepare the return map (always return success, default finished=false, default errors=false        Map results = UtilMisc.toMap(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS, "finished", new Boolean(false), "errors", new Boolean(false));         // if our transaction amount exists and is zero, there's nothing to process, so return        if ((transAmount != null) && (transAmount.doubleValue() <= 0)) {            return results;        }        // call the authPayment method        Map processorResult = authPayment(dispatcher, userLogin, orh, orderPaymentPreference, totalRemaining, reAuth, overrideAmount);        // handle the response        if (processorResult != null) {            // get the customer messages            if (processorResult.get("customerRespMsgs") != null) {                results.put("messages", processorResult.get("customerRespMsgs"));            }            // not null result means either an approval or decline; null would mean error            Double thisAmount = (Double) processorResult.get("processAmount");            // process the auth results            boolean processResult = false;            try {                processResult = processResult(dctx, processorResult, userLogin, orderPaymentPreference);                if (processResult) {                    results.put("processAmount", thisAmount);                    results.put("finished", new Boolean(true));                }            } catch (GeneralException e) {                Debug.logError(e, "Trouble processing the result; processorResult: " + processorResult, module);                results.put("errors", new Boolean(true));            }        } else {            // error with payment processor; will try later            Debug.logInfo("Invalid OrderPaymentPreference; maxAmount is 0", module);            orderPaymentPreference.set("statusId", "PAYMENT_CANCELLED");            try {                orderPaymentPreference.store();            } catch (GenericEntityException e) {                Debug.logError(e, "ERROR: Problem setting OrderPaymentPreference status to CANCELLED", module);            }            results.put("errors", new Boolean(true));        }        return results;    }    /**     * Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodType     * @return APPROVED|FAILED|ERROR for complete processing of ALL payment methods.     */    public static Map authOrderPayments(DispatchContext dctx, Map context) {        GenericDelegator delegator = dctx.getDelegator();        LocalDispatcher dispatcher = dctx.getDispatcher();        String orderId = (String) context.get("orderId");        Map result = new HashMap();        // get the order header and payment preferences        GenericValue orderHeader = null;        List paymentPrefs = null;        try {            // get the OrderHeader            orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));            // get the payments to auth            Map lookupMap = UtilMisc.toMap("orderId", orderId, "statusId", "PAYMENT_NOT_AUTH");            List orderList = UtilMisc.toList("maxAmount");            paymentPrefs = delegator.findByAnd("OrderPaymentPreference", lookupMap, orderList);        } catch (GenericEntityException gee) {            Debug.logError(gee, "Problems getting the order information", module);            result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);            result.put(ModelService.ERROR_MESSAGE, "ERROR: Could not get order information (" + gee.getMessage() + ").");            return result;        }        // make sure we have a OrderHeader        if (orderHeader == null) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产超碰在线一区| 91啪亚洲精品| 亚洲男人的天堂av| 日韩精品一区二区三区四区视频| 国产成人综合自拍| 午夜免费久久看| 国产精品护士白丝一区av| 日韩丝袜情趣美女图片| 91麻豆精品在线观看| 国产精品一二三区在线| 日本欧美加勒比视频| 一区二区三区丝袜| 久久九九久久九九| 欧美一卡二卡三卡四卡| 在线观看免费亚洲| 成人av电影在线播放| 国产专区欧美精品| 性感美女久久精品| 亚洲精品国产精华液| 欧美国产一区视频在线观看| 欧美电影免费观看完整版| 6080国产精品一区二区| 色综合久久天天| 成人激情av网| 成人综合在线网站| 国产精品主播直播| 韩国女主播成人在线| 蜜桃一区二区三区四区| 午夜精品久久久久久| 亚洲免费色视频| 国产一级精品在线| 亚洲精品水蜜桃| 中文字幕av资源一区| 久久色.com| 精品剧情v国产在线观看在线| 4438亚洲最大| 日韩视频国产视频| 欧美中文字幕一区| 欧美在线视频你懂得| 色噜噜狠狠一区二区三区果冻| 成人一二三区视频| www.日韩在线| www.av亚洲| 91视频精品在这里| 色综合视频在线观看| 97se亚洲国产综合自在线| 97se亚洲国产综合在线| 日本韩国精品在线| 欧美日韩一区不卡| 91麻豆精品国产| 日韩精品自拍偷拍| 国产蜜臀97一区二区三区| 国产亚洲精品aa| 中文字幕视频一区二区三区久| 中文字幕在线一区二区三区| 亚洲激情在线播放| 亚州成人在线电影| 美女www一区二区| 国产一级精品在线| 99久久久无码国产精品| 精品视频免费看| 日韩精品一区在线观看| 国产视频911| 一区二区三区中文字幕在线观看| 亚洲综合区在线| 九九**精品视频免费播放| 国产精品一卡二卡| 91亚洲精品久久久蜜桃网站| 色噜噜狠狠成人中文综合| 88在线观看91蜜桃国自产| 精品粉嫩aⅴ一区二区三区四区| 国产欧美日韩精品一区| 亚洲精品中文字幕在线观看| 首页国产丝袜综合| 国产精品99久久久久久宅男| 色婷婷精品久久二区二区蜜臂av| 91色在线porny| 欧美一区二区成人6969| 国产精品久久一卡二卡| 日韩av电影免费观看高清完整版在线观看 | 亚洲激情图片小说视频| 首页国产欧美日韩丝袜| 成人高清伦理免费影院在线观看| 91黄色免费看| 欧美精品一区在线观看| 亚洲影院在线观看| 国产精品羞羞答答xxdd| 欧美三级乱人伦电影| 精品av久久707| 一区二区三区欧美日韩| 国内成+人亚洲+欧美+综合在线| 在线免费观看成人短视频| 久久亚洲二区三区| 亚洲一区在线视频观看| 国产成人aaaa| 91精品欧美一区二区三区综合在| 欧美激情自拍偷拍| 蜜桃av一区二区三区| 色综合久久88色综合天天免费| 欧美成人午夜电影| 亚洲国产一区视频| www.亚洲色图.com| 久久一夜天堂av一区二区三区| 亚洲国产欧美另类丝袜| jiyouzz国产精品久久| 欧美精品一区二区三区蜜桃视频| 亚洲国产日韩一区二区| av在线这里只有精品| 精品国偷自产国产一区| 天堂久久一区二区三区| 在线观看亚洲成人| 国产精品进线69影院| 国产综合一区二区| 欧美高清视频一二三区 | 欧美成人一区二区三区片免费| 亚洲精品午夜久久久| eeuss影院一区二区三区| 久久在线免费观看| 美脚の诱脚舐め脚责91 | 免费的成人av| 欧美日韩亚洲另类| 亚洲综合一区二区| 色综合久久久网| 成人欧美一区二区三区在线播放| 国产毛片精品一区| 欧美成人在线直播| 美女mm1313爽爽久久久蜜臀| 91精品国产综合久久婷婷香蕉| 午夜久久电影网| 91麻豆精品国产91久久久使用方法 | 亚洲日本va午夜在线电影| 国产高清在线观看免费不卡| 精品国产污污免费网站入口 | 精品国产伦一区二区三区观看方式 | 国产日韩欧美制服另类| 国产九九视频一区二区三区| 精品久久久久一区| 精品午夜久久福利影院 | 久久婷婷成人综合色| 国产一区二区三区久久悠悠色av| 精品黑人一区二区三区久久| 国模少妇一区二区三区| 国产午夜精品一区二区三区嫩草 | 972aa.com艺术欧美| 国产精品成人网| 色诱视频网站一区| 一区二区三区四区在线| 欧美性色综合网| 三级欧美韩日大片在线看| 欧美一区二区三区喷汁尤物| 男人的天堂久久精品| 精品国产乱码久久久久久牛牛| 紧缚奴在线一区二区三区| 久久夜色精品国产欧美乱极品| 国产91精品免费| 亚洲精品欧美专区| 91精品一区二区三区在线观看| 久久er精品视频| 亚洲国产精品av| 欧美在线你懂的| 美国精品在线观看| 欧美国产日韩在线观看| 欧美伊人久久久久久午夜久久久久| 亚洲一区中文日韩| 26uuu精品一区二区| 99这里只有精品| 亚洲成av人影院在线观看网| 日韩欧美中文字幕制服| 国产福利91精品一区二区三区| 中文字幕一区二区三区精华液| 日本精品一区二区三区高清| 午夜精品视频在线观看| 久久久精品中文字幕麻豆发布| 91蜜桃网址入口| 美女一区二区视频| 国产精品麻豆久久久| 欧美日韩在线三级| 国产精品一二一区| 亚洲综合一二三区| 国产性色一区二区| 欧美日韩一区精品| 国产成人8x视频一区二区| 亚洲第一福利视频在线| 久久理论电影网| 欧美色综合影院| 粉嫩欧美一区二区三区高清影视| 亚洲成人福利片| 国产人成一区二区三区影院| 欧美日韩大陆一区二区| 岛国精品在线观看| 天天综合天天综合色| 中文字幕在线不卡国产视频| 91精品一区二区三区久久久久久| gogo大胆日本视频一区| 久久99国产精品免费| 亚洲一区二区综合| 国产精品久久久久久久岛一牛影视| 欧美一二三四区在线| 91精品办公室少妇高潮对白| 国产乱对白刺激视频不卡|