tel: (902) 800-2321 sales@webfitters.ca

We blog a little about stuff...
 
     

Adding PayPal "Buy Now" buttons to DotNetNuke

By Gifford on 4/23/2016

Yup... it's true... the HTML PayPal generates does not work with DotNetNuke. 

Here is a sample of what PayPal creates:

<form target="PayPal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="XXXXXXXXXXX">

<table>

<tr><td><input type="hidden" name="on0" value="Choose Option">Choose Option</td></tr><tr><td><select name="os0">

            <option value="Option 1">Option 1 </option>

            <option value="Option 2">Options 2 </option>

            <option value="Option 3">Option 3 </option>

</select> </td></tr>

</table>

<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">

</form>



But this is what you'll need to change it to:

<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="
XXXXXXXXXX" />
<table>
    <tbody>
        <tr>
            <td><input type="hidden" name="on0" value="Choose Option" />Choose Option</td>
        </tr>
        <tr>
            <td><select name="os0">
            <option value="
Option 1">Option 1 </option>
            <option value="
Option 2">Options 2 </option>
            <option value="
Option 3">Option 3 </option>
           </select> </td>
        </tr>
    </tbody>
</table>
<input type="hidden" name="currency_code" value="USD" />
<p><input border="0" type="image" onclick="this.form.action='https://www.paypal.com/cgi-bin/webscr';this.form.submit();" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!" /> <img alt="" height="1" width="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" style="border-width: 0px; border-style: solid;" /></p>

Tah Dah!!

DotNetNuke Tips
PayPal
Author