Post by jyoz » Tue Aug 12, 2008 7:00 am

Hello,

this is my first post.

I absolutely love how OpenCart's flexibility... but I'm having problems with the PayPal function.
I'm using the default paypal module  included with OpenCart (7.7).

Here's my question is their anyway to get the shopping cart to process the order and send it to the admin area (database) and then after that's done create a PayPal button worth the ammount of the order.

an example of this would be Shop Script Free
(http://www.shop-script-demo.com/free/index.html)

if you visit the demo and you will see that it submits the orders first and afterwards it creates a PayPal pay now button.

all one would have to do is manually verify that each order has been payed.

Thanks

Newbie

Posts

Joined
Tue Aug 12, 2008 6:55 am

Post by Qphoria » Tue Aug 12, 2008 7:31 am

Normally, once you place the order, an ecommerce store should forward you to paypal. I haven't tested with OpenCart's payment gateway yet, but that would be the most intuitive for me.

As far as what you want to do. It sounds like its just a javascript button that enables a pay now button. Search google for javascript onClick to learn how that works.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jyoz » Tue Aug 12, 2008 7:42 am

What i'm trying to do is to make a copy of the COD module so that the order is submited, but then i'm trying to get it to produce a code with a pay now button for paypal. The thing is that upon processing orders the cart and contents are cleared.

and im not sure on how to do it.

Newbie

Posts

Joined
Tue Aug 12, 2008 6:55 am

Post by Luvz2drv » Tue Aug 12, 2008 11:34 am

why make work like that...  use the current paypal - edit the controller to run the process order

downfalll  cust leaves with out paying - unpaid order

cust wants to change something....  not able to as then items are cleared from the cart.

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by Qphoria » Wed Sep 17, 2008 12:26 am

jty wrote:
Here's my question is their anyway to get the shopping cart to process the order and send it to the admin area (database) and then after that's done create a PayPal button worth the amount of the order.
I would also like this for a strange reason. I am not using Paypal but my payment gateway works similar to Paypal.
I would like to have Open Cart process the order first and then present a payment button that sends the order details (a few variables) to my payment gateway.
Here is an idea I was toying around with in my Authorize.net SIM module, which also works like paypal (i.e. customer is sent to a 3rd party pay site, and then returned).

Using the OpenCart paypal method (before IPN), which is to put the order into a temp table (order_data), send the customer to paypal, and pop the order back out when the payment is made and the user returns back to your site. If the customer never clicked the "Click here to complete the order" link on the paypal site, it would leave the customer with less money, and the store owner would have no order as it would have never been completed from the temp table.

But now there is IPN for paypal, which responds as soon as the payment is made instead of waiting for the user to go back.

Unfortunately Authorize.net SIM doesn't have an IPN style method, and is using the old method of requiring the customer to click the final button to return, which can lead to the same problem with the non-IPN paypal.

One idea I had to fix this would be to put the order into the real order table with a "unconfirmed" or "pending payment" state. This would at least record the order and let the store owner know that the customer either didn't pay yet, or paid but didn't click the final button. Then they could take administrative actions to either contact the customer or check their paypal account to see if the order was indeed paid for.

The bad side of that idea tho is that if the customer leaves and comes back during the confirmation step, you could get multiple orders being set for his one order. But its better than losing it altogether.
jty wrote: I have modified the PayPal module to work with my payment gateway but I have a Firefox security warning that I want to get rid of. IE is fine.
That's odd. I usually see warnings in IE.. never in FF

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Sep 17, 2008 8:42 am

Yer, it's Firefox this time  ::) Soon we'll have Chrome to deal with as well ::)
One idea I had to fix this would be to put the order into the real order table with a "unconfirmed" or "pending payment" state. This would at least record the order and let the store owner know that the customer either didn't pay yet, or paid but didn't click the final button. Then they could take administrative actions to either contact the customer or check their paypal account to see if the order was indeed paid for.
This is what I'm after. The way the payment modules are being written (for other carts too) is to record the order "after" payment. This is good if all things go well but if a glitch happens eg the payment gateway site is down, the site owner doesn't know there was an order.

If the order is recorded "before" going to the payment gateway, we can at least pick up the phone and ring the customer to take corrective action in the event of a glitch.

I'm working on a very dirty hack to record the order "first". It's not pretty but I'd rather ugly and working than pretty and not working. I can see that it shouldn't be hard but not being a programmer makes things hard  :D

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Qphoria » Wed Sep 17, 2008 9:07 am

My upcoming authorize.net module has a configurable option to do it both ways, at the store owners discretion. It really isn't too hard, just clone the code used during the processorder function and put it on the order confirmation page.

The best way would be to be able to submit the order to the database when the confirm order button is pressed. But unfortunately, that button has to submit a different form to the authorize.net site. The only way to submit 2 forms from one button is javascript. But then if the customer has javascript disabled, it won't send anything. Then again, OpenCart in its current state does not fully support non-jscript shopping anyway, so it might not be a big deal, but I'm on the fence.

For now, I set to save the order when you load the confirmation page, and use the ref num to track it.

-EDIT-
Now that I think about it, perhaps the confirmation page could be pointed to POST to itself, and there in the isPost section I could put the save to database code, followed by the form for the creditcard payment set there. But I'd still need to submit the form and that would need javascript.

Could also use an iframe... to make it look like they are still there. Decisions, Decisions.
Last edited by Qphoria on Wed Sep 17, 2008 9:14 am, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Wed Sep 17, 2008 10:45 am

jty wrote: I don't like iframe. I don't know why I don't like iframe but I don't like iframe.
Its true.. iframe is the overused bastard child of the early internet. But when options are limited, perhaps modern styling can assist in covering its eyesorishness

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 4 guests