PayPal Payments
This is an open discussion with 71 replies, filed under Extensions.
Search
Let you process and log transactions made with PayPal Website Payments Standard.
The extension includes:
- an event filter for hijacking and reroute standard Symphony events to Paypal.
- an event that allows you to reconcile data returned by PayPal’s Instant Payment Notification (IPN) system.
Get it now on Github. Please post any bugs in the issue tracker there as well.
Nice! I’m just about to release my PayPal/USPS/Cart extension.
Great! Look forward to testing it out.
I’ve been trying to give this paypal extension a whirl. I’m excited about its possibilities but seem to be stumped.
I have installed the plugin with no problems (at least I got that right). In system preferences I have my merchant email and have selected testing mode to go to my sandbox account at paypal. I tested the IPN to the page with the “Save IPN data” event and the PayPal IPN simulator tested positive. I’ve looked through the HTML Variables for Website Payments Standard and not seen anything that might be used.
I’m unclear on the form action that I need to include in my form. The readme file has <form action="" method="post">
. I thought perhaps the action was dynamically generated from the merchant account id value; however, if it is, my installation of the plugin does not seem to post correctly. Otherwise, I do not know what I should do next. Perhaps, my ignorance is glaring; but, any help anyone can give will be greatly appreciated.
@wjnielsen: Nice to see someone giving it a go :p
This extension works by hijacking standard Events after they’ve been saved and then sending data off to PayPal. The idea being that you want to store some data in Symphony (else you would just POST directly to PayPal).
You’ll need to create a normal Event and add the “Reroute to PayPal” filter to that event for it to work. Have you done that?
I should point that, if you want to, you can use still use the extension to save IPN data even if you’re not using it for doing the actual POST to PayPal.
Max,
That’s even better than what I initially understood the extension to be. I have not made an event yet but will now do that. Sorry to miss the obvious. I’ll keep you posted on how things go and thanks for the feedback here.
@wjnielsen: All good, it’s not immediately obvious or intuitive. I really need to find the time to put up a little tutorial.
Could this be extended to work as a cart system?
Using the session monster extension, I think so. Store cart contents in session,… I wonder wether the mahematics of adding cartitems, % tax,….and so on would then be best handled by php classes (or jquery) or in your xslt…
I wonder wether the mahematics of adding cartitems, % tax,…and so on would then be best handled by […] jquery
Never ever let javascript calculate important things in your shop.
@Max: I created an event called order_process in which I added the “PayPal Payments: Reroute to PayPal” filter rule.
I put the following submit button in the form:
<input id="submit" value="Submit This Order" type="submit" name="action[order-process]" />
This meets the criterion for the __load() method and invokes __trigger() which appears as such.
protected function __trigger(){ include(TOOLKIT . '/events/event.section.php'); return $result; }
When $result
(= new XMLElement(self::ROOTELEMENT) is returned from event.section.php
it is null.
Do I need to invoke the eventPaypal_payments_ipn Clas
s in /extensions/paypal_payments/events/event.paypal_payments_ipn.php
here in eventorder_process::__trigger()
?
While I’m experienced in PHP-OOP, this is my first event with Symphony so please feel free to cover basic things you think I might be missing.
@jean-luc: You could definitely extend it to use as a cart system—in its current form it only handles the transactions but you could certainly combine it with a cart extension and at the point of payment pass the information off to this extension.
@wjnielsen: You shouldn’t need to manually edit the Event
, the whole point is to avoid having to delve into PHP where we can. The Event Filter
should hook into the event process at two points from extension.driver.php
:
EventPreSaveFilter
which calls thecheck_paypal_preferences()
method before the save is attempted and checks you have a Business ID/Email set in the preferencesEventFinalSaveFilter
that calls theprocess_event_data()
method after the save is successfully completed and collates any data you’ve passed it and generates an auto-submitting HTML form to POST to PayPal.
Is the normal Event
save working without the “Reroute to PayPal” filter attached?
Is the normal Event save working without the “Reroute to PayPal” filter attached?
It does not seem to be to be saving. Could you help me understand what I’m doing wrong? Thanks much for any help anyone might give.
Here’s my XSL that makes the form:
<xsl:template name="paypal-payment"> <form id="payment-form" action="" method="post"> <div class="pay-invoice-number"> Invoice Number <br /> <input name="fields[invoice-number]" type="text" /> </div> <div class="pay-amount"> Amount Due on Invoice <br /> <input name="fields[amount]" type="text" /> </div> <div class="pay-first-name"> First Name <br /> <input name="fields[first-name]" type="text" /> </div> <div class="pay-last-name"> Last Name <br /> <input name="fields[last-name]" type="text" /> </div> <input name="paypal-payments[cmd]" value="_xclick" type="hidden" /> <input name="paypal-payments[notify_url]" value="{$root}/paypal/" type="hidden" /> <input name="paypal-payments[amount]" value="amount" type="hidden" /> <input name="paypal-payments[name]" value="first-name,last-name" type="hidden" /> <input name="paypal-payments[item_name]" value="invoice-number,$name" type="hidden" /> <xsl:call-template name="submit-button"> <xsl:with-param name="service" select="$name" /> </xsl:call-template> </form> </xsl:template> <xsl:template name="submit-button"> <xsl:param name="service" /> <div class="submit-button"> <input type="submit" name="action[save-entry]" value="Pay Now"> <xsl:attribute name="value">Pay for <xsl:value-of select="$service" /> </xsl:attribute> </input> </div> </xsl:template>
Here’s the “Pay Online” page:
Here’s the “Payment” Event tied to the above page:
EDIT: I just saw that <input name="paypal-payments[item_name]" value="invoice-number,$name" type="hidden" />
should be <input name="paypal-payments[item_name]" value="invoice-number,{$name}" type="hidden" />
Does it save correctly if you remove the filter from the Event
?
Does it save correctly if you remove the filter from the Event?
@Makenosound I don’t seem to be able to get the plugin to save anything or reroute to paypal. I downloaded your Sept/17/2009 version of the plugin, but still no luck. Any help you might give would be tremendously appreciated and compensated.
Can someone tell me if I am missing something. I have installed, the paypal extension. Created an empty page for paypal IPN, added the Paypal Payments: Save IPN Data Extension to it, put in my Sandbox Account ID under Preferences, Enabled Testing Mode, gave the Sandbox my URL (which is publicly available) via a subdomain, and used the IPN Simulator to send data to that URL. Do I need tho have form on that page, or create some kind of response XML, because I am not getting showing anything under the Paypal Transactions page. Any help is greatly appreciated. Thanks.
@bitfyre: When you’re going the test, do you have a value set for the invoice
field? Because the extension passes that as the reference to the id
of the entry created in Symphony, the “Save IPN data” event checks to see if it’s set before saving the details to the log.
Looking at the default fields the IPN Simulator generates, that it probably did have an invoice field. It was what ever the Simulator created. I did not set any values other than telling it what kind of transaction type to run. I also tried sending it with the invoice field blank.
On the site I am using this currently, I am only using the extension for the IPN functionality. There is no shopping cart ID, or anything along those lines being stored. I am sending the purchases directly to Paypal rather than using the Paypal Redirect Event. It was a bit overkill of this project to create a full shopping cart. Is it required to store that for IPN to work? I thought, based on the documentation that it wasn’t. Thanks for the help.
Create an account or sign in to comment.
A new Extension, “PayPal Payments” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.