Index: trunk/extensions/DonationInterface/globalcollect_gateway/globalcollect.adapter.php |
— | — | @@ -290,6 +290,7 @@ |
291 | 291 | 'CURRENCYCODE' => 'currency_code', |
292 | 292 | 'CVV' => 'cvv', |
293 | 293 | 'DATECOLLECT' => 'date_collect', |
| 294 | + 'DESCRIPTOR' => 'descriptor', // eWallets |
294 | 295 | 'DIRECTDEBITTEXT' => 'direct_debit_text', |
295 | 296 | 'DOMICILIO' => 'domicilio', // dd:ES |
296 | 297 | 'EFFORTID' => 'effort_id', |
— | — | @@ -607,6 +608,14 @@ |
608 | 609 | //'forms' => array( 'Gateway_Form_TwoStepAmount', ), |
609 | 610 | ); |
610 | 611 | |
| 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 | + |
611 | 620 | // Bank Transfers |
612 | 621 | $this->payment_methods['obt'] = array( |
613 | 622 | 'label' => 'Online bank transfer', |
— | — | @@ -835,6 +844,55 @@ |
836 | 845 | ); |
837 | 846 | |
838 | 847 | /* |
| 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 | + /* |
839 | 897 | * Online bank transfers |
840 | 898 | */ |
841 | 899 | |
— | — | @@ -1753,6 +1811,28 @@ |
1754 | 1812 | // Direct debit has different required fields for each paymentproductid. |
1755 | 1813 | $this->addKeysToTransactionForSubmethod( $payment_submethod ); |
1756 | 1814 | } |
| 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 | + } |
1757 | 1837 | |
1758 | 1838 | /** |
1759 | 1839 | * Stage: payment_method |
— | — | @@ -1835,12 +1915,19 @@ |
1836 | 1916 | $this->setupStagePaymentMethodForDirectDebit( $payment_submethod, $type); |
1837 | 1917 | break; |
1838 | 1918 | |
| 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 | + |
1839 | 1927 | /* Online bank transfer */ |
1840 | 1928 | case 'bpay': |
1841 | 1929 | $this->staged_data['payment_product'] = $this->payment_submethods[ $payment_submethod ]['paymentproductid']; |
1842 | 1930 | $this->var_map['PAYMENTPRODUCTID'] = 'payment_product'; |
1843 | 1931 | break; |
1844 | | - |
1845 | 1932 | |
1846 | 1933 | /* Real time bank transfer */ |
1847 | 1934 | case 'rtbt_nordea_sweden': |