goldcat /trunk/ZenCart/includes/modules/payment/paypal/paypalwpp_admin_notification.php

Language PHP Lines 425
MD5 Hash 18f89fa7b3fcffbee8c6ee2bdcc0c14e Estimated Cost $8,515 (why?)
Repository http://goldcat.googlecode.com/svn/ View Raw File
  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
<?php
/**
 * paypalwpp_admin_notification.php admin display component
 *
 * @package paymentMethod
 * @copyright Copyright 2003-2010 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @copyright Portions Copyright 2004 DevosC.com
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: paypalwpp_admin_notification.php 15870 2010-04-11 02:18:43Z drbyte $
 */

  $outputStartBlock = '';
  $outputPayPal = '';
  $outputPFmain = '';
  $outputAuth = '';
  $outputCapt = '';
  $outputVoid = '';
  $outputRefund = '';
  $outputEndBlock = '';
  $output = '';

  // strip slashes in case they were added to handle apostrophes:
  foreach ($ipn->fields as $key=>$value){
    $ipn->fields[$key] = stripslashes($value);
  }

    $outputStartBlock .= '<td><table class="noprint">'."\n";
    $outputStartBlock .= '<tr style="background-color : #cccccc; border-style : dotted;">'."\n";
    $outputEndBlock .= '</tr>'."\n";
    $outputEndBlock .='</table></td>'."\n";


  if ($response['RESPMSG'] != '') {
    // these would be payflow transactions

    $outputPFmain .= '<td valign="top"><table>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_AUTHCODE."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['AUTHCODE'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_STATUS."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['RESPMSG'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";


    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_AVSADDR."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['AVSADDR'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_AVSZIP."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['AVSZIP'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_CVV2MATCH."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['CVV2MATCH'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_TXN_ID."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['ORIGPNREF'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_DATE."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $ipn->fields['payment_date'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    $outputPFmain .= '<tr><td class="main">'."\n";
    $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_TRANSSTATE."\n";
    $outputPFmain .= '</td><td class="main">'."\n";
    $outputPFmain .= $response['TRANSSTATE'] ."\n";
    $outputPFmain .= '</td></tr>'."\n";

    if ($response['DAYS_TO_SETTLE'] != '' ) {
      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_DAYSTOSETTLE."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $response['DAYS_TO_SETTLE'] ."\n";
      $outputPFmain .= '</td></tr>'."\n";
    }
    $outputPFmain .= '</table></td>'."\n";

    if ($ipn->fields['mc_gross'] > 0) {
      $outputPFmain .= '<td valign="top"><table>'."\n";

      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_CURRENCY."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $ipn->fields['mc_currency'] ."\n";
      $outputPFmain .= '</td></tr>'."\n";

      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_GROSS_AMOUNT."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $ipn->fields['mc_gross']."\n";
      $outputPFmain .= '</td></tr>'."\n";

      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_FEE."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $ipn->fields['mc_fee']."\n";
      $outputPFmain .= '</td></tr>'."\n";

      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_EXCHANGE_RATE."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $ipn->fields['exchange_rate']."\n";
      $outputPFmain .= '</td></tr>'."\n";

      $outputPFmain .= '<tr><td class="main">'."\n";
      $outputPFmain .= MODULE_PAYMENT_PAYPAL_ENTRY_CART_ITEMS."\n";
      $outputPFmain .= '</td><td class="main">'."\n";
      $outputPFmain .= $ipn->fields['num_cart_items']."\n";
      $outputPFmain .= '</td></tr>'."\n";

      $outputPFmain .= '</table></td>'."\n";
    }

  } else {
    // display all paypal status fields (in admin Orders page):
    $outputPayPal .= '<td valign="top"><table>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_FIRST_NAME."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['FIRSTNAME']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_LAST_NAME."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['LASTNAME']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_BUSINESS_NAME."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['BUSINESS']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_NAME."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['NAME']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_STREET."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['SHIPTOSTREET']) . ' ' . urldecode($response['SHIPTOSTREET2']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_CITY."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['SHIPTOCITY']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_STATE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['SHIPTOSTATE']) . ' ' . urldecode($response['SHIPTOZIP']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_COUNTRY."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['SHIPTOCOUNTRY']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '</table></td>'."\n";

    $outputPayPal .= '<td valign="top"><table>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_EMAIL_ADDRESS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['EMAIL']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_EBAY_ID."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['BUYERID']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYER_ID."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PAYERID']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYER_STATUS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PAYERSTATUS']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_ADDRESS_STATUS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['ADDRESSSTATUS']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_TXN_ID."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= '<a href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_view-a-trans&id=' . urldecode($response['TRANSACTIONID']) . '" target="_blank">' . urldecode($response['TRANSACTIONID']) . '</a>' ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PARENT_TXN_ID."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PARENTTRANSACTIONID']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";
  if (defined('MODULE_PAYMENT_PAYPALWPP_ENTRY_PROTECTIONELIG') && isset($response['PROTECTIONELIGIBILITY']) && $response['PROTECTIONELIGIBILITY'] != '') {
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPALWPP_ENTRY_PROTECTIONELIG."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= $response['PROTECTIONELIGIBILITY']."\n";
    $outputPayPal .= '</td></tr>'."\n";
  }
  if (defined('MODULE_PAYMENT_PAYPAL_ENTRY_COMMENTS') && $ipn->fields['memo'] != '') {
    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_COMMENTS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= $ipn->fields['memo']."\n";
    $outputPayPal .= '</td></tr>'."\n";
  }

    $outputPayPal .= '</table></td>'."\n";

    $outputPayPal .= '<td valign="top"><table>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_TXN_TYPE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['TRANSACTIONTYPE']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_TYPE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PAYMENTTYPE']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_STATUS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PAYMENTSTATUS']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PENDING_REASON."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['PENDINGREASON']) . ($response['REASONCODE'] == 'None' ? '' : urldecode($response['PENDINGREASON'])) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_INVOICE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($ipn->fields['invoice']) . (urldecode($ipn->fields['invoice']) != urldecode($response['INVNUM']) ? '<br />' . urldecode($response['INVNUM']) : '') ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_DATE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['ORDERTIME']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '</table></td>'."\n";

    $outputPayPal .= '<td valign="top"><table>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_CURRENCY."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= $ipn->fields['mc_currency'] . ' ' . urldecode($response['CURRENCY']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_GROSS_AMOUNT."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['AMT']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_PAYMENT_FEE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['FEEAMT']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_EXCHANGE_RATE."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= urldecode($response['EXCHANGERATE']) ."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '<tr><td class="main">'."\n";
    $outputPayPal .= MODULE_PAYMENT_PAYPAL_ENTRY_CART_ITEMS."\n";
    $outputPayPal .= '</td><td class="main">'."\n";
    $outputPayPal .= $ipn->fields['num_cart_items']."\n";
    $outputPayPal .= '</td></tr>'."\n";

    $outputPayPal .= '</table></td>'."\n";
  }

  if (method_exists($this, '_doRefund')) {
    $outputRefund .= '<td><table class="noprint">'."\n";
    $outputRefund .= '<tr style="background-color : #eeeeee; border-style : dotted;">'."\n";
    $outputRefund .= '<td class="main">' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_TITLE . '<br />'. "\n";
    $outputRefund .= zen_draw_form('pprefund', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doRefund', 'post', '', true) . zen_hide_session_id();
    if (!isset($response['RESPMSG'])) {
    // full refund (only for PayPal transactions, not Payflow)
      $outputRefund .= MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_FULL;
      $outputRefund .= '<br /><input type="submit" name="fullrefund" value="' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_BUTTON_TEXT_FULL . '" title="' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_BUTTON_TEXT_FULL . '" />' . ' ' . MODULE_PAYMENT_PAYPALWPP_TEXT_REFUND_FULL_CONFIRM_CHECK . zen_draw_checkbox_field('reffullconfirm', '', false) . '<br />';
      $outputRefund .= MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_TEXT_FULL_OR;
    } else {
      $outputRefund .= MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_PAYFLOW_TEXT;
    }
    //partial refund - input field
    $outputRefund .= MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_PARTIAL_TEXT . ' ' . zen_draw_input_field('refamt', 'enter amount', 'length="8"');
    $outputRefund .= '<input type="submit" name="partialrefund" value="' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_BUTTON_TEXT_PARTIAL . '" title="' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_BUTTON_TEXT_PARTIAL . '" /><br />';
    //comment field
    $outputRefund .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('refnote', 'soft', '50', '3', MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_DEFAULT_MESSAGE);
    //message text
    $outputRefund .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_REFUND_SUFFIX;
    $outputRefund .= '</form>';
    $outputRefund .='</td></tr></table></td>'."\n";
  }

  if (method_exists($this, '_doAuth') && !isset($response['RESPMSG'])) {
    $outputAuth .= '<td valign="top"><table class="noprint">'."\n";
    $outputAuth .= '<tr style="background-color : #eeeeee; border-style : dotted;">'."\n";
    $outputAuth .= '<td class="main">' . MODULE_PAYMENT_PAYPAL_ENTRY_AUTH_TITLE . '<br />'. "\n";
    $outputAuth .= zen_draw_form('ppauth', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doAuth', 'post', '', true);
    //partial auth - input field
    $outputAuth .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_AUTH_PARTIAL_TEXT . ' ' . zen_draw_input_field('authamt', 'enter amount', 'length="8"') . zen_hide_session_id();
    $outputAuth .= '<input type="submit" name="orderauth" value="' . MODULE_PAYMENT_PAYPAL_ENTRY_AUTH_BUTTON_TEXT_PARTIAL . '" title="' . MODULE_PAYMENT_PAYPAL_ENTRY_AUTH_BUTTON_TEXT_PARTIAL . '" />' . MODULE_PAYMENT_PAYPALWPP_TEXT_AUTH_FULL_CONFIRM_CHECK . zen_draw_checkbox_field('authconfirm', '', false) . '<br />';
    //message text
    $outputAuth .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_AUTH_SUFFIX;
    $outputAuth .= '</form>';
    $outputAuth .='</td></tr></table></td>'."\n";
  }

  if (method_exists($this, '_doCapt')) {
    $outputCapt .= '<td valign="top"><table class="noprint">'."\n";
    $outputCapt .= '<tr style="background-color : #eeeeee; border-style : dotted;">'."\n";
    $outputCapt .= '<td class="main">' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_TITLE . '<br />'. "\n";
    $outputCapt .= zen_draw_form('ppcapture', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doCapture', 'post', '', true) . zen_hide_session_id();
    $outputCapt .= MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_FULL;
    $outputCapt .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_AMOUNT_TEXT . ' ' . zen_draw_input_field('captamt', 'enter amount', 'length="8"');
    $outputCapt .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_FINAL_TEXT . ' ' . zen_draw_checkbox_field('captfinal', '', true) . '<br />';
    $outputCapt .= '<input type="submit" name="btndocapture" value="' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_BUTTON_TEXT_FULL . '" title="' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_BUTTON_TEXT_FULL . '" />' . ' ' . MODULE_PAYMENT_PAYPALWPP_TEXT_REFUND_FULL_CONFIRM_CHECK . zen_draw_checkbox_field('captfullconfirm', '', false);
    //comment field
    $outputCapt .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('captnote', 'soft', '50', '2', MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_DEFAULT_MESSAGE);
    //message text
    $outputCapt .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_CAPTURE_SUFFIX;
    $outputCapt .= '</form>';
    $outputCapt .='</td></tr></table></td>'."\n";
  }

  if (method_exists($this, '_doVoid')) {
    $outputVoid .= '<td valign="top"><table class="noprint">'."\n";
    $outputVoid .= '<tr style="background-color : #eeeeee; border-style : dotted;">'."\n";
    $outputVoid .= '<td class="main">' . MODULE_PAYMENT_PAYPAL_ENTRY_VOID_TITLE . '<br />'. "\n";
    $outputVoid .= zen_draw_form('ppvoid', FILENAME_ORDERS, zen_get_all_get_params(array('action')) . 'action=doVoid', 'post', '', true) . zen_hide_session_id();
    $outputVoid .= MODULE_PAYMENT_PAYPAL_ENTRY_VOID . '<br />' . zen_draw_input_field('voidauthid', 'enter auth ID', 'length="8"');
    $outputVoid .= '<input type="submit" name="ordervoid" value="' . MODULE_PAYMENT_PAYPAL_ENTRY_VOID_BUTTON_TEXT_FULL . '" title="' . MODULE_PAYMENT_PAYPAL_ENTRY_VOID_BUTTON_TEXT_FULL . '" />' . ' ' . MODULE_PAYMENT_PAYPALWPP_TEXT_VOID_CONFIRM_CHECK . zen_draw_checkbox_field('voidconfirm', '', false);
    //comment field
    $outputVoid .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_VOID_TEXT_COMMENTS . '<br />' . zen_draw_textarea_field('voidnote', 'soft', '50', '3', MODULE_PAYMENT_PAYPAL_ENTRY_VOID_DEFAULT_MESSAGE);
    //message text
    $outputVoid .= '<br />' . MODULE_PAYMENT_PAYPAL_ENTRY_VOID_SUFFIX;
    $outputVoid .= '</form>';
    $outputVoid .='</td></tr></table></td>'."\n";
  }




// prepare output based on suitable content components
  $output = '<!-- BOF: pp admin transaction processing tools -->';
  $output .= $outputStartBlock;

//debug
//$output .= '<pre>' . print_r($response, true) . '</pre>';

  if (isset($response['RESPMSG']) || defined('MODULE_PAYMENT_PAYFLOW_STATUS')) { // payflow
    $output .= $outputPFmain;
    if (method_exists($this, '_doVoid') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only' || (isset($_GET['authcapt']) && $_GET['authcapt']=='on'))) $output .= $outputVoid;
    if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYFLOW_TRANSACTION_MODE == 'Auth Only' || (isset($_GET['authcapt']) && $_GET['authcapt']=='on'))) $output .= $outputCapt;
    if (method_exists($this, '_doRefund')) $output .= $outputRefund;
  } else {  // PayPal
    $output .= $outputPayPal;

    if (defined('MODULE_PAYMENT_PAYPALWPP_STATUS') || defined('MODULE_PAYMENT_PAYPALDP_STATUS')) {
      $output .= $outputEndBlock;
      $output .= $outputEndBlock;
      $output .= $outputStartBlock;
      $output .= $outputStartBlock;
      if ($response['TRANSACTION_TYPE'] == 'Authorization' || (in_array($response['TRANSACTIONTYPE'], array('cart','expresscheckout','webaccept') ) && $response['PAYMENTTYPE'] == 'instant' && $response['PENDINGREASON'] == 'authorization') || (isset($_GET['authcapt']) && $_GET['authcapt']=='on')) {
        if (method_exists($this, '_doRefund') && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp')) $output .= $outputRefund;
        if (method_exists($this, '_doAuth') && (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only')) $output .= $outputAuth;
        if (method_exists($this, '_doCapt') && (MODULE_PAYMENT_PAYPALWPP_TRANSACTION_MODE == 'Auth Only' || MODULE_PAYMENT_PAYPALDP_TRANSACTION_MODE == 'Auth Only')) $output .= $outputCapt;
        if (method_exists($this, '_doVoid')) $output .= $outputVoid;
      } else {
        if (method_exists($this, '_doRefund') /* && ($response['PAYMENTTYPE'] != 'instant' || $module == 'paypaldp') */) $output .= $outputRefund;
        if (method_exists($this, '_doVoid') && $response['PAYMENTTYPE'] == 'instant' && $response['PAYMENTSTATUS'] != 'Voided' && $module != 'paypaldp') $output .= $outputVoid;
      }
    }
  }
  $output .= $outputEndBlock;
  $output .= $outputEndBlock;
  $output .= '<!-- EOF: pp admin transaction processing tools -->';
Back to Top