Payment xC extension points

You can customize how HCL Commerce integrates with third-party payment gateways. Use these extension points to customize how HCL Commerce interacts with payment gateways to process payments during order capture.

The following table identifies the classes for punch-out payment commands that you can customize through an externalized customization extension.
Extension point Where the extension point is used Extension code implementation tips Request, Response formats Sample extension code location
approve_payment The checkout cart operation (POST cart/@self/checkout) calls the approve_payment extension point to authorize payment. The approve_payment extension code should return the updated financial transaction with its state set to 1 (pending) to initiate punch-out payment. PaymentApproveCmdUEInput,

PaymentApproveCmdUEOutput

The approvePayment method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
get_punchout_url The get punch-out payment information operation (GET cart/@self/payment_instruction/punchoutPaymentInfo) calls the get_punchout_url extension point to get the payment form URL. The get_punchout_url extension code should return the payment form URL. GetPunchoutURLCmdUEInput,

GetPunchoutURLCmdUEOutput

The getPunchoutURL method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
process_punchout_response The callback operation (POST cart/@self/payment_instruction/callback) calls the process_punchout_response extension point to process callback parameters from the payment service provider. The process_punchout_response extension code should call the payment service provider to verify the callback parameters, return the response parameters with the parameter "punchoutTranResult" set to "successful", "failed" or "invalid", and update the extended data of the payment instruction to include additional information. ProcessPunchoutResponseCmdUEInput,

ProcessPunchoutResponseCmdUEOutput

The processPunchoutResponse method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
For an example of registering the extension code and assigning the code to the extension point, see Enabling punch-out payment.
The following table identifies the classes for payment tokenization that you can customize through an externalized customization extension.
Extension point Where the extension point is used Extension code implementation tips Request, Response formats Sample extension code location
create_payment_token The add payment instruction operation (POST cart/@self/payment_instruction) or the update checkout profile operation (PUT person/@self/checkoutProfile) calls the create_payment_token extension point to create the payment token. The create_payment_token extension code should call the payment service provider to tokenize the payment information in the protocol data and return the payment token and its display value as the key-value pairs "payment_token" and "display_value" in the token data. CreatePaymentTokenCmdUEInput, CreatePaymentTokenCmdUEOutput The createPaymentToken method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
update_payment_token The update payment instruction operation (PUT cart/@self/payment_instruction) or the update checkout profile operation (PUT person/@self/checkoutProfile) calls the update_payment_token extension point to update the payment token. The update_payment_token extension code should call the payment service provider to re-tokenize the existing token data with the updated payment information in the protocol data and return the updated payment token and its display value as the key-value pairs "payment_token" and "display_value" in the token data. UpdatePaymentTokenCmdUEInput, UpdatePaymentTokenCmdUEOutput The updatePaymentToken method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
remove_payment_token The delete payment instruction operation (DELETE cart/@self/payment_instruction/{piId}) calls the remove_payment_token extension point to remove the payment token. The remove_payment_token extension code should call the payment service provider to remove the payment token (as the key-value pair "payment_token" in the token data) from its database. RemovePaymentTokenCmdUEInput, RemovePaymentTokenCmdUEOutput The removePaymentToken method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
approve_payment The checkout cart operation (POST cart/@self/checkout) calls the approve_payment extension point to authorize payment. The approve_payment extension code should call the payment service provider with the saved token data in the protocol data to process payment and return the updated financial transaction with its state set to 2 (success) or 3 (failed). PaymentApproveCmdUEInput, PaymentApproveCmdUEOutput The createPaymentToken method in workspace_dir/commerceue-app/src/main/java/com/ibm/commerce/order/ue/rest/PaymentResource.java
For an example of registering the extension code and assigning the code to the extension point, see Enabling payment tokenization.