Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Location
    NJ, USA
    Posts
    9
    Plugin Contributions
    0

    Default My "Options" values aren't passing to Paypal (payment Pro )

    what my client want is below:

    Click image for larger version. 

Name:	zen1.jpg 
Views:	321 
Size:	44.7 KB 
ID:	15543

    but Zen Cart does not pass product's attribute values eg size/color to a separate column Options in paypal transaction details page.
    instead, Zen Cart only simply append the attribute's values to product's name.

    see the current paypal transaction details,it's blank in the column OptionsClick image for larger version. 

Name:	zen2.jpg 
Views:	301 
Size:	83.1 KB 
ID:	15544

    I follow the manual below,
    https://developer.paypal.com/docs/cl...#id08A6HF080O3

    on0 Optional First option field name and label. The os0 variable contains the corresponding value for this option field. For example, if on0 is size, os0 could be large.
    Optional for Buy Now, Add to Cart, Subscribe, Automatic Billing, and Installment Plan buttons
    Not used with Donate or Buy Gift Certificate buttons
    64
    on1 Optional Second option field name and label. The os1 variable contains the corresponding value for this option field. For example, if on1 is color then os1 could be blue.
    You can specify a maximum of 7 option field names (6 with Subscribe buttons) by incrementing the option name index (on0 through on6).
    Optional for Buy Now, Add to Cart, Subscribe, Automatic Billing, and Installment Plan buttons
    Not used with Donate or Buy Gift Certificate buttons
    64
    realized that there are on0, on1 parameters for attribute #1 and #2, os0 and os1 are for their according values to attribute #1 or 2. I added the corresponding code under paypaldp.php (\includes\modules\payment\paypaldp.php) around line after #1530 but didn't seem to be working.

    PHP Code:
        // loop thru all products to prepare details of quantity and price.
        
    for ($i=0$n=sizeof($order->products), $k=-1$i<$n$i++) {
          
    // PayPal is inconsistent in how it handles zero-value line-items, so skip this entry if price is zero
          
    if ($order->products[$i]['final_price'] == 0) {
            continue;
          } else {
            
    $k++;
          }

          
    $optionsLI["L_NUMBER$k"] = $order->products[$i]['model'];
          
    $optionsLI["L_NAME$k"]   = $order->products[$i]['name'] . ' [' . (int)$order->products[$i]['id'] . ']';
          
    // Append *** if out-of-stock.
          
    $optionsLI["L_NAME$k"]  .= ((zen_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty']) < STOCK_MARK_PRODUCT_OUT_OF_STOCK '');
          
    /**
           * johnny1114 06/26/2015 bug fix for paypal order details (Options value missing for size/color)https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
           * https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside
           * on0_x    First option field name for item #x. 64 character limit
           * os0_x    First set of option value(s) for item #x. 200 character limit. "on0_x" must be defined in order for "os0_x" to be recognized.
           * on1_x    Second option field name for item #x. 64 character limit
           * os1_x    Second set of option value(s) for item #x. 200 character limit. "on1_x" must be defined in order for "os1_x" to be recognized.
           */    
          // if there are attributes, loop thru them and add to description
              // 06/27/2015 johnny1114 add item attribute Options
              
    $optionsLI["ON0$k"] = "";
              
    $optionsLI["OS0$k"] = "";                                    
              
    $optionsLI["ON1$k"] = "";
              
    $optionsLI["OS1$k"] = "";
          if (isset(
    $order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > ) {
            for (
    $j=0$n2=sizeof($order->products[$i]['attributes']); $j<$n2$j++) {
              
    // 06/27/2015 johnny1114 add item attribute Options
              
    $optionsLI["ON0$k"] = $order->products[$i]['attributes'][0]['option'];
              
    $optionsLI["OS0$k"] = $order->products[$i]['attributes'][0]['value'];                                        
              
    $optionsLI["ON1$k"] = $order->products[$i]['attributes'][1]['option'];
              
    $optionsLI["OS1$k"] = $order->products[$i]['attributes'][1]['value'];
              
    $optionsLI["L_NAME$k"] .= "\n " $optionsLI["ON0$k"] . '- ' $optionsLI["OS0$k"]; // for zen cart forum, you may ignore this because I put these two lines here just want to see if my ON and OS are being passed to the paypay transaction API or not.
              
    $optionsLI["L_NAME$k"] .= "\n " $optionsLI["ON1$k"] . ': ' $optionsLI["OS1$k"];
                   
              
    //$optionsLI["L_NAME$k"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
            
    // end loop
          
    // endif attribute-info 

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: My "Options" values aren't passing to Paypal (payment Pro )

    You're complaining about PayPal Payments Pro but you've quoted documentation instructions for PayPal Standard.

    PayPal Payments Pro does not support the "options" parameters you quoted. That's why the option information IS included in the product name/description data being passed. See the Payments Pro documentation here: https://developer.paypal.com/docs/cl...Operation_NVP/

    If you wish to have PayPal support the "options" parameters you quoted, please put in a request for them to change the APIs they offer via www.paypal.com/mts
    .

    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 2014
    Location
    NJ, USA
    Posts
    9
    Plugin Contributions
    0

    Default Re: My "Options" values aren't passing to Paypal (payment Pro )

    Dr. Byte,

    thank you very much for your prompt reply.

    yes, my bad, I was looking at the pp standard developer manual, I thought that given the basic pp does support that, no doubt Pro shouldn't support that either.

    when I am reading the manual for Pro, only the basic 6 parameters are supported

    is there a reason why Paypal API currently does not offer that? why they cut off this feature, were there any related discussions in our forum before, I did the search but didn't found any, or only my client needs this? (he use Paypal as his merchant account, I told him I could modify Zen Cart order details pages to make a separate Options column and put Size/Color attribute values there)

    Quote Originally Posted by DrByte View Post
    You're complaining about PayPal Payments Pro but you've quoted documentation instructions for PayPal Standard.

    PayPal Payments Pro does not support the "options" parameters you quoted. That's why the option information IS included in the product name/description data being passed. See the Payments Pro documentation here: https://developer.paypal.com/docs/cl...Operation_NVP/

    If you wish to have PayPal support the "options" parameters you quoted, please put in a request for them to change the APIs they offer via www.paypal.com/mts

 

 

Similar Threads

  1. PayPal Payment Pro, no 'Decline error"?
    By kevinmc3 in forum Addon Payment Modules
    Replies: 15
    Last Post: 7 Aug 2012, 10:51 AM
  2. Replies: 8
    Last Post: 23 Jun 2010, 10:12 PM
  3. Paypal IPN: How to select "goods" "Service" as the kind of payment?
    By gisco in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 9 Jun 2009, 02:31 PM
  4. Replies: 2
    Last Post: 10 Feb 2007, 05:23 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR