barceloneta /wp-content/plugins/wp-shopping-cart/merchants/paypal_multiple.php

Language PHP Lines 541
MD5 Hash 2e7eae092a63a0d2216e6666d47e0a43 Estimated Cost $11,573 (why?)
Repository https://github.com/alx/barceloneta.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
<?php
$nzshpcrt_gateways[$num]['name'] = 'Paypal';
$nzshpcrt_gateways[$num]['internalname'] = 'paypal_multiple';
$nzshpcrt_gateways[$num]['function'] = 'gateway_paypal_multiple';
$nzshpcrt_gateways[$num]['form'] = "form_paypal_multiple";
$nzshpcrt_gateways[$num]['submit_function'] = "submit_paypal_multiple";

function gateway_paypal_multiple($seperator, $sessionid) {
  global $wpdb;
  $purchase_log_sql = "SELECT * FROM `".$wpdb->prefix."purchase_logs` WHERE `sessionid`= ".$sessionid." LIMIT 1";
  $purchase_log = $wpdb->get_results($purchase_log_sql,ARRAY_A) ;
//exit(print_r($purchase_log,1));
  $cart_sql = "SELECT * FROM `".$wpdb->prefix."cart_contents` WHERE `purchaseid`='".$purchase_log[0]['id']."'";
  $cart = $wpdb->get_results($cart_sql,ARRAY_A) ;
  //written by allen
  //exit("<pre>".print_r($cart,true)."</pre>");
  $member_subtype = get_product_meta($cart[0]['prodid'],'is_permenant',true);
  $status = get_product_meta($cart[0]['prodid'],'is_membership',true);
  $is_member = $status;
  $is_perm = $member_subtype;
  //end of written by allen
  $transact_url = get_option('transact_url');
  // paypal connection variables
  $data['business'] = get_option('paypal_multiple_business');
  $data['return'] = urlencode($transact_url.$seperator."sessionid=".$sessionid."&gateway=paypal");
  $data['cancel_return'] = urlencode($transact_url);
  $data['notify_url'] =urlencode(get_option('siteurl')."/?ipn_request=true");
  $data['rm'] = '2';
  
  // look up the currency codes and local price

  $currency_code = $wpdb->get_results("SELECT `code` FROM `".$wpdb->prefix."currency_list` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A);
  $local_currency_code = $currency_code[0]['code'];
  $paypal_currency_code = get_option('paypal_curcode');
//exit(get_option('currency_type'). " ".$paypal_currency_code);

  // Stupid paypal only accepts payments in one of 5 currencies. Convert from the currency of the users shopping cart to the curency which the user has specified in their paypal preferences.
  $curr=new CURRENCYCONVERTER();
  
  $data['currency_code'] = $paypal_currency_code;
//   $data['lc'] = 'US';
  $data['lc'] = 'NZ';
  $data['bn'] = 'wp_e-commerce';
  $data['no_shipping'] = '2';
  if(get_option('address_override') == 1) {
		$data['address_override'] = '1';
	}
  $data['no_note'] = '1';
  
  switch($paypal_currency_code) {
    case "JPY":
    $decimal_places = 0;
    break;
    
    case "HUF":
    $decimal_places = 0;
    
    default:
    $decimal_places = 2;
    break;
	}
  
  $i = 1;
  
  $all_donations = true;
  $all_no_shipping = true;
  
  
$total = nzshpcrt_overall_total_price($_SESSION['selected_country'],false,true);

$discount = nzshpcrt_apply_coupon($total,$_SESSION['coupon_num']);
	if(($discount > 0) && ($_SESSION['coupon_num'] != null)) {
		$data['item_name_'.$i] = "Your Shopping Cart";
		$data['amount_'.$i] = number_format(sprintf("%01.2f", $discount),$decimal_places,'.','');
		$data['quantity_'.$i] = 1;
		// $data['item_number_'.$i] = 0;
		$data['shipping_'.$i] = 0;
		$data['shipping2_'.$i] = 0;
		$data['handling_'.$i] = 0;
		$i++;
	} else {
		foreach($cart as $item) {
			$product_data = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix."product_list` WHERE `id`='".$item['prodid']."' LIMIT 1",ARRAY_A);
			$product_data = $product_data[0];
			$variation_count = count($product_variations);
			
			$variation_sql = "SELECT * FROM `".$wpdb->prefix."cart_item_variations` WHERE `cart_id`='".$item['id']."'";
			$variation_data = $wpdb->get_results($variation_sql,ARRAY_A); 
			$variation_count = count($variation_data);
			if($variation_count >= 1) {
				$variation_list = " (";
				$j = 0;
				foreach($variation_data as $variation) {
					if($j > 0) {
						$variation_list .= ", ";
					}
					$value_id = $variation['value_id'];
					$value_data = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix."variation_values` WHERE `id`='".$value_id."' LIMIT 1",ARRAY_A);
					$variation_list .= $value_data[0]['name'];
					$j++;
				}
				$variation_list .= ")";
			} else {
				$variation_list = '';
			}
			
			
			$local_currency_productprice = $item['price'];
			$local_currency_shipping = $item['pnp'];
			
			//exit($local_currency_productprice . " " . $local_currency_code);
			if($paypal_currency_code != $local_currency_code) {
				$paypal_currency_productprice = $curr->convert($local_currency_productprice,$paypal_currency_code,$local_currency_code);
				$paypal_currency_shipping = $curr->convert($local_currency_shipping,$paypal_currency_code,$local_currency_code);
			} else {
				$paypal_currency_productprice = $local_currency_productprice;
				$paypal_currency_shipping = $local_currency_shipping;
			}
			//exit("---->".$paypal_currency_shipping);
			$data['item_name_'.$i] = urlencode(stripslashes($product_data['name']).$variation_list);
			$data['amount_'.$i] = number_format(sprintf("%01.2f", $paypal_currency_productprice),$decimal_places,'.','');
			$data['quantity_'.$i] = $item['quantity'];
			$data['item_number_'.$i] = $product_data['id'];
			if($item['donation'] !=1) {
				$all_donations = false;
				$data['shipping_'.$i] = number_format($paypal_currency_shipping,$decimal_places,'.','');
				$data['shipping2_'.$i] = number_format($paypal_currency_shipping,$decimal_places,'.','');      
			} else {
				$data['shipping_'.$i] = number_format(0,$decimal_places,'.','');
				$data['shipping2_'.$i] = number_format(0,$decimal_places,'.','');
			}
					
			if($product_data['no_shipping'] != 1) {
				$all_no_shipping = false;
			}
			
			$data['handling_'.$i] = '';
			$i++;
		}
	}
  $data['tax'] = '';

  $base_shipping = $purchase_log[0]['base_shipping'];
  //exit($base_shipping);
  if(($base_shipping > 0) && ($all_donations == false) && ($all_no_shipping == false)) {
    $data['handling_cart'] = number_format($base_shipping,$decimal_places,'.','');
	}
  
  $data['custom'] = '';
  $data['invoice'] = $sessionid;
  
  // User details   
  if($_POST['collected_data'][get_option('paypal_form_first_name')] != '') {
    $data['first_name'] = urlencode($_POST['collected_data'][get_option('paypal_form_first_name')]);
	}
    
  if($_POST['collected_data'][get_option('paypal_form_last_name')] != '') {   
    $data['last_name'] = urlencode($_POST['collected_data'][get_option('paypal_form_last_name')]);
	}
    
  if($_POST['collected_data'][get_option('paypal_form_address')] != '') {   
    $address_rows = explode("\n\r",$_POST['collected_data'][get_option('paypal_form_address')]);
    $data['address1'] = urlencode(str_replace(array("\n", "\r"), '', $address_rows[0]));
    unset($address_rows[0]);    
    if($address_rows != null) {
			$data['address2'] = implode(", ",$address_rows);
    } else {
			$data['address2'] = '';
    }
	}
  
	if($_POST['collected_data'][get_option('paypal_form_city')] != '') {
		$data['city'] = urlencode($_POST['collected_data'][get_option('paypal_form_city')]); 
	}
    
  if(preg_match("/^[a-zA-Z]{2}$/",$_SESSION['selected_country'])) {   
    $data['country'] = $_SESSION['selected_country'];
	}    
    
  if(is_numeric($_POST['collected_data'][get_option('paypal_form_post_code')])) {   
    $data['zip'] =  urlencode($_POST['collected_data'][get_option('paypal_form_post_code')]); 
	}    
    
  // Change suggested by waxfeet@gmail.com, if email to be sent is not there, dont send an email address        
  $email_data = $wpdb->get_results("SELECT `id`,`type` FROM `".$wpdb->prefix."collect_data_forms` WHERE `type` IN ('email') AND `active` = '1'",ARRAY_A);
  foreach((array)$email_data as $email) {
    $data['email'] = $_POST['collected_data'][$email['id']];
	}
    
  if(($_POST['collected_data'][get_option('email_form_field')] != null) && ($data['email'] == null)) {
    $data['email'] = $_POST['collected_data'][get_option('email_form_field')];
	}
	
  $data['upload'] = '1';
  $data['cmd'] = "_ext-enter";
  $data['redirect_cmd'] = "_cart";
  $datacount = count($data);
  $num = 0;
  foreach($data as $key=>$value) {
    $amp = '&';
    $num++;
    if($num == $datacount) {
      $amp = '';
      }
    //$output .= $key.'='.urlencode($value).$amp;
    $output .= $key.'='.$value.$amp;
	}
  if(get_option('paypal_ipn') == 0) { //ensures that digital downloads still work for people without IPN, less secure, though
    //$wpdb->query("UPDATE `".$wpdb->prefix."purchase_logs` SET `processed` = '2' WHERE `sessionid` = ".$sessionid." LIMIT 1");
    }
	//written by allen
  if ($is_member == '1') {
		$membership_length = get_product_meta($cart[0]['prodid'],'membership_length',true);
		if ($is_perm == '1'){
			$permsub = '&src=1';
		} else {
			$permsub = '';
		}
		$output = 'cmd=_xclick-subscriptions&business='.urlencode($data['business']).'&no_note=1&item_name='.urlencode($data['item_name_1']).'&return='.urlencode($data['return']).'&cancel_return='.urlencode($data['cancel_return']).$permsub.'&a3='.urlencode($data['amount_1']).'&p3='.urlencode($membership_length['length']).'&t3='.urlencode(strtoupper($membership_length['unit']));
	}

	//   echo "<a href='".get_option('paypal_multiple_url')."?".$output."'>Test the URL here</a>";
	//   exit("<pre>".print_r($data,true)."</pre>");
  header("Location: ".get_option('paypal_multiple_url')."?".$output);
  exit();
}
  
