Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2013
    Posts
    2
    Plugin Contributions
    0

    help question Significantly changing information sent to Paypal using Express Checkout

    running version: v1.5.1, No upgrades
    I've looked extensively in FAQ and forums with no luck on this question.

    I am a new Zencart user. I'm running a small delivery company. On Zen cart, I supply the delivery cost of each item, but I don't know the actual cost of the item until I purchase it. I purchase, but the customer usually has a better idea of the item cost than I do. I therefore want the customer to "authorize" funds using Paypal, when I deliver goods, I will explain the total cost in person (goods plus the delivery) and "capture" funds when the customer receives products.

    I had the Paypal Standard "button" installed with a "authorization" with a set amount as part of the button, but this forces the customer to need to accomplish two steps. 1. Go to a page with the "button" and go through the Paypal process. 2 Check out. It would be much less confusing to the customer to use the Paypal Express Checkout so that Paypal was part of the check out process.

    I have successfully installed Paypal express checkout, but I'm unable to make it pass the information I want.

    In short, during checkout I want to pass specific information to Paypal different than supplied by Zen. It would be the same every time (all purchases). For example:
    1. That this is an "authorization" rather than "sale". (I found and updated this in admin during the paypal Express Checkout install, it is operating correctly)
    2. The product name sent to Paypal should always be "authorization of funds for requested purchase"
    3. The price sent to Paypal should always be $250.

    I understand the basics of PHP, and I've changed a couple little things to my page. I assumed to accomplish 2 and 3 I would just track down the thing that passed the "total" and "products" to Paypal and supply an amount and description in their place. I assumed it would be in /includes/modules/payment/paypalwpp.php Not so easy to figure out. I have been unable to unravel what variable or where it is being passed.

    Where (file and location in file) would I change so that I could change these two things (amount and product) as they are sent to Paypal?

    Is this is simple as I think it should be? It's my last step before I take my first Zencart "live". Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Changing information sent to Paypal using Express Checkout

    The getLineItemDetails() function in that file is what prepares the details of line items and prices submitted to PayPal for Express Checkout.
    .

    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.

  3. #3
    Join Date
    Jan 2013
    Posts
    2
    Plugin Contributions
    0

    Default Re: Significantly changing information sent to Paypal using Express Checkout

    Thank you very much for the inforation.

    I must admit that even with that information I've spent a couple of days and was unable to figure it out. My knowledge of arrays is much weaker than the person that wrote the code.

    I'm assuming that the value has to be changed just before:

    $options = $this->getLineItemDetails($this->selectCurrency($order->info['currency']));
    (app line 278)

    I looked at the logs that I was getting back to try to figure our what part of the array to change. I may be misinterpreting the results. I thought it must be

    $info['DESC']= 'some description';
    $info['AMT']= 250.00;
    or
    $order_amount = 250;

    or
    $order['DESC']= 'some description';
    $order['AMT']= 250.00;

    I tried moving these around as I thought the problem might be the error check that occurs further down. Sometimes it wouldn't change the amount, sometimes it would error out. I never got the description to change. I feel like I've tried every possible combination of every way of putting in into the array, but I keep getting back errors.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Significantly changing information sent to Paypal using Express Checkout

    There are a LOT of checks and balances to ensure that the amounts prepared for sending to PayPal actually match the exact amounts the are in the order that the customer has prepared in their shopping basket.
    It gets quite complicated when you suddenly want to throw all that away and charge (or even just authorize, as you say you're trying to do on) the customer an amount completely different from what they're purchasing.

    Another way you could tackle it (without having to make big programming changes) would be to change the name of the Low Order Fee module (Maybe call it "authorization of funds", like you mentioned before), set the threshold to $225 and the fee amount to $50 and simply use that to add an extra flat amount to the customer's order. At least that way you could always add yourself a buffer of maybe $50 to handle whatever problem you're trying to solve here.
    .

    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.

 

 

Similar Threads

  1. v151 PayPal Express Checkout Using NVP 84.0 [Support Thread]
    By lat9 in forum Addon Payment Modules
    Replies: 32
    Last Post: 28 Dec 2015, 04:54 PM
  2. Replies: 8
    Last Post: 17 Jul 2012, 04:39 AM
  3. Using Paypal express checkout issue...
    By wondergirl in forum PayPal Express Checkout support
    Replies: 35
    Last Post: 18 May 2011, 07:46 AM
  4. Paypal Express Checkout missing state information
    By Jeromev in forum PayPal Express Checkout support
    Replies: 9
    Last Post: 23 Jun 2010, 12:57 PM
  5. Error when using paypal express checkout...
    By webopt in forum PayPal Express Checkout support
    Replies: 2
    Last Post: 4 Sep 2007, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg