Post by Wallimann » Wed Feb 23, 2011 10:56 pm

Hi everyone!
First, I apologize if this has been answered. I just could not find anything on the topic here...

I sell digital goods on my website http://www.guitarplayback.com
An order can vary from $0.99 all the way up to $200.00
I use Paypal exclusively.
I have two Paypal accounts: one for Micropayments (lower fees for any order under $12) and a regular Paypal for anything higher
Is there a way to automatically assign one of the Paypal address to get paid depending on how much the total order is?

Basically something like this:
If total order equals or less than $12 -> use Micropayment
If total order higher than $12 -> use regular Paypal account

Any answer will be highly appreciated!!!

Guitar Backing Tracks and Video Lessons at http://www.guitarplayback.com


New member

Posts

Joined
Fri Oct 29, 2010 1:38 am
Location - Colorado

Post by Qphoria » Wed Feb 23, 2011 11:09 pm

1. EDIT: catalog/controller/payment/pp_standard.php

2. FIND:

Code: Select all

$this->data['fields']['business'] = $this->config->get('pp_standard_email'); 
3. BEFORE, ADD:

Code: Select all

if ($this->cart->getTotal() < 12) {
        $this->data['fields']['business'] = 'micropay@email.com';
} else {
        $this->data['fields']['business'] = $this->config->get(pp_standard_email);
} 
Also, since you will have a different email account sometimes than the one in your paypal configuration, you will need to disable the mismatch verification.

4. FIND:

Code: Select all

$this->error = $this->language->get('error_email_mismatch'); 
5. REPLACE WITH:

Code: Select all

//$this->error = $this->language->get('error_email_mismatch');   

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Wallimann » Thu Feb 24, 2011 1:00 am

You are the best!!!!!
Thanks a lot man.
PS: Really enjoying the mods I got from you. Thanks!

Guitar Backing Tracks and Video Lessons at http://www.guitarplayback.com


New member

Posts

Joined
Fri Oct 29, 2010 1:38 am
Location - Colorado

Post by Wallimann » Sat Dec 31, 2011 12:45 am

After upgrading my site to v1.5 I cannot find the following line:
$this->error = $this->language->get('error_email_mismatch');

I did enter the first part of the code but this doesn't seem to work anymore.
Am I missing something?

Guitar Backing Tracks and Video Lessons at http://www.guitarplayback.com


New member

Posts

Joined
Fri Oct 29, 2010 1:38 am
Location - Colorado

Post by viper8548 » Tue Feb 26, 2013 3:41 pm

Hi,

I have applied the above code in my shop with opencart 1.5.4.1, it works great however theres one problem, when a customer pays to my micro payments paypal account (not the normal account one set in opencart payments setting), the order does not automatically update to processed and is stucked in processing status. Does anyone know how to get around this?

How does Paypal return a success callback to opencart? how do I add another email address for accepting success callbacks?

Thanks

New member

Posts

Joined
Fri Feb 22, 2013 8:07 am

Post by liamrogers1 » Mon May 18, 2015 7:19 am

Hi,

I check out your site that you posted in the original post, and see that the problem is still not resolved.
I'm currently facing the same problem and trying to use both Paypal micropayment and business on my website.
I instead get this error
Parse error: syntax error, unexpected T_PUBLIC in /home/admin/public_html/catalog/controller/payment/pp_standard.php on line 110.
Any help will be great.

Thank you

Newbie

Posts

Joined
Mon May 18, 2015 7:16 am

Post by liamrogers1 » Wed May 27, 2015 10:15 am

Hey,

I actually managed to get this working but in a different way.
By creating a custom payment method using this
http://code.tutsplus.com/tutorials/crea ... -cms-22338
and changing all the code within the custom.php files to match the PP standard files although everything that says Paypal_standard you will have to change to custom including the Class name. example Paypal_standard/email will be custom/email.

Hopefully this helps

Newbie

Posts

Joined
Mon May 18, 2015 7:16 am

Post by Qphoria » Sat Aug 29, 2015 12:36 am

The code above was for 1.4.8-1.4.9.5

This should do what you need:

(1.5.x)

1. EDIT: catalog/controller/payment/pp_standard.php

2. FIND:

Code: Select all

$this->data['custom'] = $this->session->data['order_id'];
3. AFTER, ADD:

Code: Select all

if ($total > 12) {
    $this->data['business'] = 'some-other-email@email.com';
}

(2.x)

1. EDIT: catalog/controller/payment/pp_standard.php

2. FIND:

Code: Select all

$data['custom'] = $this->session->data['order_id'];
3. AFTER, ADD:

Code: Select all

if ($total > 12) {
    $data['business'] = 'some-other-email@email.com';
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Johnathan » Sat Aug 29, 2015 11:19 pm

Just to note, you could also duplicate the PayPal extension like liamrogers1 did, and then use Restrict Payment Methods to determine when the two payment methods are available.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 5 guests