ccrz.cc_hk_Payment.processPayment
Prepares transaction payment data during checkout, and passes that payment information
to the ccrz.cc_hk_Order.createTransaction method. This
method also provides an extension point for implementing validation of a custom payment type.
This method supports Apex callouts.
Compatibility
This reference applies to:
Release | Managed Package Version | API Version |
---|---|---|
B2B Commerce for Visualforce Winter ’21 | 4.13 | 12 |
B2B Commerce for Visualforce Spring ’20 | 4.12 | 11 |
B2B Commerce for Visualforce Summer ’19 | 4.11 | 10 |
B2B Commerce for Visualforce Spring ’19 | 4.10 | 9 |
B2B Commerce for Visualforce Summer ’18 | 4.9 | 8 |
Signature
global virtual Map<String, Object> processPayment(Map<String, Object>)
Inputs (Required)
Map<String, Object> that must include the following required keys:
- ccrz.cc_hk_Payment.PARAM_CART
- ccrz__E_Cart__c record that's being converted to an order.
- ccrz.cc_hk_Payment.PARAM_TRANSACTION_DATA
- JSON-formatted string of transaction payment properties and their values, which the ccrz.cc_hk_Payment.deserializeTransactionParams method parses into a ccrz.cc_hk_Payment.TransactionPaymentParams object.
Logic Performed
This method completes the following actions:
- Sets the transaction payment's amount based on the cart's ccrz__TotalAmount__c value.
- Evaluates the transaction input data's accountType and sets the ccrz.cc_hk_Payment.PARAM_ACCOUNT_TYPE key.
- Invokes the ccrz.cc_hk_Payment.getPaymentProcessor method for returning the ccrz.ccPaymentProcessor configured for the specified accountType.
- Invokes the ccrz.ccPaymentProcessor.preProcess method for handling any Apex callouts for the specified accountType. If the transaction's input data specified a storedPaymentId, this method sets the ccrz.cc_hk_Payment.PARAM_STORED_PAYMENT key in the input map for ccrz.ccPaymentProcessor.preProcess.
Outputs
Map<String, Object> that can include the following keys:
- ccrz.cc_hk_Payment.PARAM_ACCOUNT_TYPE
- String, based on the input data's accountType, that specifies the transaction's method of payment, such as purchase order (PO), credit card, and so on. This value is passed to the ccrz.ccPaymentProcessor.preProcess method.
- ccrz.cc_hk_Payment.PARAM_PAYMENT_PROCESSOR
- ccrz.ccPaymentProcessor instance configured for the specified accountType, which the ccrz.cc_hk_Payment.getPaymentProcessor method returned.
- ccrz.cc_hk_Payment.PARAM_TRANSACTION_DATA
- A copy of the original input ccrz.cc_hk_Payment.PARAM_TRANSACTION_DATA.
- ccrz.cc_hk_Payment.PARAM_TRANSACTION_PROCESSED_DATA
- ccrz.cc_hk_Payment.TransactionPaymentParams object that represents the original input ccrz.cc_hk_Payment.PARAM_TRANSACTION_DATA, updated with the cart's amount set.