Advertisement
Guest User

Untitled

a guest
Aug 19th, 2012
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class gateway_paypal extends gatewayCore {
  15. var $maxAmounts = array( 'USD' => 10000, 'EUR' => 8000, 'CAD' => 12500, 'GBP' => 5500, 'JPY' => 1000000, 'AUD' => 12500, 'CHF' => 13000, 'NOK' => 70000, 'SEK' => 80000, 'DKK' => 60000, 'PLN' => 32000, 'HUF' => 2000000, 'CZK' => 240000, 'SGD' => 16000, 'MXN' => 110000, 'ILS' => 40000, 'HKD' => 80000, 'NZD' => 15000, 'TWD' => 330000, 'THB' => 360000, 'PHP' => 500000, 'BRL' => 20000, 'ARS' => 30000, 'MYR' => 40000, 'CNY' => '*' );
  16.  
  17. function __construct($registry) {
  18. parent::( $registry );
  19. ipsRegistry;
  20. $this->ipnUrl = $settings['base_url'] . 'app=nexus&module=payments&section=receive&validate=paypal';
  21. ipsRegistry;
  22. $this->returnUrl = $settings['base_url'] . 'app=nexus&module=payments&section=receive&check=paypal';
  23. ipsRegistry;
  24. $this->cancelUrl = $settings['base_url'] . 'app=nexus&module=clients&section=invoices';
  25. ipsRegistry;
  26.  
  27. if ($settings['nexus_https'] == 'https') {
  28. $this->returnUrl = str_replace( 'http://', 'https://', $this->returnUrl );
  29. }
  30.  
  31. }
  32.  
  33. function payScreen() {
  34. ipsRegistry;
  35. $this->cancelUrl = $settings['base_url'] . 'app=nexus&module=payments&section=pay&id=' . $this->invoice->id;
  36. $member = customer::load( $this->invoice->member )->data;
  37. $canRecur = FALSE;
  38. $renew_term = 0;
  39. $renew_unit = '';
  40. $renew_cost = 0;
  41. $noShipping = 1;
  42. $donationOnly = TRUE;
  43. foreach ($this->invoice->items as $item) {
  44. if ($item['physical']) {
  45. $noShipping = 0;
  46. }
  47.  
  48.  
  49. if ($item['type'] != 'donation') {
  50. $donationOnly = FALSE;
  51. }
  52.  
  53.  
  54. if (( $this->method['m_settings']['subscriptions'] && $item['renew_term'] )) {
  55. if ($renew_term) {
  56. if (( $item['renew_term'] != $renew_term || $item['renew_units'] != $renew_unit )) {
  57. $canRecur = FALSE;
  58. break;
  59. }
  60.  
  61. $renew_cost += $item['renew_cost'];
  62. continue;
  63. }
  64.  
  65. $renew_term = $item['renew_term'];
  66. $renew_unit = $item['renew_units'];
  67. $renew_cost = $item['renew_cost'];
  68. $canRecur = TRUE;
  69. continue;
  70. }
  71. }
  72.  
  73. $url = ($this->testMode ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr');
  74.  
  75. if ($canRecur) {
  76. ipsRegistry;
  77. $button = $this->buildForm( array( 'cmd' => '_xclick-subscriptions', 'a1' => $this->invoice->total, 'p1' => $renew_term, 't1' => strtoupper( $renew_unit ), 'a3' => $renew_cost, 'p3' => $renew_term, 't3' => strtoupper( $renew_unit ), 'src' => 1, 'item_name' => $this->invoice->title, 'item_number' => $this->invoice->id, 'invoice' => $this->invoice->id, 'custom' => $this->transaction, 'business' => $this->method['m_settings']['email'], 'currency_code' => $settings['nexus_currency'], 'no_shipping' => $noShipping, 'rm' => 2, 'notify_url' => $this->ipnUrl, 'return' => $this->returnUrl . '&s=' . $this->transaction, 'cancel_return' => $this->cancelUrl, 'charset' => IPS_DOC_CHAR_SET, 'no_note' => 1 ) );
  78. } else {
  79. ipsRegistry;
  80. $button = $this->buildForm( array( 'cmd' => ($donationOnly ? '_donations' : '_xclick'), 'amount' => $this->invoice->total, 'item_name' => $this->invoice->title, 'item_number' => $this->invoice->id, 'invoice' => $this->invoice->id, 'custom' => $this->transaction, 'business' => $this->method['m_settings']['email'], 'currency_code' => $settings['nexus_currency'], 'no_shipping' => $noShipping, 'notify_url' => $this->ipnUrl, 'return' => $this->returnUrl . '&custom=' . $this->transaction, 'rm' => 2, 'cancel_return' => $this->cancelUrl, 'charset' => IPS_DOC_CHAR_SET, 'no_note' => 1, 'address1' => $member['cm_address_1'], 'address2' => $member['cm_address_2'], 'city' => $member['cm_city'], 'country' => $member['cm_country'], 'first_name' => $member['cm_first_name'], 'last_name' => $member['cm_last_name'], 'state' => customer::getstatecode( $member['cm_state'], $member['cm_country'] ), 'zip' => $member['cm_zip'] ) );
  81. }
  82.  
  83. return array( 'button' => $button, 'formUrl' => $url );
  84. }
  85.  
  86. function getPostBackID() {
  87. return ($_REQUEST['s'] ? $_REQUEST['s'] : $_REQUEST['custom']);
  88. }
  89.  
  90. function validatePayment() {
  91. if ($_REQUEST['old'] == '1') {
  92. return $this->subscriptionPayment( $this->_validatePayment( ) );
  93. }
  94.  
  95.  
  96. if ($_REQUEST['payment_status'] == 'Reversed') {
  97. exit( );
  98. }
  99.  
  100. switch ($_REQUEST['txn_type']) {
  101. case 'web_accept': {
  102. $this->_validatePayment( );
  103. }
  104.  
  105. case 'subscr_payment': {
  106. $this->subscriptionPayment( $this->_validatePayment( ) );
  107. }
  108.  
  109. case 'recurring_payment': {
  110. $this->_forwardToPayPalProGateway( );
  111. break;
  112. }
  113.  
  114. case 'adjustment': {
  115. }
  116.  
  117. case 'cart': {
  118. }
  119.  
  120. case 'express_checkout': {
  121. }
  122.  
  123. case 'masspay': {
  124. }
  125.  
  126. case 'merch_pmt': {
  127. }
  128.  
  129. case 'new_case': {
  130. }
  131.  
  132. case 'recurring_payment_profile_created': {
  133. }
  134.  
  135. case 'send_money': {
  136. }
  137.  
  138. case 'subscr_cancel': {
  139. }
  140.  
  141. case 'subscr_eot': {
  142. }
  143.  
  144. case 'subscr_failed': {
  145. }
  146.  
  147. case 'subscr_modify': {
  148. }
  149.  
  150. case 'subscr_signup': {
  151. }
  152.  
  153. case 'virtual_terminal': {
  154. exit( );
  155. }
  156.  
  157. default: {
  158. }
  159. }
  160.  
  161. return array( $this->getPostBackID( ), 'fail', $this->lang->words['gateway_paypal_wtf'] );
  162. }
  163. .............................................................
  164. ................................
  165. ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement