Jump to content
Harald Ponce de Leon

PayPal App for osCommerce Online Merchant

Recommended Posts

4 hours ago, azpro said:

Actually I think an ordernumber should be created on chekcout_payment.php and order should be stored in DB immediately at checkout_process.php

Why?  You don't process the payment until after checkout_confirmation.  I.e. you wouldn't send the order number to the payment processor until after checkout_confirmation.  The checkout payment page doesn't need an order number, as it only collects data from the customer, not the payment processor. 


Always back up before making changes.

Share this post


Link to post
Share on other sites
10 minutes ago, ecartz said:

You don't process the payment until after checkout_confirmation.

Offcourse - that's why

10 minutes ago, ecartz said:

order should be stored in DB immediately at checkout_process.php 

 

10 minutes ago, ecartz said:

you wouldn't send the order number to the payment processor

We do - And I can tell you it has saved us a significant number of phonecalls - AND clicking between Payment provider back to Checkout. It seems people are confused if on the payment-page of for example a bank there is no direct referall to the order (in this case the order number). In fact - if I do online purchases myself I am reluctant if it only gives a general desciption like "Purchase online at ZZZZ-shop" at Payment Porcessor / bank.

 

Edited by azpro

Share this post


Link to post
Share on other sites

@azpro

44 minutes ago, ecartz said:

you wouldn't send the order number to the payment processor until after checkout_confirmation

He's agreeing (mostly), just not with the reason for creating the order on checkout_payment.

Actually in the current system the order gets created when checkout_payment is confirmed, at the top of checkout_confirmation, and if you go back to checkout_payment the order gets deleted again. Which is where this whole discussion started...


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

@BrockleyJohn  Thanks! I was kind of jumping in without reading all posts ... My bad 😉

But I didn't mean / say to create the whole ORDER but only the Order Number (order_id) on checkout_payment. 

Share this post


Link to post
Share on other sites

Ok - but that sounds unnecessarily complicated - and btw checkout_process is too late as previously discussed.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

