Class PaymentGatewayServices
java.lang.Object
org.apache.ofbiz.accounting.payment.PaymentGatewayServices
PaymentGatewayServices
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalwaysApproveProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always approve processor.alwaysApproveWithCapture
(DispatchContext dctx, Map<String, ? extends Object> context) alwaysBadCardNumberProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always bad card number processoralwaysBadExpireProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always fail/bad expire date processoralwaysDeclineProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always decline processoralwaysFailProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always fail (error) processoralwaysNsfProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Always NSF (not sufficient funds) processorauthOrderPaymentPreference
(DispatchContext dctx, Map<String, ? extends Object> context) Authorizes a single order preference with an option to specify an amount.authOrderPayments
(DispatchContext dctx, Map<String, ? extends Object> context) Processes payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypebadExpireEvenProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Fail/bad expire date when year is even processorcaptureBillingAccountPayments
(DispatchContext dctx, Map<String, ? extends Object> context) captureOrderPayments
(DispatchContext dctx, Map<String, ? extends Object> context) Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypecapturePaymentsByInvoice
(DispatchContext dctx, Map<String, ? extends Object> context) Captures payments through service calls to the defined processing service for the ProductStore/PaymentMethodTypestatic boolean
checkAuthValidity
(GenericValue orderPaymentPreference, String paymentConfig) static 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 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) processAuthResult
(DispatchContext dctx, Map<String, ? extends Object> context) processCaptureResult
(DispatchContext dctx, Map<String, ? extends Object> context) processCaptureSplitPayment
(DispatchContext dctx, Map<String, ? extends Object> context) processCreditResult
(DispatchContext dctx, Map<String, ? extends Object> context) processManualCcAuth
(DispatchContext dctx, Map<String, ? extends Object> context) processManualCcTx
(DispatchContext dctx, Map<String, ? extends Object> context) processRefundResult
(DispatchContext dctx, Map<String, ? extends Object> context) processReleaseResult
(DispatchContext dctx, Map<String, ? extends Object> context) refundOrderPaymentPreference
(DispatchContext dctx, Map<String, ? extends Object> context) refundPayment
(DispatchContext dctx, Map<String, ? extends Object> context) releaseOrderPaymentPreference
(DispatchContext dctx, Map<String, ? extends Object> context) Releases authorization for a single OrderPaymentPreference through service calls to the defined processing service for the ProductStore/PaymentMethodTypereleaseOrderPayments
(DispatchContext dctx, Map<String, ? extends Object> context) Releases authorizations through service calls to the defined processing service for the ProductStore/PaymentMethodTyperetryFailedAuthNsfs
(DispatchContext dctx, Map<String, ? extends Object> context) retryFailedAuths
(DispatchContext dctx, Map<String, ? extends Object> context) retryFailedOrderAuth
(DispatchContext dctx, Map<String, ? extends Object> context) savePaymentGatewayResponse
(DispatchContext dctx, Map<String, ? extends Object> context) savePaymentGatewayResponseAndMessages
(DispatchContext dctx, Map<String, ? extends Object> context) storePaymentErrorMessage
(DispatchContext dctx, Map<String, ? extends Object> context) testCapture
(DispatchContext dctx, Map<String, ? extends Object> context) Test capture service (returns true)testCaptureWithReAuth
(DispatchContext dctx, Map<String, ? extends Object> context) testCCProcessorCaptureAlwaysDecline
(DispatchContext dctx, Map<String, ? extends Object> context) Always decline processortestProcessor
(DispatchContext dctx, Map<String, ? extends Object> context) Simple test processor; declines all orders < 100.00; approves all orders >= 100.00testProcessorWithCapture
(DispatchContext dctx, Map<String, ? extends Object> context) Simple test processor; declines all orders < 100.00; approves all orders > 100.00testRandomAuthorize
(DispatchContext dctx, Map<String, ? extends Object> context) Test authorize - does random declinestestRefund
(DispatchContext dctx, Map<String, ? extends Object> context) Test refund service (returns true)testRefundFailure
(DispatchContext dctx, Map<String, ? extends Object> context) testRelease
(DispatchContext dctx, Map<String, ? extends Object> context) verifyCreditCard
(DispatchContext dctx, Map<String, ? extends Object> context)
-
Constructor Details
-
PaymentGatewayServices
public PaymentGatewayServices()
-
-
Method Details
-
authOrderPaymentPreference
public static Map<String,Object> authOrderPaymentPreference(DispatchContext dctx, Map<String, ? extends 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 Map<String,Object> authOrderPayments(DispatchContext dctx, Map<String, ? extends 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 Map<String,Object> releaseOrderPayments(DispatchContext dctx, Map<String, ? extends 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
-
releaseOrderPaymentPreference
public static Map<String,Object> releaseOrderPaymentPreference(DispatchContext dctx, Map<String, ? extends 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
-
capturePaymentsByInvoice
public static Map<String,Object> capturePaymentsByInvoice(DispatchContext dctx, Map<String, ? extends 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 Map<String,Object> captureOrderPayments(DispatchContext dctx, Map<String, ? extends 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
-
captureBillingAccountPayments
-
storePaymentErrorMessage
-
processAuthResult
-
processCaptureResult
-
refundOrderPaymentPreference
-
refundPayment
-
processRefundResult
-
retryFailedOrderAuth
-
retryFailedAuths
-
retryFailedAuthNsfs
-
getCaptureTransaction
-
getAuthTransaction
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
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
-
checkAuthValidity
-
savePaymentGatewayResponse
-
savePaymentGatewayResponseAndMessages
-
processManualCcAuth
-
processManualCcTx
-
verifyCreditCard
-
testProcessor
public static Map<String,Object> testProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Simple test processor; declines all orders < 100.00; approves all orders >= 100.00 -
testProcessorWithCapture
public static Map<String,Object> testProcessorWithCapture(DispatchContext dctx, Map<String, ? extends Object> context) Simple test processor; declines all orders < 100.00; approves all orders > 100.00 -
testRandomAuthorize
public static Map<String,Object> testRandomAuthorize(DispatchContext dctx, Map<String, ? extends Object> context) Test authorize - does random declines -
alwaysApproveProcessor
public static Map<String,Object> alwaysApproveProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always approve processor. -
alwaysApproveWithCapture
-
alwaysDeclineProcessor
public static Map<String,Object> alwaysDeclineProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always decline processor -
alwaysNsfProcessor
public static Map<String,Object> alwaysNsfProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always NSF (not sufficient funds) processor -
alwaysBadExpireProcessor
public static Map<String,Object> alwaysBadExpireProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always fail/bad expire date processor -
badExpireEvenProcessor
public static Map<String,Object> badExpireEvenProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Fail/bad expire date when year is even processor -
alwaysBadCardNumberProcessor
public static Map<String,Object> alwaysBadCardNumberProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always bad card number processor -
alwaysFailProcessor
public static Map<String,Object> alwaysFailProcessor(DispatchContext dctx, Map<String, ? extends Object> context) Always fail (error) processor -
testRelease
-
testCapture
public static Map<String,Object> testCapture(DispatchContext dctx, Map<String, ? extends Object> context) Test capture service (returns true) -
testCCProcessorCaptureAlwaysDecline
public static Map<String,Object> testCCProcessorCaptureAlwaysDecline(DispatchContext dctx, Map<String, ? extends Object> context) Always decline processor -
testCaptureWithReAuth
-
testRefund
public static Map<String,Object> testRefund(DispatchContext dctx, Map<String, ? extends Object> context) Test refund service (returns true) -
testRefundFailure
-