function nzshpcrt_paypal_ipn()
  {
  global $wpdb;
  // needs to execute on page start
  // look at page 36
  if(($_GET['ipn_request'] == 'true') && (get_option('paypal_ipn') == 1)) {
    // read the post from PayPal system and add 'cmd'
    $req = 'cmd=_notify-validate';
    $message = "";
    foreach ($_POST as $key => $value) {
      $value = urlencode(stripslashes($value));
      $req .= "&$key=$value";
		}
    //$req .= "&ipn_request=true";
    $replace_strings[0] = 'http://';
    $replace_strings[1] = 'https://';
    $replace_strings[2] = '/cgi-bin/webscr';
    
    $paypal_url = str_replace($replace_strings, "",get_option('paypal_multiple_url'));
    
    // post back to PayPal system to validate
    $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
    $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
    $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
    $fp = fsockopen ($paypal_url, 80, $errno, $errstr, 30);
    
    // assign posted variables to local variables
    $sessionid = $_POST['invoice'];
    $transaction_id = $_POST['txn_id'];
    $verification_data['item_name'] = $_POST['item_name'];
    $verification_data['item_number'] = $_POST['item_number'];
    $verification_data['payment_status'] = $_POST['payment_status'];
    $verification_data['payment_amount'] = $_POST['mc_gross'];
    $verification_data['payment_currency'] = $_POST['mc_currency'];
    $verification_data['txn_id'] = $_POST['txn_id'];
    $verification_data['receiver_email'] = $_POST['receiver_email'];
    $verification_data['payer_email'] = $_POST['payer_email'];
    
    if(!$fp) {
       //mail(get_option('purch_log_email'),'IPN CONNECTION FAILS IT',("Fix the paypal URL, it is currently:\n\r". $paypal_url));
      // HTTP ERROR
		} else {
      fputs ($fp, $header . $req);
      while (!feof($fp)) {
        $res = fgets ($fp, 1024);
        if(strcmp ($res, "VERIFIED") == 0){
          switch($verification_data['payment_status']) {
            case 'Processed': // I think this is mostly equivalent to Completed
            case 'Completed':
            $wpdb->query("UPDATE `".$wpdb->prefix."purchase_logs` SET `processed` = '2' WHERE `sessionid` = ".$sessionid." LIMIT 1");
            transaction_results($sessionid, false, $transaction_id);
            break;

            case 'Failed': // if it fails, delete it
            $log_id = $wpdb->get_var("SELECT `id` FROM `".$wpdb->prefix."purchase_logs` WHERE `sessionid`='$sessionid' LIMIT 1");
            $delete_log_form_sql = "SELECT * FROM `".$wpdb->prefix."cart_contents` WHERE `purchaseid`='$log_id'";
            $cart_content = $wpdb->get_results($delete_log_form_sql,ARRAY_A);
            foreach((array)$cart_content as $cart_item) {
              $cart_item_variations = $wpdb->query("DELETE FROM `".$wpdb->prefix."cart_item_variations` WHERE `cart_id` = '".$cart_item['id']."'", ARRAY_A);
						}
            $wpdb->query("DELETE FROM `".$wpdb->prefix."cart_contents` WHERE `purchaseid`='$log_id'");
            $wpdb->query("DELETE FROM `".$wpdb->prefix."submited_form_data` WHERE `log_id` IN ('$log_id')");
            $wpdb->query("DELETE FROM `".$wpdb->prefix."purchase_logs` WHERE `id`='$log_id' LIMIT 1");
            break;
            
            case 'Pending':      // need to wait for "Completed" before processing
            $sql = "UPDATE `".$wpdb->prefix."purchase_logs` SET `transactid` = '".$transaction_id."', `date` = '".time()."'  WHERE `sessionid` = ".$sessionid." LIMIT 1";
            $wpdb->query($sql) ;
            break;
            
            default: // if nothing, do nothing, safest course of action here.
            break;            
					}
				} else if (strcmp ($res, "INVALID") == 0) {
					// Its already logged, not much need to do more
				}
			}
      fclose ($fp);
		}
    /*
     * Detect use of sandbox mode, if sandbox mode is present, send debugging email.
     */
     if(stristr(get_option('paypal_multiple_url'), "sandbox")) {
				$message = "This is a debugging message sent because it appears that you are using sandbox mode.\n\rIt is only sent if the paypal URL contains the word \"sandbox\"\n\r\n\r";
				$message .= "OUR_POST:\n\r".print_r($header . $req,true)."\n\r\n\r";
				$message .= "THEIR_POST:\n\r".print_r($_POST,true)."\n\r\n\r";
				$message .= "GET:\n\r".print_r($_GET,true)."\n\r\n\r";
				$message .= "SERVER:\n\r".print_r($_SERVER,true)."\n\r\n\r";
				$wpdb->query("INSERT INTO `paypal_log` ( `id` , `text` , `date` ) VALUES ( '', '$message', NOW( ) );");
				mail(get_option('purch_log_email'), "IPN Data", $message);
			}    
    }
  }
  