My comments aren't regarding policy...but rather what I see in the code.  Now, I may be a little fuzzy, but I do know that special accommodations with regard to the timing of order creation during the checkout process are altogether different for PayPal.  There are vast sections of code that are duplicated and run 'a step sooner' just for PayPal.  I've not experienced much in the way of payment modules, but that much I know for certain.  I've installed (and used) authorize.net, PayPal, and the 'wire transfer' module.  Wire transfer creates the order at completion, and the order is posted as "awaiting payment" in the admin list.  Authorize.net does NOT create an order number.  In their interface...there is only an amount...no correlating order.  However, when you return to the store, you'll find an order number.  When I dug deeper to see why, it was revealed just how simple the module is (there was no order number being sent because it didn't exist yet), and by comparison, just how complex the PayPal module is.  But again...don't take my word for gospel here.  @Harald Ponce de Leon is the guy that can answer these questions without conjecture.

My main point is to address the stated concerns about why order numbers were changing - and it's because the customer is altering their cart AFTER having chosen PayPal as the payment method.  Also...there will be a number of customers that don't ever actually place the order...and when they do that, that order number will be 'occupied' indefinitely...the site will skip over it and continue on generating new order numbers from there.  The solve for me was simple: create an order status just for these "temporary" orders, and have your orders.php query exclude that status from displaying normally.  You can always specify from the drop-down if you need to view them.

There are other issues that you may find more problematic with the PayPal app...like inventory counts being off, for example, because there are 2 opportunities for the site/code to 'complete' the order - one when the customer returns to the site from PayPal, and again when the IPN lands on the site.  I find that both MUST be used, because sometimes a customer will click 'pay' at paypal, but will close the browser before they ever return to the site.  Can't really rely only on the IPN either, because there are times - fairly often - when the IPN is delayed.  On occasion, it's been hours late showing up.  And of course in this case, the customer returns to find an 'unpaid' order.  Well, when both are used, it just so happens that they CAN land close enough to each other that BOTH try to complete the order (stock decrement, etc.).  This happens pretty often.  And the only tell-tale sign that you have, is that the site will have sent 2 order confirmation emails, which you can see in the status updates for the order in your store ("customer emailed - green checkmark").  This is a long thread, but go through and read up on it.  I've posted numerous times in numerous threads about this...provided images of the backend, database content screenshots.

And here's another kind of major issue with PayPal.  OSC isn't set up to distinguish between payment statuses as returned by PayPal.  Just because a customer completes the payment, doesn't mean that PayPal has approved the payment.  I've seen it return 'Pending' payments...not pending order status....pending PAYMENT status.  The site can't tell the difference.  It processes the order just like PayPal approved the transaction.  I've posted numerous details about this too.  You can potentially ship what you think is a paid order, only to find out days later that the payment actually was never approved...good luck getting your product back.

And now that they are no longer refunding fees ...you as the business owner will get stuck with paying fees based on what the original transaction amount was...not the total after you issue a partial refund.  Maybe not a big deal if your average sale is $100, but wait till you have to refund $1500 of a $2000 sale...that'll get your attention.  We're moving away from PayPal as fast as my fingers can type.

In other news...the Square module seems to be working very nicely...

Share this post


Link to post
Share on other sites

@Supertex   I wanted to stay further silent in this thread but I believe you are right .. It seems like a differnece between coding and real-life running a shop. All the examples you give we had to "code" around ...

- Stock-deduction : we do extra checks 

- Customers clicking back and forth betwen payment-processing and checkout: we check order_id and status so there is not a new order number

- Payment statusses for non confirmed Payment / and or abandoned payment: we do extra checks

So - improvements can surely can be made!

Share this post


Link to post
Share on other sites

Do you still get double-processing with the app? I've not seen it in my clients but lots with the previous modules, so I believe it's better now at least if not eliminated.

Yes, a different status for paypal cheques would be a good thing. My stock interfaces have to interrogate the order history to find out whether the payment has cleared or not.

I don't get the obsession with consecutive order ids (which you can never achieve totally anyway). If you want to track sales consecutively, why not allocate a consecutive sale/purchase/invoice number when an order is paid? Much simpler and the way that many other systems work. This is an issue right across osc and not confined to the paypal module.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
On 11/18/2019 at 1:26 PM, azpro said:

😂

I have to agree with @BrockleyJohn  .. Actually I think an ordernumber should be created on chekcout_payment.php and order should be stored in DB immediately at checkout_process.php .. The need for it would probably depend on different Payment Service Providers / Gateways but in my experience the ones I have seen could be handled better with an existing/created ordernumber.

Actually this was one of the first changes we did some 15 years ago when we started to use oSC.

 

I have done the same thing on my 2.2 site, and now need to rewrite phoenix to do the same
yes I occasionally have to go into the database to delete declined orders but but I have to pass an order # to my payment processor.
to me it makes sense to assign the order number the moment checkout_process.php is loaded


Jim Bullen - President

The Cigar Hut Group of Companies

 

 

Installed add-ons: (that now need to be upgraded to OSC CE Phoenix)

PWA, MVS, Easy Populate, Dynamic Sitemap, Featured Products, MVS Order Editor, MVS Shipping Estimator, Google XML Sitemap, About Us, Ad Tracker, Address Enhancer, Also Purchased, Backorders, Category Descriptions, Dynamic Meta Tags, Contact Us Email Subjects, Country state Selector, Extra Address Line, Order Number in Email Subject, OSC Affiliate, Product Extra Fields, Review Approval System, Reviews in Product Display, Sold Out, Sold Out (but Displayed), Ultimate SEO URL's, Updated Spiders, Welcome Email Password, Pending Order Email, Who's Online Enhancement, CCGV, Easy Discounts, Customer Comments, Request a Review, Sales Report, plus many many more!

Share this post


Link to post
Share on other sites
4 hours ago, cigarsforless said:

to assign the order number the moment checkout_process.php is loaded

This is the latest time that an order can be created and is typically after the payment has been taken. I do recall working with a payment module that doesn't go off-site for the payment until the before_process in checkout_process and executes its after_process on a callback. This does allow you to postpone allocating an order id until the order is confirmed.

However, modules that offer an express checkout - paypal expresss and amazon pay for example - must allocate the reference number at the beginning of checkout.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Things that I see with paypal:

1. Customer arrives on paypal and then does not pay - order is created but no paypal info, still shows as pending! This I can cope with as I can see that there are no paypal entries.

2. Customer pays and then does something ???? resulting in a payment but no order, sometimes when checking baskets the stuff is in the basket. This I cannot cope with I get emails!!!

3. Duplicate order nos at paypal. Paypal checks the order no and there better not be a duplicate or it wont process properly at paypal. I learned this the hard way after my first upgrade. Now if Iupgrade the database I always increment the base order no by 100000.

4. And a little bit off piste BUT: its nice to have a permanent basket but I have hundreds in the database. We could actually do with something to clean them up after a specified time. e.g. not updated for 3 months

 

Share this post


Link to post
Share on other sites

@astecme are you using the app? Sounds like your paypal isn't configured properly: order should be created in preparing status not pending and that IPN isn't working and quite possibly the return url is not working properly either!

None of that is behaviour you need to live with.

Incidentally, what has upgrading the database to do with order numbers?

 


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Yes and yes it is working and configured correctly. What I mentioned were exceptions not the rule. Apart from the order no check.

Share this post


Link to post
Share on other sites
1 hour ago, astecme said:

We could actually do with something to clean them up after a specified time

We have a mod from @burt - "Recover Carts" - that does this as well as alternatively emailing customers about their basket contents - it's been of great use in our shops.

Share this post


Link to post
Share on other sites
44 minutes ago, Heatherbell said:

We have a mod from @burt - "Recover Carts" - that does this as well as alternatively emailing customers about their basket contents - it's been of great use in our shops.

highly recommended


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (Phoenix).

here: on the official osc download page

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites
2 hours ago, astecme said:

We could actually do with something to clean them up after a specified time. e.g. not updated for 3 months

https://apps.oscommerce.com/HUONy&unsold-carts-report-2-0

Lets you run a report for a selected number of days to show all unsold carts. You can then deleat if required.

image.thumb.png.eefda6661e1225bbde59deb5d3773d20.png


 

Share this post


Link to post
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

×