XML Examples for Smart Button and URL Redirect Payment Flows
This section describes the various types of transactions when using the Smart Button and Redirect URL Payment Flows. For information on required XML elements and attributes, see XML Elements for Smart Button and Redirect URL Payment Flows.
After submitting an order modification request (cancel
, refund
, or capture)
for payments (intent=authorize)
, to see the expected result, you must run the /opt/ims/live/bin/cronscript.sh start nl.bibit.job.batch.BatchModificationProcessorJob
XML Input Examples
intent=capture
To capture a PayPal payment where intent=authorize
was submitted, submit an order modification of type capture
to complete the transaction.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="MERCHANT_CODE" version="1.4">
<modify>
<orderModification orderCode="">
<capture>
<amount value="100" currencyCode="GBP" exponent="2" debitCreditIndicator="credit"/>
</capture>
</orderModification>
</modify>
</paymentService>
cancel
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="MERCHANT_CODE" version="1.4">
<modify>
<orderModification orderCode="jsxml3326747697">
<cancel/>
</orderModification>
</modify>
</paymentService>
refund
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="NSSANDBOX1" version="1.4">
<modify>
<orderModification orderCode="jsxml3326747697">
<refund>
<amount value="100" currencyCode="EUR" exponent="2" debitCreditIndicator="credit"/>
</refund>
</orderModification>
</modify>
</paymentService>
Approve (required for PayPal Smart Button)
To approve an authorized order using the PayPal Smart Button, the onApprove
callback must be triggered from the SDK with an order modification request containing an empty approve
parameter.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//WorldPay//DTD WorldPay PaymentService v1//EN" "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="MERCHANT_CODE" version="1.4">
<modify>
<orderModification orderCode="">
<approve/>
</orderModification>
</modify>
</paymentService>