Post by Cue4cheap » Thu Dec 12, 2013 9:52 pm

Hello,

I just set up multi-store and a big surprise was I had an attemped order. It showed me a big issue.

In the paypal module I use (the payflow iframe one but redirect method) in 1.5.6 it goes through the process and send the customer to paypal for payment.
Problems:
1 - The title of the page is my main store name not the multi-store name. A bit confusing to the customer to be on one site and then see payment for the other site.
2 - If they cancel the transaction, which my customer did, they get redirected to the main store versus the multi-store. This is because the return URL info is "hard coded" in the settings you enter on your paypal account.
3 - I would suspect this holds true for the success, silent post, and error return pages because of the same reason. If you go into the paypal module it actually provides the return, error, silent post, success, URLs you are supposed to put in your service settings in you paypal account. So no matter what, it sends you to the main store because those are the URLs the module says to use.

Now I see paypal seems to allow you to embed the return, error, silent post, and success URLs in the info you pass and maybe even the display image so problem # goes away too. But it looks like someone who know how to make the urls for multi-store would have to code them into the payment module. I looked late last night but I can't find the syntax for how to make the URL to embed into the payment module code to return to the correct store. (they are fields to pass to paypal are: RETURNURL = , ERRORURL =, SILENTPOSTURL =, CANCELURL =)

If someone could point me to how to figure out the syntax for how to get which store you are on I could try and embed that info into the parameters above and test.

Mike
Last edited by Cue4cheap on Sat Dec 14, 2013 5:35 am, edited 1 time in total.

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by labeshops » Thu Dec 12, 2013 10:30 pm

Remove the return url you have set in paypal. Opencart will send the right one. It sounds like you have included your main domain url in the Paypal settings.

Running Opencart v3.0.3.9 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by Cue4cheap » Fri Dec 13, 2013 6:00 am

labeshops wrote:Remove the return url you have set in paypal. Opencart will send the right one. It sounds like you have included your main domain url in the Paypal settings.
I wish that was it. I just tried it and it still has problems.
# 1 still exists. It shows the main store image (name)
#2 when I remove the cancel URL in the paypal manager the cancel button disappears so the customer can't cancel and go back to my store.
#3 In my quick testing (quick because this takes that payment module offline for both stores) I couldn't get a successful transaction so I don't know where it would send a successful transaction (if it would).

So with at least the paypal iframe module multi-store does not seem to work at all for the 2nd store.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Cue4cheap » Sat Dec 14, 2013 5:35 am


cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by Cue4cheap » Sat Dec 14, 2013 6:13 am

Also - IF you follow those instructions they work. But since this thread I started for multi-store issues let me point out something. IF you have multiple store and a couple of them DO NOT have SSL certificates then I believe you run the risk of having credit card info input on your site(s) without the SSL certificates. I believe this to be a bad idea.

So what can you do???
My solution: Check for what store it is and if it is one that does NOT have a SSL certificate installed you should have it not do iframe but redirect.

Now this is a 1 minute hack attempt and then I'll have to run. One of these days I might have time to test it 100% but this is a quick attempt at a fix.
In: /catalog/controller/payment/pp_payflow_iframe.php
Find:

Code: Select all

            'SHIPTOCOUNTRY' => $shipping_country['iso_code_2'],
        );
below it add:

Code: Select all

if($this->config->get('config_store_id') == 1 ) {
$urlParams['CANCELURL'] = $this->url->link('payment/pp_payflow_iframe/pp_cancel');
$urlParams['ERRORURL'] = $this->url->link('payment/pp_payflow_iframe/pp_error');
$urlParams['RETURNURL'] = $this->url->link('payment/pp_payflow_iframe/pp_return');
$urlParams['SILENTPOSTURL'] = $this->url->link('payment/pp_payflow_iframe/pp_post');
$urlParams['TEMPLATE'] = "TEMPLATEA";
        }
This will cause paypal to redirect to their site for store ID of 1 versus being in an iframe for store 1
I KNOW this gives a warning when hitting cancel from paypal. I DO NOT KNOW if this will work with a completed transaction or if it has some other vulnerabilities but as I said this is a 1 minute hack. I have obviously not tested it 100%. Use at your own risk.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by flywatches » Sat Apr 12, 2014 1:06 am

Thank you for the information! I am trying to do the same thing with our store. We have a default store and then we are setting up several substores. If you hard-code the return, cancel, etc. urls, within the php, wouldnt those specific settings apply to every store since the same php is used to process orders.

Jonathan


New member

Posts

Joined
Fri Oct 19, 2012 11:38 pm
Location - Gilbert, AZ

Post by Cue4cheap » Sat Apr 12, 2014 4:40 am

flywatches wrote:Thank you for the information! I am trying to do the same thing with our store. We have a default store and then we are setting up several substores. If you hard-code the return, cancel, etc. urls, within the php, wouldnt those specific settings apply to every store since the same php is used to process orders.

It would IF you didn't include this check:
if($this->config->get('config_store_id') == 1 )

In this case my #1 store is the only one that has those "hard coded" into it.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by flywatches » Sat Apr 12, 2014 5:33 am

Excellent Mike! I think I am getting close to understanding. Did you outline this information elsewhere on the forum so I could follow and integrate?

Jonathan


New member

Posts

Joined
Fri Oct 19, 2012 11:38 pm
Location - Gilbert, AZ

Post by Cue4cheap » Sat Apr 12, 2014 7:45 am

flywatches wrote:Excellent Mike! I think I am getting close to understanding. Did you outline this information elsewhere on the forum so I could follow and integrate?
Which information are you looking for?
If you don't know what store is what, go to system --> settings and click on "edit" for one of them. Look in the URL. You should see "&store_id=X". Use that store # in the line I listed, then it only uses the cancelurl, error url, etc for that store.

OR use <> instead of == and put in only the store you wish to have show up in an iframe. Like:
if($this->config->get('config_store_id') <> 0 ) {

This will have the iframe window shows on the main store and does a redirect on all other stores.

For me we then have the "name" of the store as: "Pay with credit or debit card" in paypal so it doesn't make people think the paypal module is tied to a specific store but just that they are seeing a general title on the top of the page.

Was that what you were looking for? Or did I not answer your question?
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by flywatches » Tue Apr 15, 2014 8:39 am

Mike,

Thanks again for the follow up. It looks if I'll have to put the PayPal issue off until I figure out how to completely configure a multistore. I am having issues with displaying banners, modules and pages on each store. I also have to decide if I'll be purchasing an multiple SSLs for each site. If not, PayPal setup should be easy to decide since I'll need (I believe) to process payments off site.

Where would I implement your suggestion above?

Jonathan


New member

Posts

Joined
Fri Oct 19, 2012 11:38 pm
Location - Gilbert, AZ

Post by Cue4cheap » Fri Apr 18, 2014 5:56 am

Hmmm.... Sorry I thought I answered your last question....

In this case, as I am using paypal, you make the change in /catalog/controller/payment/pp_payflow_iframe.php

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am
Who is online

Users browsing this forum: Semrush [Bot] and 12 guests