function submit_paypal_multiple(){
  if($_POST['paypal_multiple_business'] != null) {
    update_option('paypal_multiple_business', $_POST['paypal_multiple_business']);
	}
    
  if($_POST['paypal_multiple_url'] != null) {
    update_option('paypal_multiple_url', $_POST['paypal_multiple_url']);
	}
    
  if($_POST['paypal_curcode'] != null) {
    update_option('paypal_curcode', $_POST['paypal_curcode']);
	}
    
  if($_POST['paypal_curcode'] != null) {
    update_option('paypal_curcode', $_POST['paypal_curcode']);
	}
    
  if($_POST['paypal_ipn'] != null) {
    update_option('paypal_ipn', (int)$_POST['paypal_ipn']);
	}
  if($_POST['address_override'] != null) {
    update_option('address_override', (int)$_POST['address_override']);
	}
    
  foreach((array)$_POST['paypal_form'] as $form => $value) {
    update_option(('paypal_form_'.$form), $value);
	}
  return true;
}

function form_paypal_multiple() {
  $select_currency[get_option('paypal_curcode')] = "selected='true'";
  $output = "
  <tr>
      <td>
      PayPal Username
      </td>
      <td>
      <input type='text' size='40' value='".get_option('paypal_multiple_business')."' name='paypal_multiple_business' />
      </td>
  </tr>
  <tr>
      <td>
      PayPal Url
      </td>
      <td>
      <input type='text' size='40' value='".get_option('paypal_multiple_url')."' name='paypal_multiple_url' /> <br />
     <strong>Note:</strong>The URL to use for the paypal gateway is: https://www.paypal.com/cgi-bin/webscr
      </td>
  </tr>
  ";
  
  
	$paypal_ipn = get_option('paypal_ipn');
	$paypal_ipn1 = "";
	$paypal_ipn2 = "";
	switch($paypal_ipn) {
		case 0:
		$paypal_ipn2 = "checked ='true'";
		break;
		
		case 1:
		$paypal_ipn1 = "checked ='true'";
		break;
	}
		
	$output .= "
   <tr>
     <td>
      PayPal IPN
     </td>
     <td>
       <input type='radio' value='1' name='paypal_ipn' id='paypal_ipn1' ".$paypal_ipn1." /> <label for='paypal_ipn1'>".TXT_WPSC_YES."</label> &nbsp;
       <input type='radio' value='0' name='paypal_ipn' id='paypal_ipn2' ".$paypal_ipn2." /> <label for='paypal_ipn2'>".TXT_WPSC_NO."</label>
     </td>
  </tr>
  <tr>
      <td>
      PayPal Accepted Currency (e.g. USD, AUD)
      </td>
      <td>
        <select name='paypal_curcode'>
          <option ".$select_currency['USD']." value='USD'>U.S. Dollar</option>
          <option ".$select_currency['CAD']." value='CAD'>Canadian Dollar</option>
          <option ".$select_currency['AUD']." value='AUD'>Australian Dollar</option>
          <option ".$select_currency['EUR']." value='EUR'>Euro</option>
          <option ".$select_currency['GBP']." value='GBP'>Pound Sterling</option>
          <option ".$select_currency['JPY']." value='JPY'>Yen</option>
          <option ".$select_currency['NZD']." value='NZD'>New Zealand Dollar</option>
          <option ".$select_currency['CHF']." value='CHF'>Swiss Franc</option>
          <option ".$select_currency['HKD']." value='HKD'>Hong Kong Dollar</option>
          <option ".$select_currency['SGD']." value='SGD'>Singapore Dollar</option>
          <option ".$select_currency['SEK']." value='SEK'>Swedish Krona</option>
          <option ".$select_currency['HUF']." value='HUF'>Hungarian Forint</option>
          <option ".$select_currency['DKK']." value='DKK'>Danish Krone</option>
          <option ".$select_currency['PLN']." value='PLN'>Polish Zloty</option>
          <option ".$select_currency['NOK']." value='NOK'>Norwegian Krone</option>
          <option ".$select_currency['CZK']." value='CZK'>Czech Koruna</option>
        </select> 
      </td>
   </tr>";
   
	$address_override = get_option('address_override');
	$address_override1 = "";
	$address_override2 = "";
	switch($address_override) {
		case 1:
		$address_override1 = "checked ='true'";
		break;
		
		case 0:
		default:
		$address_override2 = "checked ='true'";
		break;
	}
     
$output .= "
   <tr>
     <td>
      Override the users address stored on paypal:
     </td>
     <td>
       <input type='radio' value='1' name='address_override' id='address_override1' ".$address_override1." /> <label for='address_override1'>".TXT_WPSC_YES."</label> &nbsp;
       <input type='radio' value='0' name='address_override' id='address_override2' ".$address_override2." /> <label for='address_override2'>".TXT_WPSC_NO."</label>
     </td>
   </tr>
   
   
   <tr class='update_gateway' >
		<td colspan='2'>
			<div class='submit'>
			<input type='submit' value='Update &raquo;' name='updateoption'/>
		</div>
		</td>
	</tr>
	
	<tr class='firstrowth'>
		<td style='border-bottom: medium none;' colspan='2'>
			<strong class='form_group'>Forms Sent to Gateway</strong>
		</td>
	</tr>
   
    <tr>
      <td>
      First Name Field
      </td>
      <td>
      <select name='paypal_form[first_name]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_first_name'))."
      </select>
      </td>
  </tr>
    <tr>
      <td>
      Last Name Field
      </td>
      <td>
      <select name='paypal_form[last_name]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_last_name'))."
      </select>
      </td>
  </tr>
    <tr>
      <td>
      Address Field
      </td>
      <td>
      <select name='paypal_form[address]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_address'))."
      </select>
      </td>
  </tr>
  <tr>
      <td>
      City Field
      </td>
      <td>
      <select name='paypal_form[city]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_city'))."
      </select>
      </td>
  </tr>
  <tr>
      <td>
      State Field
      </td>
      <td>
      <select name='paypal_form[state]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_state'))."
      </select>
      </td>
  </tr>
  <tr>
      <td>
      Postal code/Zip code Field
      </td>
      <td>
      <select name='paypal_form[post_code]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_post_code'))."
      </select>
      </td>
  </tr>
  <tr>
      <td>
      Country Field
      </td>
      <td>
      <select name='paypal_form[country]'>
      ".nzshpcrt_form_field_list(get_option('paypal_form_country'))."
      </select>
      </td>
  </tr> ";
  
  return $output;
}
  
  
add_action('init', 'nzshpcrt_paypal_ipn');
?>
Back to Top