When is ReplacementPayment used?
When creating a replacement order, the customer should not be charged again. Instead, the replacement order should "inherit" the payment from the original order.
To make this process work without errors in the payment flow, a dedicated payment method must be configured:ReplacementPayment.
If this payment method is missing, the replacement order will fail with the following error:
Key: CapturePaymentError Details: The given key 'replacementpayment' was not present in the dictionary.
How to configure ReplacementPayment
- Go to the payment methods configuration. Configuration -> orders -> payment types
- Add the payment type
- Add the following object under with JSON or see the table below.
{
"name": "ReplacementPayment",
"paymentMethodName": "ReplacementPayment",
"providerName": "EmptyPayment",
"displayName": "ReplacementPayment",
"isEmptyPayment": true,
"displayInCart": false,
"editable": false,
"enableUpdateAuthorizationAmount": false,
"enableExtendAuthorizationTime": false,
"authorizationTimeInDays": 0,
"hidden": true,
"validOnMarkets": [],
"validForStores": [],
"disableTransactions": false,
"requiresCredit": false,
"isZeroOrLessCreditAllowed": false,
"isZeroOrLessCreditNotSentToProvider": false,
"readOnly": false,
"getDetailsFromProvider": false,
"properties": [],
"creditPriority": 0,
"capturePriority": 0,
"paymentProviderFee": 0
}
| Field | Value / Setting |
|---|---|
| Payment settings name | Replacement Payment |
| Payment method name | ReplacementPayment |
| Provider name | EmptyPayment |
| Display name | ReplacementPayment |
| Is empty payment | On |
| Hidden | On |
Important notes
providerNameis set to EmptyPayment since no actual payment transaction should be made.displayInCartis false so the method will not appear as an option at checkout.hiddenis true, meaning the method is only used internally for replacement processes.- This payment method should only be used when creating replacement orders.