Zen Cart Logo
Forums / General Questions / Order total threshold for multiple ebay accounts for one shopping cart

Order total threshold for multiple ebay accounts for one shopping cart

Views: 7,497

Results 1 to 20 of 31
5 Jan 2010, 6:36 PM
#1
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Order total threshold for multiple ebay accounts for one shopping cart

Hi,

I'd like to be able to have multiple ebay accounts for one shopping cart system.

I'm trying to set a threshold for the order total. When the order total is less than this threshold to go to one paypal account and when it exceeds the threshold it will go to the second paypal account.

For example, if i have an order total A that is equals 1.00 I'd like for it to bill Paypal account 1. And if the order total B comes out to 50.00, then I'd like for it to bill to Paypal account 2.

Is it possible to do this? And how can I achieve it?

Thanks in advance!

5 Jan 2010, 7:45 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

I don't think it is possible to "clone" the paypal module, so this is not possible to do. DrByte will be the person to give you the absolute answer.

20 years a Zencart User

5 Jan 2010, 7:55 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

The more important issue is the reason behind your inquiry: Why are you wanting to split up these transactions?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

5 Jan 2010, 8:16 PM
#4
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

The reason why is that paypal offers a micropayment account that charges less for smaller amounts, however when it is a large amount the rate that they charge is higher than a regular paypal merchant account.

So I'd like to be able to use the micropayment paypal account to deal with smaller amounts and then when it exceeds a certain amount to use a regular paypal account.

6 Jan 2010, 1:53 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

Which payment module are you using? Express Checkout or Website Payments Standard?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Jan 2010, 4:35 AM
#6
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

website payment standard and the express checkout are enabled and i can only use one paypal account to receive either checkout types.

6 Jan 2010, 4:39 AM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

First, you should only use ONE of those 2 modules, not both at the same time.

Second, to do as you desire will require customizing the code to do two things: detect the amount of the order at hand, and then determine which login/API credentials to use for submitting transactions for processing.
The customizing would be simplest in the Standard module, but the Express Checkout module is a much more reliable technology.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 Jan 2010, 5:13 AM
#8
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

ok, i was thinking by enabling both i can give the customers the option to deal with paypal either standard way or express.

If i choose express checkout, where/how do i modify the code to customize the module in order to detect the order total amount?

6 Jan 2010, 9:41 PM
#9
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

Hi DrByte,

Can you direct to which file(s) and where in the file that i can make this modification?

Thanks,
heifer

8 Jan 2010, 12:15 AM
#10
andyoxidant avatar

andyoxidant

New Zenner

Join Date:
Nov 2007
Posts:
1
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

Hi

Would be very interested in a solution to this problem. Am using zen cart to sell physical and digital goods. Namely CDs and mp3s. Paypals micropayments pricing is perfect for 50p mp3s but becomes costly if selling £10 CDs. micropayments is now very easy to set up on your paypal account. Just go to https://www.paypal-business.co.uk/Micropayments.asp

Paypal state in their features and benefits
•If you sell both high and low value items, you can use Micropayments alongside your normal PayPal rates

So it's ok by them.

Please fix it for us Dr Byte.

Am on Zen Cart 1.3.8a
Think it's express checkout but can't remember and site is down as web hosts installed PHP 5.3.1 today but that's another story:censored:

A:)

12 Jan 2010, 12:15 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

heifer,

To integrate micropayments support with Express Checkout, use the following steps:

  1. Edit /includes/modules/payment/paypal/paypal_curl.php
    Around line 460, in the _buildNameValueList class method, add the new lines as indicated here:```
    if ($this->_signature != '') $commpairs['SIGNATURE'] = trim($this->_signature);
    [B]
    // Adjustments if Micropayments account profile details have been set
    if (defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD != ''
    && (($pairs['AMT'] > 0 && $pairs['AMT'] < strval(MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD) )
    || ($pairs['METHOD'] == 'GetExpressCheckoutDetails' && isset($_SESSION['using_micropayments']) && $_SESSION['using_micropayments'] == TRUE))
    && defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME != ''
    && defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD != ''
    && defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE != '') {
    $commpairs['USER'] = str_replace('+', '%2B', trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME));
    $commpairs['PWD'] = trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD);
    $commpairs['SIGNATURE'] = trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE);
    $_SESSION['using_micropayments'] = ($pairs['METHOD'] == 'DoExpressCheckout') ? FALSE : TRUE;
    }

[/B] $pairs = array_merge($pairs, $commpairs);


2. Create a new file:*** /includes/extra_configures/paypal_micropayments_credentials.php***, and insert the following PHP code, substituting your actual API credentials from your Micropayments account:```
<?php
/**
 * Micropayments Credentials
 */
define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME', 'insert your API-Username from your Micropayments account here');
define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD', 'insert your micropayments API password here');
define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE', 'insert your micropayments API signature here');

// The following determines the purchase amount threshold under which the Micropayments account will be used for transacting. Transactions over this amount will use regular credentials.
define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD', '10');

** NOTE: This code is built-in to v1.6.0. An incorrect older variant of it is in v1.5.0 and v1.5.1, but will result in 10409 errors if the code in #1 above isn't re-applied.

** If you choose to use this code update on your site, please consider supporting the code development by making a donation here: http://www.zen-cart.com/donate

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

12 Jan 2010, 11:24 PM
#12
heifer avatar

heifer

New Zenner

Join Date:
Dec 2009
Posts:
15
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

Thank you very much! I will let you know it goes.

Just one note, in step 2 I believe you need a "?>" to close off the newly created php file.

13 Jan 2010, 12:15 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

