Class PaymentGatewayServices
- java.lang.Object
-
- org.apache.ofbiz.accounting.payment.PaymentGatewayServices
-
public class PaymentGatewayServices extends java.lang.Object
PaymentGatewayServices
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTH_SERVICE_TYPE
static java.lang.String
CAPTURE_SERVICE_TYPE
static java.lang.String
CREDIT_SERVICE_TYPE
static int
decimals
static java.lang.String
module
static java.lang.String
REAUTH_SERVICE_TYPE
static java.lang.String
REFUND_SERVICE_TYPE
static java.lang.String
RELEASE_SERVICE_TYPE
static java.lang.String
resource
static java.lang.String
resourceError
static java.lang.String
resourceOrder
static java.math.RoundingMode
rounding
static java.math.BigDecimal
ZERO
-
Constructor Summary
Constructors Constructor Description PaymentGatewayServices()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Map<java.lang.String,java.lang.Object>
alwaysApproveProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always approve processor.static java.util.Map<java.lang.String,java.lang.Object>
alwaysApproveWithCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
alwaysBadCardNumberProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always bad card number processorstatic java.util.Map<java.lang.String,java.lang.Object>
alwaysBadExpireProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always fail/bad expire date processorstatic java.util.Map<java.lang.String,java.lang.Object>
alwaysDeclineProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always decline processorstatic java.util.Map<java.lang.String,java.lang.Object>
alwaysFailProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always fail (error) processorstatic java.util.Map<java.lang.String,java.lang.Object>
alwaysNsfProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always NSF (not sufficient funds) processorstatic java.util.Map<java.lang.String,java.lang.Object>
authOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Authorizes a single order preference with an option to specify an amount.static java.util.Map<java.lang.String,java.lang.Object>
authOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic java.util.Map<java.lang.String,java.lang.Object>
badExpireEvenProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Fail/bad expire date when year is even processorstatic java.util.Map<java.lang.String,java.lang.Object>
captureBillingAccountPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
captureBillingAccountPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
captureOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic java.util.Map<java.lang.String,java.lang.Object>
capturePaymentsByInvoice(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic boolean
checkAuthValidity(GenericValue orderPaymentPreference, java.lang.String paymentConfig)
static java.sql.Timestamp
getAuthTime(GenericValue orderPaymentPreference)
static GenericValue
getAuthTransaction(GenericValue orderPaymentPreference)
Gets the chronologically latest PaymentGatewayResponse from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.static java.util.List<GenericValue>
getAuthTransactions(GenericValue orderPaymentPreference)
Gets a chronologically ordered list of PaymentGatewayResponses from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.static GenericValue
getCaptureTransaction(GenericValue orderPaymentPreference)
static java.lang.String
getPaymentCustomMethod(Delegator delegator, java.lang.String customMethodId)
static boolean
isReplacementOrder(GenericValue orderHeader)
static java.util.Map<java.lang.String,java.lang.Object>
processAuthResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processCaptureResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processCaptureSplitPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processCreditResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processManualCcAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processManualCcTx(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processRefundResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
processReleaseResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
refundOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
refundPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
releaseOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic java.util.Map<java.lang.String,java.lang.Object>
releaseOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Releases authorizations through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic java.util.Map<java.lang.String,java.lang.Object>
retryFailedAuthNsfs(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
retryFailedAuths(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
retryFailedOrderAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
savePaymentGatewayResponse(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
savePaymentGatewayResponseAndMessages(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
storePaymentErrorMessage(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
testCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test capture service (returns true)static java.util.Map<java.lang.String,java.lang.Object>
testCaptureWithReAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
testCCProcessorCaptureAlwaysDecline(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always decline processorstatic java.util.Map<java.lang.String,java.lang.Object>
testProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Simple test processor; declines all orders < 100.00; approves all orders >= 100.00static java.util.Map<java.lang.String,java.lang.Object>
testProcessorWithCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Simple test processor; declines all orders < 100.00; approves all orders > 100.00static java.util.Map<java.lang.String,java.lang.Object>
testRandomAuthorize(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test authorize - does random declinesstatic java.util.Map<java.lang.String,java.lang.Object>
testRefund(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test refund service (returns true)static java.util.Map<java.lang.String,java.lang.Object>
testRefundFailure(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
testRelease(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
static java.util.Map<java.lang.String,java.lang.Object>
verifyCreditCard(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
AUTH_SERVICE_TYPE
public static final java.lang.String AUTH_SERVICE_TYPE
- See Also:
- Constant Field Values
-
REAUTH_SERVICE_TYPE
public static final java.lang.String REAUTH_SERVICE_TYPE
- See Also:
- Constant Field Values
-
RELEASE_SERVICE_TYPE
public static final java.lang.String RELEASE_SERVICE_TYPE
- See Also:
- Constant Field Values
-
CAPTURE_SERVICE_TYPE
public static final java.lang.String CAPTURE_SERVICE_TYPE
- See Also:
- Constant Field Values
-
REFUND_SERVICE_TYPE
public static final java.lang.String REFUND_SERVICE_TYPE
- See Also:
- Constant Field Values
-
CREDIT_SERVICE_TYPE
public static final java.lang.String CREDIT_SERVICE_TYPE
- See Also:
- Constant Field Values
-
decimals
public static final int decimals
-
rounding
public static final java.math.RoundingMode rounding
-
ZERO
public static final java.math.BigDecimal ZERO
-
resource
public static final java.lang.String resource
- See Also:
- Constant Field Values
-
resourceError
public static final java.lang.String resourceError
- See Also:
- Constant Field Values
-
resourceOrder
public static final java.lang.String resourceOrder
- See Also:
- Constant Field Values
-
-
Method Detail
-
authOrderPaymentPreference
public static java.util.Map<java.lang.String,java.lang.Object> authOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
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 authorization was finished. There is also a List "messages" for the authorization response messages and a BigDecimal, "processAmount" as the amount processed. TODO: it might be nice to return the paymentGatewayResponseId
-
authOrderPayments
public static java.util.Map<java.lang.String,java.lang.Object> authOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodType- Returns:
- APPROVED|FAILED|ERROR for complete processing of ALL payment methods.
-
releaseOrderPayments
public static java.util.Map<java.lang.String,java.lang.Object> releaseOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Releases authorizations through service calls to the defined processing service for the ProductStore/PaymentMethodType- Returns:
- COMPLETE|FAILED|ERROR for complete processing of ALL payments.
-
processCreditResult
public static java.util.Map<java.lang.String,java.lang.Object> processCreditResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
releaseOrderPaymentPreference
public static java.util.Map<java.lang.String,java.lang.Object> releaseOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodType- Returns:
- SUCCESS|FAILED|ERROR for complete processing of payment.
-
processReleaseResult
public static java.util.Map<java.lang.String,java.lang.Object> processReleaseResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
capturePaymentsByInvoice
public static java.util.Map<java.lang.String,java.lang.Object> capturePaymentsByInvoice(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType- Returns:
- COMPLETE|FAILED|ERROR for complete processing of ALL payment methods.
-
captureOrderPayments
public static java.util.Map<java.lang.String,java.lang.Object> captureOrderPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodType- Returns:
- COMPLETE|FAILED|ERROR for complete processing of ALL payment methods.
-
processCaptureSplitPayment
public static java.util.Map<java.lang.String,java.lang.Object> processCaptureSplitPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
captureBillingAccountPayment
public static java.util.Map<java.lang.String,java.lang.Object> captureBillingAccountPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
captureBillingAccountPayments
public static java.util.Map<java.lang.String,java.lang.Object> captureBillingAccountPayments(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
storePaymentErrorMessage
public static java.util.Map<java.lang.String,java.lang.Object> storePaymentErrorMessage(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
processAuthResult
public static java.util.Map<java.lang.String,java.lang.Object> processAuthResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
processCaptureResult
public static java.util.Map<java.lang.String,java.lang.Object> processCaptureResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
refundOrderPaymentPreference
public static java.util.Map<java.lang.String,java.lang.Object> refundOrderPaymentPreference(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
refundPayment
public static java.util.Map<java.lang.String,java.lang.Object> refundPayment(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
processRefundResult
public static java.util.Map<java.lang.String,java.lang.Object> processRefundResult(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
retryFailedOrderAuth
public static java.util.Map<java.lang.String,java.lang.Object> retryFailedOrderAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
retryFailedAuths
public static java.util.Map<java.lang.String,java.lang.Object> retryFailedAuths(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
retryFailedAuthNsfs
public static java.util.Map<java.lang.String,java.lang.Object> retryFailedAuthNsfs(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
getCaptureTransaction
public static GenericValue getCaptureTransaction(GenericValue orderPaymentPreference)
-
getAuthTransaction
public static GenericValue getAuthTransaction(GenericValue orderPaymentPreference)
Gets the chronologically latest PaymentGatewayResponse from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH. Used for capturing.- Parameters:
orderPaymentPreference
- GenericValue object of the order payment preference- Returns:
- return the first authorization of the order payment preference
-
getAuthTransactions
public static java.util.List<GenericValue> getAuthTransactions(GenericValue orderPaymentPreference)
Gets a chronologically ordered list of PaymentGatewayResponses from an OrderPaymentPreference which is either a PRDS_PAY_AUTH or PRDS_PAY_REAUTH.- Parameters:
orderPaymentPreference
- GenericValue object of the order payment preference- Returns:
- return the authorizations of the order payment preference
-
getAuthTime
public static java.sql.Timestamp getAuthTime(GenericValue orderPaymentPreference)
-
checkAuthValidity
public static boolean checkAuthValidity(GenericValue orderPaymentPreference, java.lang.String paymentConfig)
-
savePaymentGatewayResponse
public static java.util.Map<java.lang.String,java.lang.Object> savePaymentGatewayResponse(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
savePaymentGatewayResponseAndMessages
public static java.util.Map<java.lang.String,java.lang.Object> savePaymentGatewayResponseAndMessages(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
processManualCcAuth
public static java.util.Map<java.lang.String,java.lang.Object> processManualCcAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
processManualCcTx
public static java.util.Map<java.lang.String,java.lang.Object> processManualCcTx(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
verifyCreditCard
public static java.util.Map<java.lang.String,java.lang.Object> verifyCreditCard(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
testProcessor
public static java.util.Map<java.lang.String,java.lang.Object> testProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Simple test processor; declines all orders < 100.00; approves all orders >= 100.00
-
testProcessorWithCapture
public static java.util.Map<java.lang.String,java.lang.Object> testProcessorWithCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Simple test processor; declines all orders < 100.00; approves all orders > 100.00
-
testRandomAuthorize
public static java.util.Map<java.lang.String,java.lang.Object> testRandomAuthorize(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test authorize - does random declines
-
alwaysApproveProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysApproveProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always approve processor.
-
alwaysApproveWithCapture
public static java.util.Map<java.lang.String,java.lang.Object> alwaysApproveWithCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
alwaysDeclineProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysDeclineProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always decline processor
-
alwaysNsfProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysNsfProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always NSF (not sufficient funds) processor
-
alwaysBadExpireProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysBadExpireProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always fail/bad expire date processor
-
badExpireEvenProcessor
public static java.util.Map<java.lang.String,java.lang.Object> badExpireEvenProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Fail/bad expire date when year is even processor
-
alwaysBadCardNumberProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysBadCardNumberProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always bad card number processor
-
alwaysFailProcessor
public static java.util.Map<java.lang.String,java.lang.Object> alwaysFailProcessor(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always fail (error) processor
-
testRelease
public static java.util.Map<java.lang.String,java.lang.Object> testRelease(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
testCapture
public static java.util.Map<java.lang.String,java.lang.Object> testCapture(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test capture service (returns true)
-
testCCProcessorCaptureAlwaysDecline
public static java.util.Map<java.lang.String,java.lang.Object> testCCProcessorCaptureAlwaysDecline(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Always decline processor
-
testCaptureWithReAuth
public static java.util.Map<java.lang.String,java.lang.Object> testCaptureWithReAuth(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
testRefund
public static java.util.Map<java.lang.String,java.lang.Object> testRefund(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
Test refund service (returns true)
-
testRefundFailure
public static java.util.Map<java.lang.String,java.lang.Object> testRefundFailure(DispatchContext dctx, java.util.Map<java.lang.String,? extends java.lang.Object> context)
-
getPaymentCustomMethod
public static java.lang.String getPaymentCustomMethod(Delegator delegator, java.lang.String customMethodId)
-
isReplacementOrder
public static boolean isReplacementOrder(GenericValue orderHeader)
-
-