Zen Cart Logo
Forums / PayPal Website Payments Pro support / My "Options" values aren't passing to Paypal (payment Pro )

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

Views: 3,425

Results 1 to 3 of 3
19 Aug 2015, 8:32 PM
#1
johnny1114 avatar

johnny1114

New Zenner

Join Date:
Jan 2014
Location:
NJ, USA
Posts:
9
Plugin Contributions:
0

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

what my client want is below:

Attachment 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 OptionsAttachment 15544

I follow the manual below, > https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/#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.

    // 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']) < 0 ? 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']) > 0 ) {
        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
19 Aug 2015, 8:51 PM
#2
drbyte avatar

drbyte

Sensei

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

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/classic/api/merchant/DoDirectPayment_API_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

20 Aug 2015, 1:22 PM
#3
johnny1114 avatar

johnny1114

New Zenner

Join Date:
Jan 2014
Location:
NJ, USA
Posts:
9
Plugin Contributions:
0

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)

DrByte:

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/classic/api/merchant/DoDirectPayment_API_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