Post-Payment Processing

Phoca Cart - complex e-commerce extension
User avatar
nzrunner
Phoca Member
Phoca Member
Posts: 33
Joined: 27 Jul 2017, 15:52

Post-Payment Processing

Post by nzrunner »

I have been extensively testing payment plugins, both the Paypal Standard and one I am developing. I have noticed that once a payment is Cancelled or Completed. there is no post-payment processing executed in Phoca Cart.

Some tests I have done include: -
  1. If I pass a transaction to Paypal, and then choose to cancel the payment, you are returned to the Payment Cancelled page, but the order remains in the system with a status of Pending.
  2. If I try to pass an invalid transaction to the payment gateway, the gateway returns an error but nothing is displayed to the user. The order remains in the system with a status of Pending
  3. If I successfully complete a payment, I am passed to the Payment Completed page but no other information is available. The order remains in the system with a status of Pending.
I was hoping that for the above three tests, the following would occur: -
  1. You are returned to the Payment Cancelled page displaying a message advising that the Payment AND Order have been cancelled. The status of the order is changed to Cancelled (as set in the plugin parameters).
  2. You are returned to the Payment Cancelled page displaying a message advising that the Payment AND Order have been cancelled along with an error message containing all the information returned by the payment gateway response. This error message would be a form generated by the payment plugin and passed to the Payment Cancelled page The status of the order is changed to Cancelled (as set in the plugin parameters).
  3. You are returned to the Payment Completed page displaying a message advising that the Payment AND Order have been completed along with a Payment Receipt containing all the information returned by the payment gateway response. This message would be a form generated by the payment plugin and passed to the Payment Completed page. The status of the order is changed to Completed (as set in the plugin parameters).
I can see that you have some of that coded in your Paypal Standard plugin but it doesn't seem to work as expected and there is no ability to display a payment receipt or error message.

Am I missing something?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Post-Payment Processing

Post by Jan »

Hi,

I will take a look at it.

1) when you click on cacel button after redirecting to payment method, I think the payment method does not return any information to the server. So the only one information is, the payment was not done. I will try to do more tests there

2) If you get error page on payment method, unfortunately, there is no way how to give some information to the user because the error page is just a payment method error page, not the one of the eshop :idea:

3) when the payment is done, you get standard information, the status is changed after your server gets the information from the payment method server. I have tested it with sandbox and it worked normally, I will try to do more tests :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
nzrunner
Phoca Member
Phoca Member
Posts: 33
Joined: 27 Jul 2017, 15:52

Re: Post-Payment Processing

Post by nzrunner »

Thanks
  1. I can obviously change the language file so the message on the Info page is "Order and Payment Cancelled" but there needs to be a way to ensure that the order gets cancelled
  2. My system log shows a really nice error message returned by the payment gateway is an error occurs. As an example, if I try to pass an invalid currency to the gateway, I get the error message "Unknown Payment Currency Code". It would be good to be able to pass this to the Info page so the user has some idea of why it failed and can communicate with the website. And the order needs to be cancelled.
  3. The gateway I am working with returns a full transaction response after a payment is completed that contains a heap of information, including a transaction ID, receipt number, etc. I know another gateway I am considering writing a plugin for returns a similar response. The ideal would be for this information to be displayed to the user and they could print a payment receipt if they wish.
I will try again with the Paypal Standard as my testing has had no success with getting the status to change after a successful payment. If I can get that working, I can probably get similar success with my plugin.

Overall, I am thinking about the User Experience, and it would be a poor user experience if the user gets an email advising them that their order is placed, if either 1. or 2. above happens. They would have the expectation that it is all good, and not realise that something is wrong.
User avatar
nzrunner
Phoca Member
Phoca Member
Posts: 33
Joined: 27 Jul 2017, 15:52

Re: Post-Payment Processing

Post by nzrunner »

I have figured out why my Post-Payment Processing wasn't working. Paypal has IPN disabled by default in a Sandbox account, and IPN does not like a website running on localhost.

Anyway, now I have Post-Payment Processing working, I can confirm that my orders are now being confirmed/cancelled as appropriate, and I have also got a message being passed to the Info page. I have included screenshots below: -
  1. Payment Cancelled by User
    Image
  2. Payment Cancelled by System
    Image
  3. Payment successfully completed
    Image
I just need to test a few more things and then I believe it will be ready for the real-world :-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48403
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Post-Payment Processing

Post by Jan »

Hi, great to hear it.

Jan
If you find Phoca extensions useful, please support the project
Post Reply