FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Oct 2, 2016, 6:13 PM
6 Posts

XPage with PayPal Integration

  • Category: Debugging
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: Xpages Issue - Urgent,Paypal?
  • Replies: 1

Hi

I have a Registration.xsp xpage and I have the PayPal button code to place on my xpage. However, when I place it on my xpage, nothing happens. I know I am doing something silly. Can a XPage guru please take a look at this and help me? I need to get this page up and running by tomorrow AM.

Thank you so much in advance for your help!

Best Regards & THANK YOU

SW

Code from PayPal for Buy Now button:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="xxxxxxxxxxxx">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>

 

Code Pasted in Registration.xsp Xpage in the source:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

<xp:form id="form1">
register
    <xp:div>
        <xp:this.onclick><![CDATA["https://www.paypal.com/cgi-bin/webscr"]]></xp:this.onclick>
        <form action="https://www.paypal.com/cgi-bin/webscr"
            method="post" target="_top">
            <input type="hidden" name="cmd" value="_s-xclick">
                <input type="hidden" name="hosted_button_id"
                    value="xxxxxxxxxxxx">
                    <input type="image"
                        src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif"
                        border="0" name="submit"
                        alt="PayPal - The safer, easier way to pay online!">
                    </input>
                </input>
            </input>
        </form>
    </xp:div>

</xp:form>
</xp:view>


 

 

Oct 3, 2016, 9:06 AM
589 Posts
hmmm

I don't know....  some thoughts...

 

I don't know what this form action in the paypal example is supposed to do.  I've never seen that.  In your XPages example you're using both an xp:form and then inside another form tag.  This seems odd to me.  I don't think I've ever used "xp:form" as a tag before.  Since that's automatic for an XPage you might need to first disable auto generation if you want to control it yourself.    And you've nested a form within a form....  That might not be a good thing....

So no real answers just a couple thoughts to focus on the use of the form tags.  I wonder if you go down this route if you should put the paypal stuff in an iframe...  try and seperate it from xpages that way.

Also I THINK paypal has different options... like REST services.  That might be a better path in the long run.  Not sure though.

This is a great question with good details.  You might have better luck posting this on StackOverFlow and use the tag "xpages".

 

Dave

 

 


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.