Help Article

How do I update my API integration for Pro Hosted to account for the updated return URL?

If you've hard-coded the Pro Hosted Solution URL in your code instead of always reading the URL from the API response, you should be aware that PayPal has updated the return URL in the API response to also support the mobile template. To correct your integration, use the following instructions.

There are two options in the response to initiate the Hosted Solution payment flow.  
Using the URL returned in the response
In the URL identified in the response as EMAILLINK, add "src" for iFrame as per the following example to redirect the buyer and initiate the payment flow.
 
<iframe src="https://securepayments.paypal.com/...?hosted_button_id=HSSS-.." width="570px" height="540px"></iframe>

Example of TOKEN
 
EMAILLINK=https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?hosted_button_id=HSSS-GDrPDzuW- ADwkFDMjQmpUK1gTDdR.tv5alaGS6l.XWVVB1MTMQEnGNoLakufQb89zTjf6&HOSTEDBUTTONID =HSSS-GDrPDzuW-ADwkFDMjQmpUK1gTDdR.tv5alaGS6l.XWVVB1MTMQEnGNoLakufQb89zTjf6 &TIMESTAMP=2010-09-15T00:30:35Z&CORRELATIONID=2fc9a340a2356&ACK=Success &VERSION=65.0&BUILD=1500269

Example of ENCRYPTED
 
EMAILLINK=https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?cmd=_hosted- payment&business=idc%2dautomation%2duk%2dpro%2dt1%40paypal%2ecom&tax=2&shipping=3&business=K5HHZSMWMCN58&subtotal=11&handling=4&TIMESTAMP=2010-09- 15T00:39:06Z&CORRELATIONID=23d12ce1161f2&ACK=Success&VERSION=65.0&BUILD=1500269

Example of CLEARTEXT
 
EMAILLINK=https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?cmd=_hosted- payment&business=idc%2dautomation%2duk%2dpro%2dt1%40paypal%2ecom&tax=2&shipping=3&business=K5HHZSMWMCN58&subtotal=11&handling=4&TIMESTAMP=2010-09- 15T00:40:32Z&CORRELATIONID=64553e7c7c84&ACK=Success&VERSION=65.0&BUILD=1500269

Note: Be sure to read the URL from the EMAILLINK and not hard-code it.

 
Using form post
Identify the WEBSITECODE in the response and use the code to create a Pay Now button on your review page. When your buyer clicks the button, they'll be redirected to the PayPal hosted payment page.

Example for TOKEN
 
WEBSITECODE=<form action="https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/web flow/sparta/hostedSoleSolutionProcess" method="post">
<input type="hidden" name="hosted_button_id" value="HSSS-GDrPDzuW- ADwkFDMjQmpUK1gTDdR.tv5alaGS6l.XWVVB1MTMQEnGNoLakufQb89zTjf6">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_auto_billing_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt=" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

Example for ENCRYPTED
 
WEBSITECODE=<form action="https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/web flow/sparta/hostedSoleSolutionProcess" method="post">
<input type="hidden" name="encrypted" value="BEGIN PKCS7......END PKCS7"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_auto_billing_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt=" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

Example of CLEARTEXT
     
WEBSITECODE=<form action="https://securepayments.paypal.com/webapps/HostedSoleSolutionApp/web flow/sparta/hostedSoleSolutionProcess" method="post">
<input type="hidden" name="cmd" value="_hosted-payment">
<input type="hidden" name="business" value="test1@paypal.com">
<input type="hidden" name="tax" value="2">
<input type="hidden" name="shipping" value="3">
<input type="hidden" name="business" value="K5HHZSMWMCN58">
<input type="hidden" name="subtotal" value="11">
<input type="hidden" name="paymentaction" value="sale">
<input type="hidden" name="handling" value="4">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_auto_billing_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt=" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

Note: Be sure to read the URL from the WEBSITECODE and not hard-code it.

For more information on API integration, see the HSS Integration Guide (PDF document).
We’re sorry. The page you’re looking for is no longer available. To search again or contact us, please visit our Help Centre.