PIEdit URL

This URL changes the details of an existing payment instruction in an order.

URL

PIEdit

Controller command

com.ibm.commerce.edp.commands.PIEditCmd

Implementation class

com.ibm.commerce.edp.commands.PIEditCmdImpl

When you run the PIEdit URL with this class, the command cancels the existing payment instruction before the command creates the replacement payment instruction. The new instruction includes all of the new protocol data and the amount or currency, or both. To ensure that the new instruction includes the required payment information, specify all of the parameters for the URL, including the parameters that do not need updating.

Alternatively, you can use another implementation class for the PIEditCmd com.ibm.commerce.edp.commands.PIEditWithMergingProtocolDataCmdImpl When you use this class, the payment protocol data that is passed in with the URL is merged with the original data that is stored in the database. If you do not specify all parameters for the URL, this class uses the data in the database for the missing parameters to update the payment instruction.

Commands called

EditUnboundPITaskCmd

EditCmd

URL structure

http://host_name/path/

PIEdit command

Parameter values

orderId
Required: The identifier of the order for which the payment method is to be changed.
piId
Required: The numeric identifier of the payment instruction to modify. The piId can be obtained from the EDPPaymentInstructionsDataBean data bean and represents the combination of the payment method, payment amount, and any protocol data.
piAmount
The new amount in the order currency to be used for this payment instruction. The format of this number must fit the rules for a java.math.BigDecimal object. The number must use a period for a decimal place.
policyId
(Required if PayMethodId is not specified) The payment policy identifier. It is the primary key of the payment business POLICY table. (Table POLICY with column policytype_id = "Payment").
payMethodId
(Required if policyId is not specified) See Payment methods for supported methods.
protocolData
More name-value pairs that are separated by an ampersand (&) can be passed to the payment plug-in or payment processor as extra data that is required by that payment protocol. If an existing keyword is passed in, the value for the keyword is overwritten in the payment instruction.
forceFlag
The flag to indicate whether the payment method should be edited even though the target amount is less than the authorized amount or there is some deposited amount for the payment method. For these scenarios, a tickler is created to make sure that the CSR is notified. The default value is false.
paymentDataEditable
The flag indicates whether the payment protocol data should be edited by this request.
true
Payment protocol data should be edited by this request. The default value.
false
Payment protocol data should not be edited by this request.
amountEditable
The flag to indicate whether the payment method amount should be edited by this request. If piAmount parameter is provided and this flag is true, the amount is edited by this request. The default value is true.
purchaseOrder_id
The purchase order number that is specified to the order. This parameter is optional, if it is set, the value of the purchase order number is sent back to the response properties to be displayed in the page.
errorViewName
The view name that is redirected to when the execution fails. If this parameter is provided, the default error view name is PaymentInstructionErrorView.
billing_address_id
The billing address identifier.
paymentTCId
The payment term and condition identifier for this payment instruction. This parameter is used by the business customer.
valueFromPaymentTCId
The flag to indicate whether the payment protocol data should be extracted from the payment term. This parameter also indicates the condition that is identified by paymentTCId parameter and ignore any protocol data that is passed in the request properties.
true
Payment protocol data is extracted.
false
The default value. Payment protocol data is not extracted.
URL
The URL to be redirected when the command completes successfully.

Example 1

The following example changes the payment amount that is associated with the AMEX credit card payment method for order 112233. The payment policy identifier in POLICY table is -9803. The payment amount is changed to an amount of 75.01 USD for payment instruction 27022.


http://host_name/webapp/wcs/stores/servlet/PIEdit?orderID=112233&piId=27022&piAmount=75.01
&policyID=-9803&URL=/

Example 2

The following example changes the check routing number (due to a typographical error) for an electronic check transaction. Because the check routing number is supplied as protocol data, the &check_routing_number name-value pair is entered. The other protocol data that is not passed by PIEdit is kept the same as before.


http://host_name/webapp/wcs/stores/servlet/PIEdit?orderID=112233&piID=27023&policyID=-9803
&check_routing_number=999888776&URL=/

Behavior

Check whether the order is locked by the current CSR. If the order is not locked and called by a CSR, or if it is locked by another CSR, an exception is thrown

If the payment instruction to be edited is unbound, Call EditUnboundPITaskCmd (EDP command) to edit the unbound payment instruction. An unbound payment instruction for the order has only the information for the payment method and the payment policy. Otherwise:
  • Call EditCmd (EDP command) to edit the payment instruction
  • Examine the result of EditCmd and throw exception if the result is null or if there is error in the results.

Exception conditions

  • ECSystemException
  • ECApplicationException