This topic is locked

PayPal Event

12/6/2013 9:34:12 PM
PHPRunner General questions
C
cjsaputo author

I have not seen a topic similar to this so I am asking.
I need to create an Event after Save. The Save is adding a member registration, no product sale. I created a PayPal "Buy Now" button and pasted the code into the PHP event. The code is below:
<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="encrypted" value="-----BEGIN PKCS7-----MIIHTwYJKoZIhvcNAQcEoIIHQDCCBzwCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYAUt5IAaon/9hpMuc0QGrn4k0jB1L1/2FS76iTMno9yr51UW+C9llAZ5yfo6GlSOWcRY6VLWXRzM8oxLw51MK5/+6xFa2MlixhypznMAZpBTCiUs4FMOgFd+y87ZtgL6OsLEMxmqWwhakWPL0pbqJwSNIXsjGJdM6bXUXFm+YOwfTELMAkGBSsOAwIaBQAwgcwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIiu8O89FSHOyAgajvhqJ27eZd0v6lDy+NO/UV8kIqZKgsIKF3ZoJ1X/S1TftZnTx8LZTehlblRoIowuqeZhOmhd+3BPp/ahqU2SRVHAZV7+cQ1nr1rmP4RrNBikRkVm107ZIUhxEx49uQF5t800+99E51q5SAyMrTDg6mHlQyDYdRsKgfcqIHsubIb1sqkpBWijPGK5PIZ9BaUj4SqgHSrlLDu2n06uFrcIKaq9aOtDz0oa+gggOHMIIDgzCCAuygAwIBAgIBADANBgkqhkiG9w0BAQUFADCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20wHhcNMDQwMjEzMTAxMzE1WhcIH">

<input type="image" src="https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21711&image=1&table=forumtopics"; border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

<img alt="" border="0" src="https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21711&image=2&table=forumtopics"; width="1" height="1">

</form>
I assume this cannot be pasted directly, but how is it done. As you can see the last two "input" lines have to do with the PayPal button, which I don't need.
There is a "Save" button on the registration screen, which after selecting I want to send the user to PayPal to process; don't care if they come back.
Any help would be greatly appreciated.

Sergey Kornilov admin 12/7/2013

What you have created is HTML code that displays a button. You cannot use it for redirect purposes. What you need to create is a Paypal link meant to be sent via email. This is the link where you can redirect user in your AfterAdd/AfterEdit event.
More info:

https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/buynow_buttons/#id08A2GD00K2L