I am new to Umbraco and content management systems, so please forgive my lack of knowledge. I have created a button through Paypal and attempted to embed it onto a content page on my website. The button looks perfect, however, when clicked it just refreshes the current page it is on.
I verified the button works by copying the text into notepad and saving it as an htm file. But, for whatever reason when I put the code in Umbraco it gets hung up. I have tried copying it onto the 'embed html' tab and directly into the html in the 'content' tab.
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
Code seems fine, but you said you've copied this piece of html in a rich text editor. I'm afraid it's the rich text editor which disallows some html tags from being saved to the db as is. Could you try adding this piece of code to the template instead of the rich text editor and see if that works?
If you want to make sure the rich text editor doesn't change the html being submitted, I'd go for a multiline textbox dataype instead of the rich text editor to make sure the html is saved as is
Thanks for the suggestions, Dirk! Unfortunately, I still can't get it to work. And now, the macros I had set up from Contour aren't working either. Any further suggestions?
I tried a lot of different options. Nothing worked. I had a developer look at it and he said that somehow after I was inputting the code, it was changing before it was posting causing it not to work. He had to rewrite code for the button. Sorry, I don't have a better answer for you, but if you discover one, let me know!
I had to do my first paypal integration a few weeks ago and I opted for this option and its works really well for my clients business model but not sure if it will suit you.
The following link is where i started, lots of good info and you can download the JS required and the following is the code...Using this method I could allow the cms user manage thier own title's, descriptions and price.
You can check the "Use in editor" checbox on the macro to get it to show up in the tinyMCE WYSIWYG editor on your content page. I would imagine that you could just add this macro to any text page that you wanted to display your products.
In my case i created a Doc type for the paypal page to list the items, i also created a template for the lessons and inserted the macro into the template..
Create the XSLT/Macro and check the use in editor checkbox
Create a new Text page (or whatever you default page type is)
Add the macro to your text page using the tinyMCE editor's add macro box.
Method 2
Create the XSLT/Macro named PaypalMacro
Create a new Template Called PaypalPageTemplage
In the markup of the masterpage add <umbraco:macro runat="server" alias="PaypalMacro" /> (This will render your macro on ANY page that uses this template)
Create a new Data type called PaypalPage and give it a default template of PaypalPageTemplate
On the content section, create a new document with the new type PaypalPage, it should have a default template of PaypalPageTemplate.
The advantage to method 1 is that it is quick and easy but if you are using a version control system, then you can't really dif the changes in your templates.
Typically I go for method 2, it allows me to edit my masterpages in Visual Studio and keep them under version control. But, I don't know of any technical reason why one of these methods would be better than the other.
Ok we need to see the pages live and the XSLT and a diagram of the structure round your paypal items, for instance i have
Home
-------- Vouchers
-------- ------------- Voucher item
-------- ------------- Voucher item
-------- ------------- Voucher item
Each item has a title, description and price. I get all the items via XSLT, bring back all the Voucher Items under the Vouchers document type...make sense?
Thanks! If you are testing on localhost, your paypal IPN notification won't work because Paypal won't be able to resolve the url for your return url. Just keep that in mind for testing.
Another thing to try is making a code block section (something that can take HTML and JS and use it as markup rather than actually displaying the "<"'s and such) in your doc type and template and paste the markup into that.
Embedding a Paypal Button
Hello,
I am new to Umbraco and content management systems, so please forgive my lack of knowledge. I have created a button through Paypal and attempted to embed it onto a content page on my website. The button looks perfect, however, when clicked it just refreshes the current page it is on.
I verified the button works by copying the text into notepad and saving it as an htm file. But, for whatever reason when I put the code in Umbraco it gets hung up. I have tried copying it onto the 'embed html' tab and directly into the html in the 'content' tab.
Any suggestions? The code is below.
Thank you!
Danielle
<form 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="9YVDX3RMZVGQE">
<table>
<tr><td><input type="hidden" name="on0" value="Registration Type">Registration Type</td></tr><tr><td><select name="os0">
<option value="Individual">Individual $10.00</option>
<option value="Member of Team (must have 2+ on your team)">Member of Team (must have 2+ on your team) $5.00</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="USD">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.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>
Hi Danielle,
Code seems fine, but you said you've copied this piece of html in a rich text editor. I'm afraid it's the rich text editor which disallows some html tags from being saved to the db as is. Could you try adding this piece of code to the template instead of the rich text editor and see if that works?
If you want to make sure the rich text editor doesn't change the html being submitted, I'd go for a multiline textbox dataype instead of the rich text editor to make sure the html is saved as is
Cheers,
/Dirk
Thanks for the suggestions, Dirk! Unfortunately, I still can't get it to work. And now, the macros I had set up from Contour aren't working either. Any further suggestions?
Resolved the issue, had to have someone rewrite the code, this is what they used:
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal"><input value="_s-xclick" name="cmd" type="hidden" /> <input value="0? /><input type=" name="on0? value=" type="hidden" /> <input value="USD" name="currency_code" type="hidden" /></form><form method="post" action="https://www.paypal.com/cgi-bin/webscr"><input value="_s-xclick" name="cmd" type="hidden" /> <input value="9YVDX3RMZVGQE" name="hosted_button_id" type="hidden" /> <input name="on0" value="Registration Type" type="hidden" />Registration Type <select name="os0"> <option value="Individual">Individual $10.00</option> <option value="Member of Team (must have 2+ on your team)">Member of Team (must have 2+ on your team) $5.00</option> </select> <input value="USD" name="currency_code" type="hidden" /> <input alt="PayPal - The safer, easier way to pay online!" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynow_SM.gif" name="submit" type="image" border="0" /> <img src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" height="1" width="1" border="0" /></form>
Danielle
where do you put this code? on the html editor? or you created a Macro?
because I pasted the code on the html editor and didn't work.
I have the same issue
Hi MMM,
I tried a lot of different options. Nothing worked. I had a developer look at it and he said that somehow after I was inputting the code, it was changing before it was posting causing it not to work. He had to rewrite code for the button. Sorry, I don't have a better answer for you, but if you discover one, let me know!
Thanks,
Danielle
Hey Danielle,
I had to do my first paypal integration a few weeks ago and I opted for this option and its works really well for my clients business model but not sure if it will suit you.
http://www.davidorrgolfcoaching.com/buy-golf-coaching-vouchers.aspx
If you need more info give me a shout.
Stephen
Stephen
I love it is perfect!! - would you share what you did - code and everything, I'm new with Umbraco.
Thank you
MMM
Hey Stephen,
Your site looks great! I would agree with MMM that I would love to see how you accomplished that.
Thanks!
Danielle
The following link is where i started, lots of good info and you can download the JS required and the following is the code...Using this method I could allow the cms user manage thier own title's, descriptions and price.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE
xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
exclude-result-prefixes="msxml
umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes
Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings
Exslt.ExsltSets ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<div>
<br class="clearit"/>
<h2>Available lessons</h2>
<br class="clearit"/>
<!--
=============================================================
For Each child node of the currentpage
=============================================================
-->
<xsl:for-each select="$currentPage/* [@isDoc]">
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="emailaddressopaypalacount"/>
<input type="hidden" name="item_name" value="{lessonTitle} {lessonDescription}" />
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="amount" value="{lessonPrice}"/>
<input type="hidden" name="currency_code" value="GBP"/>
<input type="hidden" name="display" value="1" />
<input type="submit" name="submit" value="Purchase {lessonTitle} Voucher" class="purchasebutton" />
</form>
<h3><xsl:value-of select="lessonTitle" /> / <em>£<xsl:value-of select="lessonPrice" />.00</em></h3>
<p><xsl:value-of select="lessonDescription" /></p>
<br class="clearit"/>
<hr class="hr1" />
<br class="clearit"/>
</xsl:for-each>
</div>
</xsl:template>
</xsl:stylesheet>
You will also need the follwing JS at the top of your page/template...
<script src="/scripts/minicart.js"></script>
<script type="text/javascript">
PAYPAL.apps.MiniCart.render({
displayEdge: 'right',
edgeDistance: '10px',
peekEnabled: 'true'
});
</script>
Hope this helps.
Stephen
Stephen I created the sxlt file
when I go to the content make a new page to insert the macro I can't see the macro.
My temples are Master page and text page, where should I insert the script.?
Thank you
You can check the "Use in editor" checbox on the macro to get it to show up in the tinyMCE WYSIWYG editor on your content page. I would imagine that you could just add this macro to any text page that you wanted to display your products.
In my case i created a Doc type for the paypal page to list the items, i also created a template for the lessons and inserted the macro into the template..
<umbraco:Macro Alias="DoLessonVoucherList" runat="server"></umbraco:Macro>
The macro was available from the dropdown list on the Umbraco UI.
Did you remember to check the checbox for creating a macro when you created the XSLT?
S
Justin/Stephen
I did what Justin said - Now I see the macro - when I preview I can see Available lessons. That's all
This is what I did:
* created an sxlt - that creates the macro also-
* created a template( paypal) and paste the script also I ad the micro there.
Then created a page - Pay now- then insert the macro.
did I do to many things? what I'm missing?
Thank you - MMM
You really have two ways of solving this problem.
Method 1
If your only seeing "Available lessons" then there is going to be an issue with your XSLT, its not finding the items...
S
because you put the elements in a doc file?
would you show me the doc file?
Tks
MMM
I did all the steps that Justin said and I got the same results
then, I did the way Stephen said with the document type (How do I integrated the data?)
I created a tab to put the info, but still no displying the results
I don't want to give up!!!
I want to see it working
Thank you MMM
Ok we need to see the pages live and the XSLT and a diagram of the structure round your paypal items, for instance i have
Home
-------- Vouchers
-------- ------------- Voucher item
-------- ------------- Voucher item
-------- ------------- Voucher item
Each item has a title, description and price. I get all the items via XSLT, bring back all the Voucher Items under the Vouchers document type...make sense?
S
Thank you for all your help:))
MMM
You should mark up the post as answered, can be helful to others...and High five the posts that helped solve it :-)
S
I did!!, I gave you many fives - and also to Justin. (for your time and effort )
I do not know how this works is my first time.
I have to tell you that I couldn't get it to work, I cheat I link the html - But I'm going to keep working on it.
I'm working on a localhost site, I don't think that is the problem.
Maybe is the script I put it on the PaypalPageTemplate after the macro.
You guys are great for your support.
MMM
Thanks! If you are testing on localhost, your paypal IPN notification won't work because Paypal won't be able to resolve the url for your return url. Just keep that in mind for testing.
Yes, Once I display the items I'll work on the page
Thank you
Another thing to try is making a code block section (something that can take HTML and JS and use it as markup rather than actually displaying the "<"'s and such) in your doc type and template and paste the markup into that.
is working on a reply...