Jump to content

Paypal payment method for ProcessWire shop


apeisa

Recommended Posts

Nope, nothing to do with subscriptions (just paying the shopping cart items through paypal).

Regarding IPN check, it does verifies from Paypal that payment was made and came from Paypal. I will add more checks there though, at least will validate that order sum wasn't altered at any point.

Link to comment
Share on other sites

Thanks apeisa

I ask about the subscriptions because I've just finished a site (not in PW) which sells diet plans. The plans continue for x number of months, and after initial sign-up require a payment to be taken once a month.

A lot of sites which sell a 'service' rather than a product will often require the payment to be a regular subscription rather than a one-off payment.

Regarding the IPN, Paypal sends all outcomes to the same URL, so it would be useful if the method could decipher whether the payment was successful, cancelled, pending etc.

Link to comment
Share on other sites

Well, Paypal has tons of different APIs and ways of doing things.

This one works like this:

1. Send regular form data to https://www.paypal.com/cgi-bin/webscr

2A. User pays (using paypal or using credit card through paypal - no need to login in that case)

2B. Or user cancels (then redirected to cancel url - it is different from success url)

3. After payment user returns to shop and their return is validated from paypal (that Paypal really has that kind of payment made)

It is very simple actually and 100% tied to shopping cart. Recurring payments would need something different to handle recurring subscriptions etc.

Link to comment
Share on other sites

Thanks for those 2 links. About bag-shop.ch, if I click on details for a bag, a new web page comes up with a bigger picture and more information. Is that all done with fields, so a field for each details of a bag ?

Link to comment
Share on other sites

The products variations are done using child pages. So even if only one product it's a child page. That makes thing simple. Note that the shop was done 2 years ago, the pw shop was still in alpha early and there was no repeaters yet. Also there a lot custom and only using the cart of pw shop.

Link to comment
Share on other sites

The products variations are done using child pages. So even if only one product it's a child page. That makes thing simple.

that's exactly how i did the Ohm Speakers store, and also another shop i'm working on;

i like this approach the best if the child products have a lot of their own images, and individual data/specs.

if it were a simpler product then repeaters would probably work ok and maybe be easier for the end user to understand..

Link to comment
Share on other sites

  • 5 months later...

I haven't had any need for shop since the site I build it two (or was it three) years ago. That's one reason that shop hasn't got any love from my side. I build this paypal module since it was requested so many times. It should work just fine.

I would like to build some of the components again, like better shopping cart, more general payment methods, independent checkout process etc, but not sure if I have time for it (especially since the need on e-commerce had been so little on my day job).

  • Like 3
Link to comment
Share on other sites

I would support you if any possible. Would love to have a stable shopping system on PW base (including, taxes, currencies, different porto, etc.). Maybe we could just start with making a list somewhere to collect stuff that needs to be included and stuff that could be included (like stripe checkout or stuff like this). What do you think?

Btw.: I really often need to implement a shop so this would be really great. Maybe we could even raise some money if this allows you to put more work into it :) (Going to write you a PM)

  • Like 6
Link to comment
Share on other sites

  • 2 weeks later...

I'm searching for different solutions.

SimpleCartJS (not secure because client side shopping cart without server side verification), Snipcart service (secured with product verification via url during checkout) or jQuery plugin smartcart...

Snipcart looks good. Simple to integrate into a website. But missing simple (pdf, email) invoice...

A nice solution could be a javascript framework like SimpleCartJS (add / remove item, show shopping cart and modify quantity of items) with (only) sendform checkout (send to PW backend to verify values and use defined checkout gateways). 

Link to comment
Share on other sites

  • 2 weeks later...

I love shop for processwire. So far it's coming along nicely. I'm trying to sell downloadable files and I have the shop working up to the point of going to paypal to process payment. I haven't gone further yet because I will need a way to deliver the product once paid for. I'm guessing the thank you return page Apeisa provides could be used to create a download link using the $session->order-id but...could it really be that easy?

  • Like 1
Link to comment
Share on other sites

I think you should take a look at PayPal's IPN (https://developer.paypal.com/webapps/developer/docs/classic/products/instant-payment-notification/)

Setting this up will allow you to set a field in PW to confirm that the user has definitely paid, then you could safely make use of their order-id by sending them an email with the order-id as a get variable in the URL. Your download script would then check the order-id and make sure the paid flag was set before initiating the download.

I use this script as a starting point for my ipn.php file

https://github.com/paypal/ipn-code-samples/blob/master/paypal_ipn.php

Just add:

include("./index.php"); 

at the top to bootstrap in PW and then inside: 

if (strcmp ($res, "VERIFIED") == 0) {

you can use the PW API to set the paid flag to true etc.

  • Like 3
Link to comment
Share on other sites

  • 4 months later...

I'm just testing the PayPal payment method, and when I click to return to the site from PayPal, Firefox gives me the following security message:

'Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party. Are you sure you want to continue sending this information?'

When the return page loads, it says 'error when validating your payment.'

The payment was in fact successful.

Just wondering if any kind person knows how I might avoid this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...