Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- class gateway_paypal extends gatewayCore {
- 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' => '*' );
- function __construct($registry) {
- parent::( $registry );
- ipsRegistry;
- $this->ipnUrl = $settings['base_url'] . 'app=nexus&module=payments§ion=receive&validate=paypal';
- ipsRegistry;
- $this->returnUrl = $settings['base_url'] . 'app=nexus&module=payments§ion=receive&check=paypal';
- ipsRegistry;
- $this->cancelUrl = $settings['base_url'] . 'app=nexus&module=clients§ion=invoices';
- ipsRegistry;
- if ($settings['nexus_https'] == 'https') {
- $this->returnUrl = str_replace( 'http://', 'https://', $this->returnUrl );
- }
- }
- function payScreen() {
- ipsRegistry;
- $this->cancelUrl = $settings['base_url'] . 'app=nexus&module=payments§ion=pay&id=' . $this->invoice->id;
- $member = customer::load( $this->invoice->member )->data;
- $canRecur = FALSE;
- $renew_term = 0;
- $renew_unit = '';
- $renew_cost = 0;
- $noShipping = 1;
- $donationOnly = TRUE;
- foreach ($this->invoice->items as $item) {
- if ($item['physical']) {
- $noShipping = 0;
- }
- if ($item['type'] != 'donation') {
- $donationOnly = FALSE;
- }
- if (( $this->method['m_settings']['subscriptions'] && $item['renew_term'] )) {
- if ($renew_term) {
- if (( $item['renew_term'] != $renew_term || $item['renew_units'] != $renew_unit )) {
- $canRecur = FALSE;
- break;
- }
- $renew_cost += $item['renew_cost'];
- continue;
- }
- $renew_term = $item['renew_term'];
- $renew_unit = $item['renew_units'];
- $renew_cost = $item['renew_cost'];
- $canRecur = TRUE;
- continue;
- }
- }
- $url = ($this->testMode ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr');
- if ($canRecur) {
- ipsRegistry;
- $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 ) );
- } else {
- ipsRegistry;
- $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'] ) );
- }
- return array( 'button' => $button, 'formUrl' => $url );
- }
- function getPostBackID() {
- return ($_REQUEST['s'] ? $_REQUEST['s'] : $_REQUEST['custom']);
- }
- function validatePayment() {
- if ($_REQUEST['old'] == '1') {
- return $this->subscriptionPayment( $this->_validatePayment( ) );
- }
- if ($_REQUEST['payment_status'] == 'Reversed') {
- exit( );
- }
- switch ($_REQUEST['txn_type']) {
- case 'web_accept': {
- $this->_validatePayment( );
- }
- case 'subscr_payment': {
- $this->subscriptionPayment( $this->_validatePayment( ) );
- }
- case 'recurring_payment': {
- $this->_forwardToPayPalProGateway( );
- break;
- }
- case 'adjustment': {
- }
- case 'cart': {
- }
- case 'express_checkout': {
- }
- case 'masspay': {
- }
- case 'merch_pmt': {
- }
- case 'new_case': {
- }
- case 'recurring_payment_profile_created': {
- }
- case 'send_money': {
- }
- case 'subscr_cancel': {
- }
- case 'subscr_eot': {
- }
- case 'subscr_failed': {
- }
- case 'subscr_modify': {
- }
- case 'subscr_signup': {
- }
- case 'virtual_terminal': {
- exit( );
- }
- default: {
- }
- }
- return array( $this->getPostBackID( ), 'fail', $this->lang->words['gateway_paypal_wtf'] );
- }
- .............................................................
- ................................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement