When the payment system receives a request for a PayPal payment, the system attempts to place the order with PayPal. If this order placement process works, the system replies with a response similar to this example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//Bibit//DTD Bibit PaymentService v1//EN" "http://dtd.bibit.com/paymentService_v1.dtd">
<paymentService version="1.4" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
<reply>
<orderStatus orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
<reference id="1234567">
https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=EC-17R85556UM0189721
</reference>
</orderStatus>
</reply>
</paymentService>
The reply includes the order code, a unique numeric reference to the order, and a redirection URL for PayPal. It is up to you to redirect the shopper to this URL. Note that the ampersands (&) in URLs are escaped with SGML entities. The escapes allow you to include the ampersands in XML messages and must be converted back into the plain & sign by you in order to create a valid URL and ensure the redirect is correct.
If the initial attempt to place the order with PayPal fails, the system replies with a response similar to this example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE paymentService PUBLIC "-//Bibit//DTD Bibit PaymentService v1//EN" "http://dtd.bibit.com/paymentService_v1.dtd">
<paymentService version="1.3" merchantCode="MERCHANT_CODE"> <!--Will contain the merchant code used in the request-->
<reply>
<orderStatus orderCode="ORDER_CODE"> <!--Will contain the order code used in the request-->
<error code="7">
<![CDATA[No response received from PayPal]]>
</error>
</orderStatus>
</reply>
</paymentService>
Guide feedback?
Email us at: guides@worldpay.com |
![]() ![]() ![]() ![]() ![]() |
© Worldpay 2018. All rights reserved. |