Make suggested changes from https://www.drupal.org/node/2840526#comment-12074990.
This commit is contained in:
		@@ -548,6 +548,24 @@ function uc_stripe_charge($order_id, $amount, $data) {
 | 
				
			|||||||
      throw new Exception('No customer ID found');
 | 
					      throw new Exception('No customer ID found');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					   // Set up titles and SKUs
 | 
				
			||||||
 | 
					    $titles = array();
 | 
				
			||||||
 | 
					    $models = array();
 | 
				
			||||||
 | 
					  foreach($order->products as $item){
 | 
				
			||||||
 | 
					            $titles[] = $item->title;
 | 
				
			||||||
 | 
					      $models[] = $item->model;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (variable_get('uc_stripe_metadata_titles',FALSE)==1 && variable_get('uc_stripe_metadata_models',FALSE)==1) {
 | 
				
			||||||
 | 
					        $metadata = array("titles" => implode(";", $titles),"models" => implode(";", $models));
 | 
				
			||||||
 | 
					    } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==1 && variable_get('uc_stripe_metadata_models',FALSE)==0) {
 | 
				
			||||||
 | 
					        $metadata = array("titles" => implode(";", $titles));
 | 
				
			||||||
 | 
					    } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==0 && variable_get('uc_stripe_metadata_models',FALSE)==1) {
 | 
				
			||||||
 | 
					        $metadata = array("models" => implode(";", $models));
 | 
				
			||||||
 | 
					    } elseif (variable_get('uc_stripe_metadata_titles',FALSE)==0 && variable_get('uc_stripe_metadata_models',FALSE)==0) {
 | 
				
			||||||
 | 
					        $metadata = array();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    $params = array(
 | 
					    $params = array(
 | 
				
			||||||
      "amount" => $amount,
 | 
					      "amount" => $amount,
 | 
				
			||||||
      "currency" => strtolower($order->currency),
 | 
					      "currency" => strtolower($order->currency),
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user