heifer:

Just one note, in step 2 I believe you need a "?>" to close off the newly created php file.
No, that was intentional. c/f: https://www.zen-cart.com/tutorials/index.php?article=313

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

27 May 2011, 3:06 PM
#14
count avatar

count

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

The above code is already present in 1.3.9h paypal_curl.php.

Is it correct to assume all we need to add to 1.3.9h is the
paypal_micropayments_credentials.php file to have the paypal express module switch automatically to micropayments when the total sale is below x dollars?

27 May 2011, 6:01 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

Yes, that is correct.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Jun 2011, 5:34 PM
#16
count avatar

count

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

zc 1.3.9h

Express checkout works properly before adding

/includes/extra_configures/paypal_micropayments_credentials.php per above instruction.

After adding above file micropayment works properly but express checkout does not work. When cart amount exceeds micropayment threshold(10), micropayment username is sent to paypal instead of express checkout username regardless of dollar amount in cart resulting in a 10409 error - Express Checkout token was issued for a merchant account other than yours.

Any ideas how to fix this?


(live transaction) --> https://api-3t.paypal.com/nvp
Request Headers:
Array
(
[0] => Content-Type: text/namevalue
[1] => X-VPS-Timeout: 45
[2] => X-VPS-VIT-Client-Type: PHP/cURL
[3] => X-VPS-VIT-Integration-Product: PHP::Zen Cart(tm) - PayPal/NVP
[4] => X-VPS-VIT-Integration-Version: 1.3.9h
)

Request Parameters: {GetExpressCheckoutDetails}
Array
(
[TOKEN] => ECxxxxK
[REQBILLINGADDRESS] => 1
[METHOD] => GetExpressCheckoutDetails
[USER] => (micropayment user)
[PWD] => ****************
[VERSION] => 60.0
[SIGNATURE] => ****************************************************bZI3
)

Response:
Array
(
[TIMESTAMP] => 2011-06-02T14:35:00Z
[CORRELATIONID] => 21d8d2e5cc531
[ACK] => Failure
[VERSION] => 60.0
[BUILD] => 1918354
[L_ERRORCODE0] => 10409
[L_SHORTMESSAGE0] => You're not authorized to access this info.
[L_LONGMESSAGE0] => Express Checkout token was issued for a merchant account other than yours.
[L_SEVERITYCODE0] => Error
[CURL_ERRORS] =>
)

GetExpressCheckoutDetails, Elapsed: 535ms -- Failure

Content of paypal_micropayments_credentials.php

<?php /** * Micropayments Credentials */ define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME', 'xxxxx.com'); define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD', 'xxx'); define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE', 'xxxxxxx'); // The following determines the purchase amount threshold under which the Micropayments account will be used for transacting. Transactions over this amount will use regular credentials. define('MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD', '10');
2 Jun 2011, 6:50 PM
#17
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

ALERT: DO NOT USE THE FOLLOWING CODE SUGGESTION, as it will BREAK things.
~~
A slight alteration to the code may be required. Please alter by adding the extra text as shown here:~~```
[strike]
if (defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD != ''
&& [B]isset($pairs['AMT']) && [/B]$pairs['AMT'] < strval(MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD)[/strike]

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Jun 2011, 8:28 PM
#18
count avatar

count

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

DrByte, made the change. Now Express Checkout works if order is over 10 but micropayment does not work if order is under the 10 threshold limit. The micropayment username does not get sent to paypal. Express checkout username is sent for both ec and micro.

Change made to code is:
// Adjustments if Micropayments account profile details have been set
if (defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD != ''
&& isset($pairs['AMT']) && $pairs['AMT'] < strval(MODULE_PAYMENT_PAYPALWPP_MICROPAY_THRESHOLD)
&& defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME != ''
&& defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD != ''
&& defined('MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE') && MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE != '') {
$commpairs['USER'] = str_replace('+', '%2B', trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIUSERNAME));
$commpairs['PWD'] = trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APIPASSWORD);
$commpairs['SIGNATURE'] = trim(MODULE_PAYMENT_PAYPALWPP_MICROPAY_APISIGNATURE);
}

2 Jun 2011, 9:12 PM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Order total threshold for multiple ebay accounts for one shopping cart

grrr ... I'll have to set up a test store for simulating this before I can figure out what's causing your problem.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Jun 2011, 9:30 PM
#20
count avatar

count

New Zenner

Join Date:
Aug 2007
Posts:
12
Plugin Contributions:
0

Re: Order total threshold for multiple ebay accounts for one shopping cart

DrByte,

some more info that may help you.
The test products were only with digital downloads.
From logs it looks like going from store to paypal the micro username appears to be passed correctly.
When in paypal and the cc info and address are filled and submitted it appears the micro username is changed to the express checkout username.

all 4 logs for a failed transaction are in the zip.

ec setting in admin is:
Enable this Payment Module
True

Sort order of display.
0

Payment Zone
--none--

Express Checkout Shortcut Button
Off

Set Order Status
Processing [2]

Set Unpaid Order Status
Pending [1]

Set Refund Order Status
Pending [1]

Express Checkout: Require Confirmed Address
No

Express Checkout: Select Cheapest Shipping Automatically
Yes

Express Checkout: Skip Payment Page
No

Express Checkout: Automatic Account Creation
Yes

Payment Action
Final Sale

Transaction Currency
Selected Currency

PayPal Page Style
Primary

API Signature -- Username
xxxxxxxx

API Signature -- Password


API Signature -- Signature Code


PayPal Mode
PayPal

Live or Sandbox
live

Debug Mode
Log File