paypal

This is an open forum for any mojoPortal topics that don't fall into the other categories.

This thread is closed to new posts. You must sign in to post in the forums.
10/31/2012 9:57:13 AM
Gravatar
Total Posts 37

paypal

Hi -

I created a button in Paypal and I am having difficulty making the changes need to work in my.

Here is button code paypal generates for me:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHXwYJKoZIhvcNAQcEoIIHUDCCB0wCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAWk8Hq5PHpqyZ3jHvb5mG5I2prbDWvNKULq7PgnSenj4qFDtikPcY6N014gw43xV+KNHj8DpL3ISrv+oImQjH5ZL5/4cbmzg6oOEfKVjC4x9vs7fQz3AUltbsQzg8tTzfLTSGw5us7vBn1aeZyP+gRUZa3U2Yr+tXh5OfKvVOUPzELMAkGBSsOAwIaBQAwgdwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIgvLdTMBtRhWAgbi07ZImnblSJddWW9KQD25W8BIMsuyMz2ZOtjsfaYanovE9Idc5sr32vuvKTYNicRob7K3eHMJsDBs7ax8gAC2xG/xdJvlq1XSff9a6NU6qmnDrCS3GcZ1t1aTujjG2WLk3jDI9I2eIH6iYMOb73YC7KXBUWmIPKehmkwk8A7bO2ruOsQEhg53pju0G6/zQyR8RVZUL+CjcvPyygWhwsX1CJAlZgz9gvd5+6ijsZm/8gr20CHpnzMcPoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYD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Xa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTIxMDMxMTQzNjA3WjAjBgkqhkiG9w0BCQQxFgQUtprWT2wnKFoGaqdohv1TS7DikLcwDQYJKoZIhvcNAQEBBQAEgYBMJAdNGmVH7JNjbYwS124oUTZKuDni8YHIzYBdPnuNEbMwVNqkd9uIDiO0tyvS2o3uFmE1/QqEleYg8R/NLqmpXrod2z9BaTKaazH6a8Ys+cLn0pEBHwAa7/Jjw7DAz6PHI5Xgdtvi9+UHIHpz2yIEf1R6ohaAmhjn7FezODE69w==-----END PKCS7-----
">
<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!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

 

Here is the code template provided by: http://www.mojoportal.com/building-a-simple-paypal-buy-now-feature.aspx

<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SAU3LV6DTEPXJ"><img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt="Donate" /></a>

Can anyone help me figure out what goes where?

10/31/2012 10:51:32 AM
Gravatar
Total Posts 18439

Re: paypal

You can't do it using the html content feature, only a link will work there, paypal can also generate a link suitable for email and you could use that, but to use the form elements you would need to create a custom feature PayPalButton.ascx file with the following code:

<%@ Control Language="C#" ClassName="PayPalBuyNow.ascx" Inherits="mojoPortal.Web.SiteModuleControl" %>

<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>
<%@ Import Namespace="mojoPortal.Web.Editor" %>
<%@ Import Namespace="mojoPortal.Net" %>

<script runat="server">
// Author: Joe Audette
// Created: 2010-12-14
// Last Modified: 2010-12-14

protected string HostedButtonId = "XXXXXXXXXX"; // your PalPal Generated value for hosted_button_id
private string buttonImageUrl = "https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif"; // or donate button https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif
private string payPalPostUrl = "https://www.paypal.com/cgi-bin/webscr"; // you shouldn't need to change this

protected void Page_Load(object sender, EventArgs e)
{
LoadSettings();
}

private void LoadSettings()
{
Title1.Visible = !this.RenderInWebPartMode;
if (this.ModuleConfiguration != null)
{
this.Title = this.ModuleConfiguration.ModuleTitle;
this.Description = this.ModuleConfiguration.FeatureName;
}

btnPayPal.ImageUrl = buttonImageUrl;
btnPayPal.PostBackUrl = payPalPostUrl;
}

</script>

<portal:OuterWrapperPanel ID="pnlOuterWrap" runat="server">
<mp:CornerRounderTop id="ctop1" runat="server" EnableViewState="false" />
<portal:InnerWrapperPanel ID="pnlInnerWrap" runat="server" CssClass="panelwrapper papalmodule">
<portal:ModuleTitleControl id="Title1" runat="server" EnableViewState="false" />
<portal:OuterBodyPanel ID="pnlOuterBody" runat="server">
<portal:mojoRating runat="server" ID="Rating" Enabled="false" />
<portal:InnerBodyPanel ID="pnlContent" runat="server" CssClass="modulecontent">

<p>You can hard code the html description here.</p>

<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value='<%= HostedButtonId %>'>

<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHXwYJKoZIhvcNAQcEoIIHUDCCB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cmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTIxMDMxMTQzNjA3WjAjBgkqhkiG9w0BCQQxFgQUtprWT2wnKFoGaqdohv1TS7DikLcwDQYJKoZIhvcNAQEBBQAEgYBMJAdNGmVH7JNjbYwS124oUTZKuDni8YHIzYBdPnuNEbMwVNqkd9uIDiO0tyvS2o3uFmE1/QqEleYg8R/NLqmpXrod2z9BaTKaazH6a8Ys+cLn0pEBHwAa7/Jjw7DAz6PHI5Xgdtvi9+UHIHpz2yIEf1R6ohaAmhjn7FezODE69w==-----END PKCS7-----
">

<asp:ImageButton id="btnPayPal" runat="server" />
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">

</portal:InnerBodyPanel>
<portal:EmptyPanel id="divFooter" runat="server" CssClass="modulefooter" SkinID="modulefooter"></portal:EmptyPanel>
</portal:OuterBodyPanel>
<portal:EmptyPanel id="divCleared" runat="server" CssClass="cleared" SkinID="cleared"></portal:EmptyPanel>
</portal:InnerWrapperPanel>
<mp:CornerRounderBottom id="cbottom1" runat="server" EnableViewState="false" />
</portal:OuterWrapperPanel>

And you would then install it in your site as described in the Hello World article.

Hope that helps,

Joe

10/31/2012 1:31:14 PM
Gravatar
Total Posts 37

Re: paypal

Thanks for the help, Joe, you are the greatest!

10/31/2012 2:12:47 PM
Gravatar
Total Posts 18439

Re: paypal

Thank you for the beers! Much appreciated!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.