Submission of order and payment method details
The initial XML request contains the order, with the payment method details. The identifier for the PayPal payment method is PAYPAL-SSL
. The PAYPAL-SSL method needs you to include three URLs:
-
successURL
- the shopper is redirected when the PayPal payment is complete and successful. You can choose a unique URL for each transaction to determine which order has been paid successfully. -
failureURL
- the shopper is redirected when the PayPal payment is complete but unsuccessful. You can choose a unique URL for each transaction to determine which order was refused. -
pendingURL
- the shopper is redirected when the 'authorised' result of a transaction isn’t immediately known. You can choose a unique URL for each transaction. -
cancelURL
- the shopper is redirected when the cancel or back to merchant on the PayPal pages is clicked. You can choose a unique URL for each transaction.
Below is an example of a PayPal order with payment method details request. In this example, the <shippingAddress>
and <billingAddress>
nodes are optional. By not including the address information, the transaction is designated as a 'guest checkout.' Shipping and/or billing address details are provided from the shopper’s PayPal account data.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE paymentService PUBLIC "-//RBS WorldPay//DTD RBS WorldPay PaymentService v1//EN" "http://dtd.wp3.rbsworldpay.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE">
<submit>
<order orderCode="jsxml3358509980">
<description>A test PayPal order</description>
<amount value="101" currencyCode="EUR" exponent="2"/>
<paymentDetails>
<PAYPAL-SSL intent="authorise">
<successURL>http://www.worldpay.com/support/index.php?example=true &result=successURL</successURL>
<cancelURL>http://www.bibit.com/support/index.php?example=true &result=cancelURL</cancelURL>
<pendingURL>http://www.bibit.com/support/index.php?example=true &result=pendingURL</pendingURL>
<failureURL>http://www.bibit.com/support/index.php?example=true &result=failureURL</failureURL>
</PAYPAL-SSL>
</paymentDetails>
<shopper>
<shopperEmailAddress>john.doe@worldpay.com</shopperEmailAddress>
</shopper>
<shippingAddress>
<address>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address1>Worldpay Ltd</address1>
<address2>270 Science Park</address2>
<postalCode>CB4 0WE</postalCode>
<city>Cambridge</city>
<state>Cambridgeshire</state>
<countryCode>GB</countryCode>
</address>
</shippingAddress>
<billingAddress>
<address>
<firstName>John</firstName>
<lastName>Doe</lastName>
<address1> 25 Walbrook</address1>
<postalCode> EC4N 8AF</postalCode>
<city>London</city>
<state>London</state>
<countryCode>GB</countryCode>
</address>
</billingAddress>
<shopperAdditionalData>
<birthDate>
<date dayOfMonth="21" month="08" year="1980"/>
</birthDate>
</shopperAdditionalData>
<orderLines>
<lineItem>
<reference>2</reference>
<name>Oranges</name>
<quantity>1</quantity>
<quantityUnit/>
<unitPrice>10000</unitPrice>
<taxRate>2500</taxRate>
<totalAmount>101</totalAmount>
<totalTaxAmount>101</totalTaxAmount>
</lineItem>
</orderLines>
</order>
</submit>
</paymentService>