Menu

Send test APM orders

For test orders, send the same XML as you would in the production environment.

The test URL to send XML messages to is: https://secure-test.worldpay.com/jsp/merchant/xml/paymentService.jsp

Simulators and magic values

You can use a simulator or magic value to select a desired payment outcome:

  • In the simulator you can test the redirection of the shopper's browser and choose the payment outcome in a drop down

    Note: Not all APM providers support all browsers. The simulator may support a browser that is not supported by an APM.

  • You can send magic values in your XML request to bypass the simulator

Use the simulator

  1. Submit an XML order. Worldpay sends a reply containing a URL to redirect your browser.
    • Direct model: The simulator page is displayed.
    • Hosted model: The payment method selection page is displayed (unless you're bypassing it). Select the desired payment method to display the simulator page.
  2. Select the desired outcome from the Payment Outcome list and click Continue. Your browser is redirected to a result page.

Best practice: Do not use your browser's Back button to return to the simulator for the purpose of submitting another payment. Always submit unique orders using XML. Returning to the simulator page to submit a new payment may cause errors and result in reporting problems.

Use a magic value

A magic value represents a payment outcome, and skips the simulator. The shopper's browser is typically redirected to a payment result page.

Magic values are supported for:

  • SOFORT
  • AliPay
  • WebMoney
  • Paysafecard
  • Union Pay

Where to send a magic value

Specify a magic value in the <lastName> of <shippingAddress> or <billingAddress>. Below is an example order for the Hosted integration:

Copied!
<?xml version="1.0"?>
<!DOCTYPE paymentService PUBLIC "-//Worldpay//DTD Worldpay PaymentService v1//EN"
  "http://dtd.worldpay.com/paymentService_v1.dtd">
<paymentService merchantCode="DEMO" version="1.4">
  <submit>
    <order orderCode="YOUR_ORDER_CODE">
      <description>YOUR_DESCRIPTION</description>
      <amount currencyCode="EUR" exponent="2" value="7500"/>
      <orderContent>Order_Content</orderContent>
      <paymentMethodMask>
        <include code="ALL"/>
      </paymentMethodMask>
      <shopper>
        <shopperEmailAddress>ashopper@myprovider.com</shopperEmailAddress>
      </shopper>
      <shippingAddress>
        <address>
          <firstName>John</firstName>
          <lastName>PENDINGERROR</lastName> <!--Magic value for payment outcome-->
          <address1>Shopperstreet</address1>
          <address2>Shopperaddress2</address2>
          <address3>Shopperaddress3</address3>
          <postalCode>1234</postalCode>
          <city>Shoppercity</city>
          <countryCode>DE</countryCode>
          <telephoneNumber>0123456789</telephoneNumber>
        </address>
      </shippingAddress>
      <statementNarrative>STATEMENT NARRATIVE TEXT</statementNarrative>
    </order>
  </submit>
</paymentService>

Supported payment outcomes

You can specify one of these payment outcomes either in the simulator, or as a magic value:

Magic value in <lastName>Option in simulatorResult URLPayment status
AUTHORISEDAuthorisedSuccessAUTHORISED
CANCELLEDCancelledCancelSHOPPER_REDIRECTED

Note: Where supported by the APM, if you select Cancelled in the simulator, this instead produces a SHOPPER_CANCELLED status.

PENDINGERRORPending - errorPending (&status=ERROR)SHOPPER_REDIRECTED
PENDINGEXPIREDPending - expiredPending (&status=EXPIRED)SHOPPER_REDIRECTED
PENDINGFAILUREPending - failurePending (&status=FAILURE)SHOPPER_REDIRECTED
PENDINGOPENPending - openPending (&status=OPEN)SHOPPER_REDIRECTED
REFUSED (only works for Union Pay)Not authorisedNot authorisedREFUSED