https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103415

Revision: 103415
Author:   jpostlethwaite
Date:     2011-11-16 23:35:01 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
Added eWallets: cashU, Moneybookers, PayPal and WebMoney.

Modified Paths:
--------------
    
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php

Modified: 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
===================================================================
--- 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
  2011-11-16 23:34:58 UTC (rev 103414)
+++ 
trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
  2011-11-16 23:35:01 UTC (rev 103415)
@@ -290,6 +290,7 @@
                        'CURRENCYCODE'          => 'currency_code',
                        'CVV'                           => 'cvv',
                        'DATECOLLECT'           => 'date_collect',
+                       'DESCRIPTOR'            => 'descriptor', // eWallets
                        'DIRECTDEBITTEXT'       => 'direct_debit_text',
                        'DOMICILIO'                     => 'domicilio', // dd:ES
                        'EFFORTID'                      => 'effort_id',
@@ -607,6 +608,14 @@
                        //'forms'       => array( 'Gateway_Form_TwoStepAmount', 
),
                );
                
+               // eWallets
+               $this->payment_methods['ew'] = array(
+                       'label' => 'eWallets',
+                       'types' => array( 'ew_cashu', 'ew_moneybookers', 
'ew_paypal', 'ew_webmoney', ),
+                       'validation' => array( 'address' => false, 'creditCard' 
=> false, )
+                       //'forms'       => array( 'Gateway_Form_TwoStepAmount', 
),
+               );
+               
                // Bank Transfers
                $this->payment_methods['obt'] = array(
                        'label' => 'Online bank transfer',
@@ -835,6 +844,55 @@
                );
 
                /*
+                * eWallets
+                */
+                
+               // eWallets PayPal
+               $this->payment_submethods['ew_paypal'] = array(
+                       'paymentproductid'      => 840,
+                       'label' => 'eWallets: PayPal',
+                       'group' => 'ew',
+                       'validation' => array(),
+                       'keys' => array(),
+               );
+                
+               // eWallets PayPal
+               $this->payment_submethods['ew_paypal'] = array(
+                       'paymentproductid'      => 840,
+                       'label' => 'eWallets: PayPal',
+                       'group' => 'ew',
+                       'validation' => array(),
+                       'keys' => array(),
+               );
+                
+               // eWallets WebMoney
+               $this->payment_submethods['ew_webmoney'] = array(
+                       'paymentproductid'      => 841,
+                       'label' => 'eWallets: WebMoney',
+                       'group' => 'ew',
+                       'validation' => array(),
+                       'keys' => array(),
+               );
+                
+               // eWallets Moneybookers
+               $this->payment_submethods['ew_moneybookers'] = array(
+                       'paymentproductid'      => 843,
+                       'label' => 'eWallets: Moneybookers',
+                       'group' => 'ew',
+                       'validation' => array(),
+                       'keys' => array(),
+               );
+                
+               // eWallets cashU
+               $this->payment_submethods['ew_cashu'] = array(
+                       'paymentproductid'      => 845,
+                       'label' => 'eWallets: cashU',
+                       'group' => 'ew',
+                       'validation' => array(),
+                       'keys' => array(),
+               );
+
+               /*
                 * Online bank transfers
                 */
                 
@@ -1753,6 +1811,28 @@
                // Direct debit has different required fields for each 
paymentproductid.
                $this->addKeysToTransactionForSubmethod( $payment_submethod );
        }
+
+       /**
+        * Stage: setupStagePaymentMethodForEWallets
+        *
+        * @param string        $payment_submethod
+        * @param string        $type   request|response
+        */
+       protected function setupStagePaymentMethodForEWallets( 
$payment_submethod, $type = 'request' ) {
+
+               // DESCRIPTOR is required on WebMoney, assuming it is required 
for all.
+               $this->addKeyToTransaction('DESCRIPTOR');
+
+               $this->staged_data['descriptor'] = 'Wikimedia 
Foundation/Wikipedia';
+
+               $this->var_map['PAYMENTPRODUCTID'] = 'payment_product';
+               $this->var_map['COUNTRYCODEBANK'] = 'country';
+               
+               $this->staged_data['payment_product'] = 
$this->payment_submethods[ $payment_submethod ]['paymentproductid'];
+
+               // eWallets custom keys
+               $this->addKeysToTransactionForSubmethod( $payment_submethod );
+       }
        
        /**
         * Stage: payment_method
@@ -1835,12 +1915,19 @@
                                $this->setupStagePaymentMethodForDirectDebit( 
$payment_submethod, $type);
                                break;
                        
+                       /* eWallets */
+                       case 'ew_cashu':
+                       case 'ew_moneybookers':
+                       case 'ew_paypal':
+                       case 'ew_webmoney':
+                               $this->setupStagePaymentMethodForEWallets( 
$payment_submethod, $type);
+                               break;
+
                        /* Online bank transfer */
                        case 'bpay':
                                $this->staged_data['payment_product'] = 
$this->payment_submethods[ $payment_submethod ]['paymentproductid'];
                                $this->var_map['PAYMENTPRODUCTID'] = 
'payment_product';
                                break;
-
                        
                        /* Real time bank transfer */
                        case 'rtbt_nordea_sweden':


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to