r103415 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103414‎ | r103415 | r103416 >
Date:23:35, 16 November 2011
Author:jpostlethwaite
Status:ok (Comments)
Tags:
Comment:
Added eWallets: cashU, Moneybookers, PayPal and WebMoney.
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php
@@ -290,6 +290,7 @@
291291 'CURRENCYCODE' => 'currency_code',
292292 'CVV' => 'cvv',
293293 'DATECOLLECT' => 'date_collect',
 294+ 'DESCRIPTOR' => 'descriptor', // eWallets
294295 'DIRECTDEBITTEXT' => 'direct_debit_text',
295296 'DOMICILIO' => 'domicilio', // dd:ES
296297 'EFFORTID' => 'effort_id',
@@ -607,6 +608,14 @@
608609 //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
609610 );
610611
 612+ // eWallets
 613+ $this->payment_methods['ew'] = array(
 614+ 'label' => 'eWallets',
 615+ 'types' => array( 'ew_cashu', 'ew_moneybookers', 'ew_paypal', 'ew_webmoney', ),
 616+ 'validation' => array( 'address' => false, 'creditCard' => false, )
 617+ //'forms' => array( 'Gateway_Form_TwoStepAmount', ),
 618+ );
 619+
611620 // Bank Transfers
612621 $this->payment_methods['obt'] = array(
613622 'label' => 'Online bank transfer',
@@ -835,6 +844,55 @@
836845 );
837846
838847 /*
 848+ * eWallets
 849+ */
 850+
 851+ // eWallets PayPal
 852+ $this->payment_submethods['ew_paypal'] = array(
 853+ 'paymentproductid' => 840,
 854+ 'label' => 'eWallets: PayPal',
 855+ 'group' => 'ew',
 856+ 'validation' => array(),
 857+ 'keys' => array(),
 858+ );
 859+
 860+ // eWallets PayPal
 861+ $this->payment_submethods['ew_paypal'] = array(
 862+ 'paymentproductid' => 840,
 863+ 'label' => 'eWallets: PayPal',
 864+ 'group' => 'ew',
 865+ 'validation' => array(),
 866+ 'keys' => array(),
 867+ );
 868+
 869+ // eWallets WebMoney
 870+ $this->payment_submethods['ew_webmoney'] = array(
 871+ 'paymentproductid' => 841,
 872+ 'label' => 'eWallets: WebMoney',
 873+ 'group' => 'ew',
 874+ 'validation' => array(),
 875+ 'keys' => array(),
 876+ );
 877+
 878+ // eWallets Moneybookers
 879+ $this->payment_submethods['ew_moneybookers'] = array(
 880+ 'paymentproductid' => 843,
 881+ 'label' => 'eWallets: Moneybookers',
 882+ 'group' => 'ew',
 883+ 'validation' => array(),
 884+ 'keys' => array(),
 885+ );
 886+
 887+ // eWallets cashU
 888+ $this->payment_submethods['ew_cashu'] = array(
 889+ 'paymentproductid' => 845,
 890+ 'label' => 'eWallets: cashU',
 891+ 'group' => 'ew',
 892+ 'validation' => array(),
 893+ 'keys' => array(),
 894+ );
 895+
 896+ /*
839897 * Online bank transfers
840898 */
841899
@@ -1753,6 +1811,28 @@
17541812 // Direct debit has different required fields for each paymentproductid.
17551813 $this->addKeysToTransactionForSubmethod( $payment_submethod );
17561814 }
 1815+
 1816+ /**
 1817+ * Stage: setupStagePaymentMethodForEWallets
 1818+ *
 1819+ * @param string $payment_submethod
 1820+ * @param string $type request|response
 1821+ */
 1822+ protected function setupStagePaymentMethodForEWallets( $payment_submethod, $type = 'request' ) {
 1823+
 1824+ // DESCRIPTOR is required on WebMoney, assuming it is required for all.
 1825+ $this->addKeyToTransaction('DESCRIPTOR');
 1826+
 1827+ $this->staged_data['descriptor'] = 'Wikimedia Foundation/Wikipedia';
 1828+
 1829+ $this->var_map['PAYMENTPRODUCTID'] = 'payment_product';
 1830+ $this->var_map['COUNTRYCODEBANK'] = 'country';
 1831+
 1832+ $this->staged_data['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid'];
 1833+
 1834+ // eWallets custom keys
 1835+ $this->addKeysToTransactionForSubmethod( $payment_submethod );
 1836+ }
17571837
17581838 /**
17591839 * Stage: payment_method
@@ -1835,12 +1915,19 @@
18361916 $this->setupStagePaymentMethodForDirectDebit( $payment_submethod, $type);
18371917 break;
18381918
 1919+ /* eWallets */
 1920+ case 'ew_cashu':
 1921+ case 'ew_moneybookers':
 1922+ case 'ew_paypal':
 1923+ case 'ew_webmoney':
 1924+ $this->setupStagePaymentMethodForEWallets( $payment_submethod, $type);
 1925+ break;
 1926+
18391927 /* Online bank transfer */
18401928 case 'bpay':
18411929 $this->staged_data['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid'];
18421930 $this->var_map['PAYMENTPRODUCTID'] = 'payment_product';
18431931 break;
1844 -
18451932
18461933 /* Real time bank transfer */
18471934 case 'rtbt_nordea_sweden':

Follow-up revisions

RevisionCommit summaryAuthorDate
r103845Removed duplicate payment_submethod: ew_paypal. See r103415.jpostlethwaite22:19, 21 November 2011
r103847MFT r102338, r102681, r102685, r102810, r102828, r102829, r102832, r102836, r...khorn22:30, 21 November 2011
r103848MFT r102338, r102681, r102685, r102810, r102828, r102829, r102832, r102836, r...khorn22:31, 21 November 2011
r103869MFT r103415, r103514, r103837, r103854, r103863, r103866khorn23:41, 21 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103411Adding eWallets to GlobalCollectGateway.jpostlethwaite23:31, 16 November 2011
r103413Adding descriptor field for eWallets.jpostlethwaite23:33, 16 November 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   21:45, 21 November 2011
		$this->payment_submethods['ew_paypal'] = array(
			'paymentproductid'	=> 840,
			'label'	=> 'eWallets: PayPal',
			'group'	=> 'ew',
			'validation' => array(),
			'keys' => array(),
		);

That's in there twice.

Status & tagging log