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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? paymentgatewayservices.java

?? Sequoia ERP是一個真正的企業(yè)級開源ERP解決方案。它提供的模塊包括:電子商務(wù)應(yīng)用(e-commerce), POS系統(tǒng)(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) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美人狂配大交3d怪物一区| 国产精品色呦呦| 福利电影一区二区三区| 亚洲不卡av一区二区三区| 日韩美女视频一区二区在线观看| 久久99国产精品久久99果冻传媒| 亚洲精品国产一区二区三区四区在线 | 国产精品三级久久久久三级| 91精品国产综合久久精品图片| 国产91精品免费| 日本成人超碰在线观看| 亚洲欧美偷拍另类a∨色屁股| 精品国产欧美一区二区| 欧美久久一区二区| 欧美性受xxxx黑人xyx性爽| 91美女在线观看| 色成人在线视频| 色诱亚洲精品久久久久久| 不卡电影免费在线播放一区| 日韩不卡手机在线v区| 三级成人在线视频| 丝袜美腿亚洲一区| 日日噜噜夜夜狠狠视频欧美人| 中文字幕一区二| 欧美mv日韩mv国产网站| 欧美不卡一二三| 欧美电影免费观看高清完整版在 | 亚洲精品国产一区二区精华液| 久久综合九色综合久久久精品综合| 欧美丝袜丝交足nylons| 日韩美女视频一区二区在线观看| 欧美刺激午夜性久久久久久久| wwwwxxxxx欧美| 日韩美女久久久| 日韩激情av在线| 久久av资源网| 91在线国产观看| 欧美视频一区在线| 欧美日韩一区二区三区高清| 欧美精品久久99久久在免费线| 欧美日韩一级片在线观看| 欧美午夜一区二区| 欧美日韩国产在线观看| 欧美精品色综合| 久久综合狠狠综合久久综合88 | 粉嫩高潮美女一区二区三区 | av电影一区二区| 欧美日韩国产欧美日美国产精品| 欧美吻胸吃奶大尺度电影| 久久色.com| 婷婷丁香激情综合| av成人动漫在线观看| 欧美日韩在线免费视频| 国产欧美一区视频| 日本视频免费一区| 国产精品小仙女| 欧美区一区二区三区| 亚洲国产高清在线| 狠狠色狠狠色综合| 欧美一级高清大全免费观看| 亚洲一区在线观看免费| 成人性色生活片免费看爆迷你毛片| 欧美日韩国产不卡| 亚洲蜜臀av乱码久久精品| 国模冰冰炮一区二区| 91麻豆精品91久久久久同性| 国产精品每日更新在线播放网址| 亚洲成人av资源| 色婷婷精品久久二区二区蜜臀av| 亚洲精品一线二线三线无人区| 一区二区三区 在线观看视频| 国产91在线看| 亚洲欧美日韩综合aⅴ视频| 99久久精品免费观看| 国产精品伦理在线| 成人自拍视频在线| 国产精品免费视频网站| 日韩女优av电影| 国产精品一二三区| 久久综合丝袜日本网| 亚洲综合自拍偷拍| 欧美v日韩v国产v| 精品一区二区三区日韩| 久久久久久99久久久精品网站| 黄网站免费久久| 久久综合视频网| 国产精品一区三区| 欧美国产丝袜视频| 欧美日韩国产在线观看| 蜜臀av亚洲一区中文字幕| 久久综合九色综合97_久久久| 成人黄页在线观看| 日韩精品一二三四| 精品噜噜噜噜久久久久久久久试看| 国产精品1区二区.| 日韩美女视频一区二区| 欧美一级在线视频| 9久草视频在线视频精品| 视频在线在亚洲| 亚洲人被黑人高潮完整版| 7777精品伊人久久久大香线蕉超级流畅| 蜜桃av噜噜一区| 亚洲三级电影网站| 日韩亚洲欧美在线| 欧美又粗又大又爽| 东方aⅴ免费观看久久av| 蜜桃视频在线一区| 成人免费在线播放视频| 欧美一区三区四区| 一本大道久久a久久综合| 午夜电影网一区| 亚洲视频中文字幕| 国产精品区一区二区三区| 久久免费国产精品| 久久亚洲免费视频| 日韩久久免费av| 欧美日韩黄视频| 懂色中文一区二区在线播放| 亚洲综合一区在线| 亚洲欧美日韩久久| 国产无遮挡一区二区三区毛片日本| 欧美日韩一区二区在线观看 | 不卡一区二区三区四区| 国产麻豆视频一区二区| 国产在线一区二区| 国产老妇另类xxxxx| 国产一区二区不卡老阿姨| 精品一区二区三区免费视频| 喷水一区二区三区| 国产尤物一区二区在线| 国产精品香蕉一区二区三区| 99久久精品费精品国产一区二区| 日本高清成人免费播放| 欧美日韩国产bt| 欧美精品一区二区三区蜜桃视频| 精品电影一区二区三区| 欧美成人官网二区| 久久久久久夜精品精品免费| 亚洲欧美另类在线| 性欧美疯狂xxxxbbbb| 日本美女一区二区三区| 国产一区欧美二区| 91在线无精精品入口| 欧美日韩精品一二三区| 国产欧美一区二区三区在线看蜜臀 | 成人午夜免费电影| 国产麻豆精品久久一二三| 视频一区二区三区入口| 亚洲午夜久久久久久久久电影网 | 欧美精品免费视频| 欧美在线你懂得| 91麻豆精品视频| 色网综合在线观看| 色诱亚洲精品久久久久久| 在线观看免费成人| 在线精品视频一区二区三四| 99精品视频在线观看| av一区二区三区黑人| 91浏览器在线视频| 日本道色综合久久| 欧美日韩在线不卡| 99免费精品视频| 欧美视频中文字幕| 91精品国产乱码| 久久久精品欧美丰满| 最新热久久免费视频| 国产精品你懂的在线欣赏| 亚洲精选一二三| 图片区小说区区亚洲影院| 日韩1区2区3区| 亚洲国产欧美一区二区三区丁香婷| 亚洲国产日韩a在线播放性色| 久久精品免费看| 97久久久精品综合88久久| 欧美精品乱码久久久久久| 欧美在线free| 国产精品欧美极品| 日本午夜精品视频在线观看| 成人免费高清视频| 91啪亚洲精品| av电影一区二区| 欧美一卡二卡在线观看| 日韩国产欧美三级| 欧美成人午夜电影| 肉色丝袜一区二区| 国产成人精品aa毛片| 国产精品久久毛片| 日产国产高清一区二区三区| 91精品国产欧美一区二区| 精品中文字幕一区二区| 久久久久国产精品麻豆ai换脸| 国产精品69久久久久水密桃| 日本一区二区综合亚洲| 成人美女视频在线观看| 免费人成黄页网站在线一区二区| 粉嫩av一区二区三区| 国产网红主播福利一区二区| 久久er精品视频| 91精品国产91久久综合桃花| 91麻豆精品国产自产在线观看一区 |