diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b9d6bd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,215 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/lib/api/Apiclient/Curl.php b/lib/api/Apiclient/Curl.php new file mode 100644 index 0000000..921becc --- /dev/null +++ b/lib/api/Apiclient/Curl.php @@ -0,0 +1,149 @@ +_apiKey = $apiKey; + $this->_apiUrl = $apiEndpoint; + } + + /** + * Perform API and handle exceptions + * + * @param $action + * @param array $params + * @param string $method + * @return mixed + * @throws Services_Paymill_Exception + * @throws Exception + */ + public function request($action, $params = array(), $method = 'POST') + { + if (!is_array($params)) + $params = array(); + + try { + $response = $this->_requestApi($action, $params, $method); + $httpStatusCode = $response['header']['status']; + if ($httpStatusCode != 200) { + $errorMessage = 'Client returned HTTP status code ' . $httpStatusCode; + if (isset($response['body']['error'])) { + $errorMessage = $response['body']['error']; + } + $responseCode = ''; + if (isset($response['body']['response_code'])) { + $responseCode = $response['body']['response_code']; + } + + return array("data" => array( + "error" => $errorMessage, + "response_code" => $responseCode + )); + } + + return $response['body']; + } catch (Exception $e) { + return array("data" => array("error" => $e->getMessage())); + } + } + + /** + * Perform HTTP request to REST endpoint + * + * @param string $action + * @param array $params + * @param string $method + * @return array + */ + protected function _requestApi($action = '', $params = array(), $method = 'POST') + { + $curlOpts = array( + CURLOPT_URL => $this->_apiUrl . $action, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_CUSTOMREQUEST => $method, + CURLOPT_USERAGENT => self::USER_AGENT, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_SSLVERSION => 3, +// CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt', + ); + + if (Services_Paymill_Apiclient_Interface::HTTP_GET === $method) { + if (0 !== count($params)) { + $curlOpts[CURLOPT_URL] .= false === strpos($curlOpts[CURLOPT_URL], '?') ? '?' : '&'; + $curlOpts[CURLOPT_URL] .= http_build_query($params, null, '&'); + } + } else { + $curlOpts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&'); + } + + if ($this->_apiKey) { + $curlOpts[CURLOPT_USERPWD] = $this->_apiKey . ':'; + } + + $curl = curl_init(); + curl_setopt_array($curl, $curlOpts); + $responseBody = curl_exec($curl); + self::$lastRawCurlOptions = $curlOpts; + self::$lastRawResponse = $responseBody; + $responseInfo = curl_getinfo($curl); + if ($responseBody === false) { + $responseBody = array('error' => curl_error($curl)); + } + curl_close($curl); + + if ('application/json' === $responseInfo['content_type']) { + $responseBody = json_decode($responseBody, true); + } + + return array( + 'header' => array( + 'status' => $responseInfo['http_code'], + 'reason' => null, + ), + 'body' => $responseBody + ); + } + +} \ No newline at end of file diff --git a/lib/api/Apiclient/Interface.php b/lib/api/Apiclient/Interface.php new file mode 100644 index 0000000..224b825 --- /dev/null +++ b/lib/api/Apiclient/Interface.php @@ -0,0 +1,20 @@ +_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint); + } + + /** + * General REST GET verb + * + * @param array $filters e.g. count,offest + * @param string $identifier resource id + * + * @return array of resource items + */ + public function get($filters = array(), $identifier = '') + { + $response = $this->_httpClient->request( + $this->_serviceResource . $identifier, + $filters, + Services_Paymill_Apiclient_Interface::HTTP_GET + ); + + return $response['data']; + } + + /** + * General REST GET verb + * returns one item or null + * + * @param string $identifier resource id + * + * @return array resource item | null + */ + public function getOne($identifier = null) + { + if (!$identifier) { + return null; + } + + $filters = array("count" => 1, 'offset' => 0); + + return $this->get($filters, $identifier); + } + + /** + * General REST DELETE verb + * Delete or inactivate/cancel resource item + * + * @param string $clientId + * + * @return array item deleted + */ + public function delete($clientId = null) + { + $response = $this->_httpClient->request( + $this->_serviceResource . $clientId, + array(), + Services_Paymill_Apiclient_Interface::HTTP_DELETE + ); + + return $response['data']; + } + + /** + * General REST POST verb + * create resource item + * + * @param array $itemData + * + * @return array created item + */ + public function create($itemData = array()) + { + $response = $this->_httpClient->request( + $this->_serviceResource, + $itemData, + Services_Paymill_Apiclient_Interface::HTTP_POST + ); + + return $response['data']; + } + + /** + * General REST PUT verb + * Update resource item + * + * @param array $itemData + * + * @return array item updated or null + */ + public function update(array $itemData = array()) + { + if (!isset($itemData['id']) ) { + return null; + } + + $itemId = $itemData['id']; + unset ($itemData['id']); + + $response = $this->_httpClient->request( + $this->_serviceResource . $itemId, + $itemData, + Services_Paymill_Apiclient_Interface::HTTP_PUT + ); + + return $response['data']; + } +} \ No newline at end of file diff --git a/lib/api/Clients.php b/lib/api/Clients.php new file mode 100644 index 0000000..e8e861a --- /dev/null +++ b/lib/api/Clients.php @@ -0,0 +1,14 @@ +_httpClient->request( + $this->_serviceResource . "$transactionId", + $params, + Services_Paymill_Apiclient_Interface::HTTP_POST + ); + } + + /** + * General REST DELETE verb + * Delete or inactivate/cancel resource item + * + * @param string $clientId + * + * @return array item deleted + */ + public function delete($identifier = null) + { + throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404"); + } + + /** + * {@inheritDoc} + */ + public function update(array $itemData = array()) + { + throw new Services_Paymill_Exception( __CLASS__ . " does not support " . __METHOD__, "404" ); + } +} \ No newline at end of file diff --git a/lib/api/Subscriptions.php b/lib/api/Subscriptions.php new file mode 100644 index 0000000..5fb20c0 --- /dev/null +++ b/lib/api/Subscriptions.php @@ -0,0 +1,14 @@ +setting_keys['paymill_general_settings'] = 'paymill_general_settings'; + $this->setting_keys['paymill_pay_button_settings'] = 'paymill_pay_button_settings'; + + foreach($this->setting_keys as $key){ + $this->$key = (array) get_option( $key ); + } + + // Merge with defaults + $this->paymill_general_settings = array_merge( array( + 'api_endpoint' => 'https://api.paymill.com/v2/' + ), $this->paymill_general_settings ); + + $this->paymill_pay_button_settings = array_merge( array( + 'number_decimal' => '.', + 'number_thousands' => ',' + ), $this->paymill_pay_button_settings ); + + if($this->paymill_general_settings['api_key_private'] != '' && $this->paymill_general_settings['api_key_public'] != '' && $this->paymill_general_settings['api_endpoint'] != ''){ + define('PAYMILL_ACTIVE',true); + }else{ + define('PAYMILL_ACTIVE',false); + } + + add_action( 'admin_init', array( &$this, 'register_general_settings' ) ); + if(defined('PAYMILL_ACTIVE') && PAYMILL_ACTIVE === true){ + add_action( 'admin_init', array( &$this, 'register_pay_button_settings' ) ); + } + add_action( 'admin_menu', array( &$this, 'add_admin_menus' ) ); + } + + /* + * Registers the general settings via the Settings API, + * appends the setting to the tabs array of the object. + */ + function register_general_settings() { + $this->plugin_settings_tabs[$this->setting_keys['paymill_general_settings']] = 'General'; + + register_setting( $this->setting_keys['paymill_general_settings'], $this->setting_keys['paymill_general_settings'] ); + add_settings_section( 'section_general', __('General Plugin Settings', 'paymill'), array( &$this, 'section_general_desc' ), $this->setting_keys['paymill_general_settings'] ); + + add_settings_field( 'api_key_private', __('Paymill PRIVATE API key', 'paymill'), array( &$this, 'field_general_option' ), $this->setting_keys['paymill_general_settings'], 'section_general',array('desc' => 'api_key_private', 'option' => 'api_key_private')); + add_settings_field( 'api_key_public', __('Paymill PUBLIC API key', 'paymill'), array( &$this, 'field_general_option' ), $this->setting_keys['paymill_general_settings'], 'section_general',array('desc' => 'api_key_public', 'option' => 'api_key_public')); + add_settings_field( 'api_endpoint', __('Paymill API endpoint URL', 'paymill'), array( &$this, 'field_general_option' ), $this->setting_keys['paymill_general_settings'], 'section_general',array('desc' => 'api_endpoint', 'option' => 'api_endpoint')); + + } + + /* + * Registers the pay_button settings and appends the + * key to the plugin settings tabs array. + */ + function register_pay_button_settings() { + $this->plugin_settings_tabs[$this->setting_keys['paymill_pay_button_settings']] = 'Pay Button'; + register_setting( $this->setting_keys['paymill_pay_button_settings'], $this->setting_keys['paymill_pay_button_settings'] ); + + // common + add_settings_section( 'section_pay_button', false, array( &$this, 'section_pay_button_desc' ), $this->setting_keys['paymill_pay_button_settings'] ); + add_settings_field( 'currency', __('Currency'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button',array('desc' => 'currency', 'option' => 'currency')); + add_settings_field( 'number_decimal', __('Number Format: Decimal Point'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button',array('desc' => 'number_decimal', 'option' => 'number_decimal')); + add_settings_field( 'number_thousands', __('Number Format: Thousands Seperator'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button',array('desc' => 'number_thousands', 'option' => 'number_thousands')); + add_settings_field( 'email_outgoing', __('Outgoing Email'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button',array('desc' => 'email_outgoing', 'option' => 'email_outgoing')); + add_settings_field( 'email_incoming', __('Incoming Email'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button',array('desc' => 'email_incoming', 'option' => 'email_incoming')); + + // products + add_settings_section( 'section_pay_button_products', false, array( &$this, 'section_pay_button_products_desc' ), $this->setting_keys['paymill_pay_button_settings'] ); + if(strlen($this->paymill_pay_button_settings['products'][count($this->paymill_pay_button_settings['products'])]['title']) > 0){ + $countries = count($this->paymill_pay_button_settings['products'])+5; + }elseif(count($this->paymill_pay_button_settings['products']) < 5){ + $countries = 5; + }else{ + $countries = count($this->paymill_pay_button_settings['products']); + } + for($i = 1; $i <= $countries; $i++){ + add_settings_field( 'products_title_'.$i, __('Product').' #'.$i, array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_products',array('desc' => 'products_title', 'option' => 'products', 'id' => $i, 'field' => 'title')); + add_settings_field( 'products_desc_'.$i, __('Description'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_products',array('desc' => 'products_desc', 'option' => 'products', 'id' => $i, 'field' => 'desc')); + add_settings_field( 'products_price_'.$i, __('Price'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_products',array('desc' => 'products_price', 'option' => 'products', 'id' => $i, 'field' => 'price')); + add_settings_field( 'products_vat_'.$i, __('VAT'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_products',array('desc' => 'products_vat', 'option' => 'products', 'id' => $i, 'field' => 'vat')); + add_settings_field( 'products_delivery_'.$i, __('Delivery Time'), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_products',array('desc' => 'products_delivery', 'option' => 'products', 'id' => $i, 'field' => 'delivery')); + } + + // shipping + add_settings_section( 'section_pay_button_shipping', false, array( &$this, 'section_pay_button_shipping_desc' ), $this->setting_keys['paymill_pay_button_settings'] ); + if(strlen($this->paymill_pay_button_settings['flat_shipping'][count($this->paymill_pay_button_settings['flat_shipping'])]['country']) > 0){ + $countries = count($this->paymill_pay_button_settings['flat_shipping'])+5; + }elseif(count($this->paymill_pay_button_settings['flat_shipping']) < 5){ + $countries = 5; + }else{ + $countries = count($this->paymill_pay_button_settings['flat_shipping']); + } + for($i = 1; $i <= $countries; $i++){ + add_settings_field( 'flat_shipping_country_'.$i, __('Shipping Country').' #'.$i, array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_shipping',array('desc' => 'flat_shipping_country', 'option' => 'flat_shipping', 'id' => $i, 'field' => 'country')); + add_settings_field( 'flat_shipping_costs_'.$i, __('Shipping Costs').' '.esc_attr( $this->paymill_pay_button_settings['flat_shipping'][$i]['country'] ), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_shipping',array('desc' => 'flat_shipping_costs', 'option' => 'flat_shipping', 'id' => $i, 'field' => 'costs')); + add_settings_field( 'flat_shipping_vat_'.$i, __('Shipping VAT').' '.esc_attr( $this->paymill_pay_button_settings['flat_shipping'][$i]['country'] ), array( &$this, 'field_pay_button_option' ), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_shipping',array('desc' => 'flat_shipping_vat', 'option' => 'flat_shipping', 'id' => $i, 'field' => 'vat')); + } + } + + /* + * The following methods provide descriptions + * for their respective sections, used as callbacks + * with add_settings_section + */ + function section_general_desc() { echo __('Please insert your API settings here.', 'paymill'); } + function section_pay_button_desc() { echo '

'.__('Common Settings', 'paymill').'

'.'

'.__('The Paymill Pay Buton is a simple, independent payment solution.', 'paymill').'

'.__('Configure common settings', 'paymill').'
'.__('Toggle View', 'paymill').'

'.__('Products', 'paymill').'

'.__('Configure products for the Pay Button. This list has a dynamic length and extends for 5 extra slots when last slot is filled and saved.', 'paymill').'
'.__('Toggle View', 'paymill').'

'.__('Shipping', 'paymill').'

'.__('Set delivery countries and shipping costs. This list has a dynamic length and extends for 5 extra slots when last slot is filled and saved.', 'paymill').'
'.__('Toggle View', 'paymill').' + setting_keys['paymill_general_settings']; + + screen_icon(); + echo ''; + } +}; + +// Initialize the plugin +//add_action( 'plugins_loaded', create_function( '', '$this = new paymill_settings;' ) ); +$GLOBALS['paymill_settings'] = new paymill_settings; + +?> \ No newline at end of file diff --git a/lib/css/paymill.css b/lib/css/paymill.css new file mode 100644 index 0000000..92a043a --- /dev/null +++ b/lib/css/paymill.css @@ -0,0 +1,201 @@ +#form-elv{ + display:none; +} + +/* form validation */ + +.LV_validation_message{ + font-weight:bold; + margin:0 0 0 5px; +} + +.LV_valid { + color:#00CC00; +} + +.LV_invalid { + color:#CC0000; +} + +.LV_valid_field, +input.LV_valid_field:hover, +input.LV_valid_field:active, +textarea.LV_valid_field:hover, +textarea.LV_valid_field:active { + border: 1px solid #00CC00; +} + +.LV_invalid_field, +input.LV_invalid_field:hover, +input.LV_invalid_field:active, +textarea.LV_invalid_field:hover, +textarea.LV_invalid_field:active { + border: 1px solid #CC0000; +} + +#form-credit, #form-elv{ + clear:both; +} + +.paymill_form-switch{ + -moz-border-bottom-colors: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + background-color: #F5F5F5; + background-image: linear-gradient(to bottom, #FFFFFF, #E6E6E6); + background-repeat: repeat-x; + border-color: #BBBBBB #BBBBBB #A2A2A2; + border-image: none; + border-radius: 4px 4px 4px 4px; + border-style: solid; + border-width: 1px; + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(0, 0, 0, 0.05); + color: #333333; + cursor: pointer; + display: inline-block; + font-size: 13px; + line-height: 20px; + margin-bottom: 10px; + padding: 4px 12px; + text-align: center; + text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); + vertical-align: middle; +} + +.paymill_form-switch:hover{ + background-color: #E6E6E6; + color: #333333; +} +.paymill_form-switch_active, .paymill_form-switch_active:hover{ + background-color: #EC4F00; + background-image: linear-gradient(to bottom, #F05000, #E64D00); + background-repeat: repeat-x; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + color: #FFFFFF; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); +} +#cctype{ + float:left; + width:50px; + height:30px; + background-repeat:no-repeat; + display:none; +} + +/* pay button */ +.paymill_hidden{ + display:none; +} + +.paymill_pay_button{ + margin-bottom:50px; + border:1px solid #EC4F00; + border-radius: 15px; + padding:5px; + background-color:#E6E6E6; +} + +.paymill_pay_button #place_order{ + width:100%; + font-weight:bold; + font-size:120%; +} + +.paymill_products{ + margin-bottom:20px; +} + +.paymill_pay_button .paymill_product{ + margin-bottom:5px; + padding-bottom:10px; + border-bottom:1px dashed #EC4F00; +} + +.paymill_pay_button .paymill_title{ + font-weight:bold; + font-size:120%; + margin-bottom:5px; +} + +.paymill_pay_button .paymill_desc{ + font-size:80%; + margin-bottom:5px; +} + +.paymill_pay_button .paymill_quantity{ + margin-bottom:5px; +} + +.paymill_pay_button .paymill_price{ + font-weight:bold; + font-size:120%; + margin-bottom:5px; +} + +.paymill_pay_button .paymill_vat{ + margin-bottom:5px; + font-size:70%; +} + +.paymill_pay_button .paymill_delivery{ + font-size:70%; +} + +.paymill_pay_button .paymill_total_price{ + margin-top:15px; + font-size:120%; + font-weight:bold; +} + +.paymill_pay_button #paymill_payment_form *{ + font-size:100%; +} +.paymill_pay_button #paymill_payment_form label{ + display:block; +} +.paymill_pay_button #paymill_payment_form input{ + margin-bottom:10px; +} + +.paymill_pay_button .paymill_payment_errors{ + font-weight:bold; + margin-bottom:5px; + padding-bottom:5px; +} + + +.paymill_pay_button .paymill_address .form-row { + position:relative; +} + +.paymill_pay_button .paymill_address .form-row label{ + display:block; + height:35px; + line-height:35px; +} + +.paymill_pay_button .paymill_address .form-row input{ + margin-left:auto; + margin-right:0px; + position:absolute; + right:0px; + top:0px; + width:100px; +} + +.paymill_pay_button .paymill_address .paymill_address_title{ + font-weight:bold; + font-size:120%; + border-top:1px solid #EC4F00; + margin-top:5px; + padding-top:15px; +} + +.paymill_pay_button .paymill_payment_title{ + font-weight:bold; + font-size:120%; + border-top:1px solid #EC4F00; + margin-top:20px; + padding-top:15px; +} \ No newline at end of file diff --git a/lib/img/cc_logos.png b/lib/img/cc_logos.png new file mode 100644 index 0000000..0f6ac4f Binary files /dev/null and b/lib/img/cc_logos.png differ diff --git a/lib/img/creditcard-icons.png b/lib/img/creditcard-icons.png new file mode 100644 index 0000000..f4af265 Binary files /dev/null and b/lib/img/creditcard-icons.png differ diff --git a/lib/img/icon.png b/lib/img/icon.png new file mode 100644 index 0000000..11e4814 Binary files /dev/null and b/lib/img/icon.png differ diff --git a/lib/img/line.png b/lib/img/line.png new file mode 100644 index 0000000..a356d64 Binary files /dev/null and b/lib/img/line.png differ diff --git a/lib/img/logo.png b/lib/img/logo.png new file mode 100644 index 0000000..012e1bf Binary files /dev/null and b/lib/img/logo.png differ diff --git a/lib/integration/pay_button.inc.php b/lib/integration/pay_button.inc.php new file mode 100644 index 0000000..c3d76e0 --- /dev/null +++ b/lib/integration/pay_button.inc.php @@ -0,0 +1,176 @@ +paymill_general_settings['api_key_private'], $GLOBALS['paymill_settings']->paymill_general_settings['api_endpoint']); + $transactionsObject = new Services_Paymill_Transactions($GLOBALS['paymill_settings']->paymill_general_settings['api_key_private'], $GLOBALS['paymill_settings']->paymill_general_settings['api_endpoint']); + + $client_new_email = $_POST['email']; + $client_new_description = $_POST['forename'].' '.$_POST['surname']; + $total = intval($_REQUEST['paymill_total']); + $order_id = time(); + + if(get_current_user_id()){ + $user_id = get_current_user_id(); + }else{ + $user_id = 0; + } + + $query = 'SELECT * FROM '.$wpdb->prefix.'paymill_clients WHERE paymill_client_email="'.$client_new_email.'"'; + $client_cache = $wpdb->get_results($query,ARRAY_A); + + // check wether it's a new client + if(intval($client_cache[0]['wp_member_id']) == 0){ + // create new client in paymill + $client = $clientsObject->create(array( + 'email' => $client_new_email, + 'description' => $client_new_description + )); + + // insert new client in local cache + $query = 'INSERT INTO '.$wpdb->prefix.'paymill_clients (paymill_client_id, paymill_client_email, paymill_client_description, wp_member_id) VALUES ("'.$client['id'].'", "'.$client_new_email.'", "'.$client_new_description.'", "'.$user_id.'")'; + $wpdb->query($query); + + // check wether cached userdata is still correct + }elseif($client_cache[0]['paymill_client_email'] != $client_new_email || $client_cache[0]['paymill_client_description'] != $client_new_description){ + // update client in paymill + $params = array( + 'id' => $client_cache[0]['paymill_client_id'], + 'email' => $client_new_email, + 'description' => $client_new_description + ); + $client = $clientsObject->update($params); + + // update local cache + $query = 'UPDATE '.$wpdb->prefix.'paymill_clients SET paymill_client_description="'.$client_new_description.'" WHERE paymill_client_email="'.$client_new_email.'"'; + $wpdb->query($query); + + // all still synced, just load client object for safety purposes + }else{ + $client = $clientsObject->getOne($client_cache[0]['paymill_client_id']); + } + + // make transaction + $order = ''; + foreach($_POST['paymill_quantity'] as $product => $quantity){ + $order .= $quantity.'x '.$GLOBALS['paymill_settings']->paymill_pay_button_settings['products'][$product]['title'].'
'; + } + $order = __('Order', 'paymill').' #'.$order_id.'
'.__('Company Name', 'paymill').': '.strip_tags($_POST['company_name']).'
'.__('Forename', 'paymill').': '.strip_tags($_POST['forename']).'
'.__('Surname', 'paymill').': '.strip_tags($_POST['surname']).'
'.__('Street', 'paymill').': '.strip_tags($_POST['street']).'
'.__('Number', 'paymill').': '.strip_tags($_POST['number']).'
'.__('ZIP', 'paymill').': '.strip_tags($_POST['zip']).'
'.__('City', 'paymill').': '.strip_tags($_POST['city']).'
'.__('Country', 'paymill').': '.strip_tags($_POST['paymill_shipping']).'
'.__('Email', 'paymill').': '.strip_tags($_POST['email']).'
'.__('Phone', 'paymill').': '.strip_tags($_POST['phone']).'

'.$order; + + $order_mail = str_replace('
',"\n",$order); + $order = __('Order', 'paymill').' #'.$order_id; + + $params = array( + 'amount' => str_replace('.','',"$total"), // e.g. "4200" for 42.00 EUR + 'currency' => $GLOBALS['paymill_settings']->paymill_pay_button_settings['currency'], // ISO 4217 + 'token' => $_POST['paymillToken'], + 'client' => $client['id'], + 'description' => $order + ); + $transaction = $transactionsObject->create($params); + + // save data to transaction table + $query = 'INSERT INTO '.$wpdb->prefix.'paymill_transactions (paymill_transaction_id, paymill_payment_id, paymill_client_id, pay_button_order_id, paymill_transaction_time, paymill_transaction_data) VALUES ("'.$transaction['id'].'", "'.$transaction['payment']['id'].'", "'.$transaction['client']['id'].'", "'.$order_id.'", "'.$order_id.'", "'.$wpdb->escape(serialize($_POST)).'")'; + $wpdb->query($query); + if(isset($transaction['error']) && (strlen($transaction['error']) > 0 || count($transaction['error']) > 0)){ + echo var_dump($transaction['error']); + die(); + } + + wp_mail($client_new_email, __('Confirmation of your Order', 'paymill'), $order_mail, 'From: "'.get_option('blogname').'" <'.$GLOBALS['paymill_settings']->paymill_pay_button_settings['email_outgoing'].'>'); + wp_mail($GLOBALS['paymill_settings']->paymill_pay_button_settings['email_incoming'], __('New Order received', 'paymill'), $order_mail, 'From: "'.get_option('blogname').'" <'.$GLOBALS['paymill_settings']->paymill_pay_button_settings['email_outgoing'].'>'); + } + } + + add_action('plugins_loaded', 'paymill_pay_button_process_payment'); + + class paymill_pay_button_widget extends WP_Widget{ + /** constructor */ + function __construct() { + parent::WP_Widget('paymill_pay_button_widget', 'Paymill Pay Button', array( 'description' => __('Shows a Paymill Payment Button.', 'paymill'))); + } + function widget($args, $instance){ + global $wpdb; + + if(!$GLOBALS['paymill_active'] && isset($GLOBALS['paymill_settings']->paymill_pay_button_settings['products']) && count($GLOBALS['paymill_settings']->paymill_pay_button_settings['products']) > 0){ + $GLOBALS['paymill_active'] = true; + + echo $args['before_widget']; + + if(strlen($instance['title']) > 0){ + echo $args['before_title']; ?>
'; + require(PAYMILL_DIR.'lib/tpl/pay_button.php'); + + $country = 'DE'; + $currency = $GLOBALS['paymill_settings']->paymill_pay_button_settings['currency']; + $cc_logo = plugins_url('',__FILE__ ).'/../img/cc_logos.png'; + echo '
'.__('Payment', 'paymill').'
'; + require(PAYMILL_DIR.'lib/tpl/checkout_form.php'); + echo ''; + echo '
'; + } + + echo $args['after_widget']; + }else{ + echo '
Error: Paymill can be loaded once only on the same page.
'; + } + } + function update($new_instance, $old_instance){ + $instance = $old_instance; + var_dump($new_instance); + $instance['title'] = strip_tags($new_instance['title']); + $instance['products'] = serialize($new_instance['products']); + + return $instance; + } + function form($instance) { + $products_whitelist = unserialize($instance['products']); + echo' +
+

'.__('Title:', 'paymill').'

+ +
+
+
+

'.__('Show these products only:', 'paymill').'

+ +
+
+ '; + } + } + + add_action('widgets_init', create_function('','register_widget("paymill_pay_button_widget");')); + + // creating shortcodes + // [sv_cb foo="foo-value"] + function paymill_pay_button_shortcode($atts){ + ob_start(); + the_widget('paymill_pay_button_widget',$atts,$args); + return ob_get_clean(); + } + add_shortcode('paymill_pb', 'paymill_pay_button_shortcode'); +?> \ No newline at end of file diff --git a/lib/integration/woocommerce.inc.php b/lib/integration/woocommerce.inc.php new file mode 100644 index 0000000..815750a --- /dev/null +++ b/lib/integration/woocommerce.inc.php @@ -0,0 +1,179 @@ +id = 'paymill'; + $this->icon = plugins_url('',__FILE__ ).'/../img/icon.png'; + $this->cc_icon = plugins_url('',__FILE__ ).'/../img/creditcard-icons.png'; + $this->title = 'Paymill'; + $this->description = 'Payment with credit card.'; + $this->has_fields = true; + + $this->init_form_fields(); + $this->init_settings(); + } + + function get_icon() { + global $woocommerce; + + $icon = $this->icon ? '' . $this->title . ' ' . $this->title . '' : ''; + + return apply_filters( 'woocommerce_gateway_icon', $icon, $this->id ); + } + + public function init_form_fields(){ + $this->form_fields = array( + 'enabled' => array( + 'title' => __( 'Enable/Disable', 'woocommerce' ), + 'type' => 'checkbox', + 'label' => __( 'Enable Paymill Payment', 'woocommerce' ), + 'default' => 'yes' + ), + 'title' => array( + 'title' => __( 'Title', 'woocommerce' ), + 'type' => 'text', + 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), + 'default' => __( 'Paymill Payment', 'woocommerce' ), + 'desc_tip' => true, + ), + 'description' => array( + 'title' => __( 'Customer Message', 'woocommerce' ), + 'type' => 'textarea', + 'default' => '' + ) + ); + } + + public function process_payment( $order_id ) { + global $woocommerce,$wpdb; + + $clientsObject = new Services_Paymill_Clients($GLOBALS['paymill_settings']->paymill_general_settings['api_key_private'], $GLOBALS['paymill_settings']->paymill_general_settings['api_endpoint']); + $transactionsObject = new Services_Paymill_Transactions($GLOBALS['paymill_settings']->paymill_general_settings['api_key_private'], $GLOBALS['paymill_settings']->paymill_general_settings['api_endpoint']); + + $client_new_email = $_POST['billing_email']; + $client_new_description = $_POST['billing_first_name'].' '.$_POST['billing_last_name']; + + $userInfo = get_userdata(get_current_user_id()); + if($userInfo){ + $query = 'SELECT * FROM '.$wpdb->prefix.'paymill_clients WHERE wp_member_id="'.$userInfo->ID.'"'; + $client_cache = $wpdb->get_results($query,ARRAY_A); + + // check wether it's a new client + if(intval($client_cache[0]['wp_member_id']) == 0){ + // create new client in paymill + $client = $clientsObject->create(array( + 'email' => $client_new_email, + 'description' => $client_new_description + )); + + // insert new client in local cache + $query = 'INSERT INTO '.$wpdb->prefix.'paymill_clients (paymill_client_id, paymill_client_email, paymill_client_description, wp_member_id) VALUES ("'.$client['id'].'", "'.$client_new_email.'", "'.$client_new_description.'", "'.$userInfo->ID.'")'; + $wpdb->query($query); + + // check wether cached userdata is still correct + }elseif($client_cache[0]['paymill_client_email'] != $client_new_email || $client_cache[0]['paymill_client_description'] != $client_new_description){ + // update client in paymill + $params = array( + 'id' => $client_cache[0]['paymill_client_id'], + 'email' => $client_new_email, + 'description' => $client_new_description + ); + $client = $clientsObject->update($params); + + // update local cache + $query = 'UPDATE '.$wpdb->prefix.'paymill_clients SET paymill_client_email="'.$client_new_email.'",paymill_client_description="'.$client_new_description.'" WHERE wp_member_id="'.$userInfo->ID.'"'; + $wpdb->query($query); + + // all still synced, just load client object for safety purposes + }else{ + $client = $clientsObject->getOne($client_cache[0]['paymill_client_id']); + } + } + + // make transaction + $total = $woocommerce->cart->total; + $params = array( + 'amount' => str_replace('.','',"$total"), // e.g. "4200" for 42.00 EUR + 'currency' => get_woocommerce_currency(), // ISO 4217 + 'token' => $_POST['paymillToken'], + 'client' => $client['id'], + 'description' => 'Order #'.$order_id + ); + $transaction = $transactionsObject->create($params); + + // save data to transaction table + $query = 'INSERT INTO '.$wpdb->prefix.'paymill_transactions (paymill_transaction_id, paymill_payment_id, paymill_client_id, woocommerce_order_id) VALUES ("'.$transaction['id'].'", "'.$transaction['payment']['id'].'", "'.$transaction['client']['id'].'", "'.$order_id.'")'; + $wpdb->query($query); + + if(isset($transaction['error']['messages'])){ + foreach($transaction['error']['messages'] as $field => $msg){ + $woocommerce->add_error($field.': '.$msg); + } + return; + } + + $order = new WC_Order( $order_id ); + + // Mark as on-hold (we're awaiting the cheque) + //$order->update_status('on-hold', __( 'Awaiting cheque payment', 'woocommerce' )); + + $order->payment_complete(); + + // Reduce stock levels + $order->reduce_order_stock(); + + // Remove cart + $woocommerce->cart->empty_cart(); + + // Return thankyou redirect + return array( + 'result' => 'success', + 'redirect' => $this->get_return_url( $order ) + ); + } + + public function validate_fields(){ + global $woocommerce; + // check Paymill payment + if(empty($_POST['paymillToken'])){ + $woocommerce->add_error('Bitte klicken Sie auf "Zahlungsdaten überprüfen", bevor Sie die Bestellung abschicken.'); + + return false; + } + + return true; + } + + public function payment_fields(){ + global $woocommerce; + if(!$GLOBALS['paymill_active']){ + $GLOBALS['paymill_active'] = true; + + $country = $_REQUEST['country']; + $cart_total = $woocommerce->cart->total; + $currency = get_woocommerce_currency(); + $cc_logo = plugins_url('',__FILE__ ).'/../img/cc_logos.png'; + require_once(PAYMILL_DIR.'lib/tpl/checkout_form.php'); + }else{ + echo '
Error: Paymill can be loaded once only on the same page.
'; + } + } + } + } + } +?> \ No newline at end of file diff --git a/lib/js/jquery.formatCurrency-1.4.0.js b/lib/js/jquery.formatCurrency-1.4.0.js new file mode 100644 index 0000000..40e5468 --- /dev/null +++ b/lib/js/jquery.formatCurrency-1.4.0.js @@ -0,0 +1,244 @@ +// This file is part of the jQuery formatCurrency Plugin. +// +// The jQuery formatCurrency Plugin is free software: you can redistribute it +// and/or modify it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The jQuery formatCurrency Plugin is distributed in the hope that it will +// be useful, but WITHOUT ANY WARRANTY; without even the implied warranty +// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License along with +// the jQuery formatCurrency Plugin. If not, see . + +(function($) { + + $.formatCurrency = {}; + + $.formatCurrency.regions = []; + + // default Region is en + $.formatCurrency.regions[''] = { + symbol: '$', + positiveFormat: '%s%n', + negativeFormat: '(%s%n)', + decimalSymbol: '.', + digitGroupSymbol: ',', + groupDigits: true + }; + + $.fn.formatCurrency = function(destination, settings) { + + if (arguments.length == 1 && typeof destination !== "string") { + settings = destination; + destination = false; + } + + // initialize defaults + var defaults = { + name: "formatCurrency", + colorize: false, + region: '', + global: true, + roundToDecimalPlace: 2, // roundToDecimalPlace: -1; for no rounding; 0 to round to the dollar; 1 for one digit cents; 2 for two digit cents; 3 for three digit cents; ... + eventOnDecimalsEntered: false + }; + // initialize default region + defaults = $.extend(defaults, $.formatCurrency.regions['']); + // override defaults with settings passed in + settings = $.extend(defaults, settings); + + // check for region setting + if (settings.region.length > 0) { + settings = $.extend(settings, getRegionOrCulture(settings.region)); + } + settings.regex = generateRegex(settings); + + return this.each(function() { + $this = $(this); + + // get number + var num = '0'; + num = $this[$this.is('input, select, textarea') ? 'val' : 'html'](); + + //identify '(123)' as a negative number + if (num.search('\\(') >= 0) { + num = '-' + num; + } + + if (num === '' || (num === '-' && settings.roundToDecimalPlace === -1)) { + return; + } + + // if the number is valid use it, otherwise clean it + if (isNaN(num)) { + // clean number + num = num.replace(settings.regex, ''); + + if (num === '' || (num === '-' && settings.roundToDecimalPlace === -1)) { + return; + } + + if (settings.decimalSymbol != '.') { + num = num.replace(settings.decimalSymbol, '.'); // reset to US decimal for arithmetic + } + if (isNaN(num)) { + num = '0'; + } + } + + // evalutate number input + var numParts = String(num).split('.'); + var isPositive = (num == Math.abs(num)); + var hasDecimals = (numParts.length > 1); + var decimals = (hasDecimals ? numParts[1].toString() : '0'); + var originalDecimals = decimals; + + // format number + num = Math.abs(numParts[0]); + num = isNaN(num) ? 0 : num; + if (settings.roundToDecimalPlace >= 0) { + decimals = parseFloat('1.' + decimals); // prepend "0."; (IE does NOT round 0.50.toFixed(0) up, but (1+0.50).toFixed(0)-1 + decimals = decimals.toFixed(settings.roundToDecimalPlace); // round + if (decimals.substring(0, 1) == '2') { + num = Number(num) + 1; + } + decimals = decimals.substring(2); // remove "0." + } + num = String(num); + + if (settings.groupDigits) { + for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++) { + num = num.substring(0, num.length - (4 * i + 3)) + settings.digitGroupSymbol + num.substring(num.length - (4 * i + 3)); + } + } + + if ((hasDecimals && settings.roundToDecimalPlace == -1) || settings.roundToDecimalPlace > 0) { + num += settings.decimalSymbol + decimals; + } + + // format symbol/negative + var format = isPositive ? settings.positiveFormat : settings.negativeFormat; + var money = format.replace(/%s/g, settings.symbol); + money = money.replace(/%n/g, num); + + // setup destination + var $destination = $([]); + if (!destination) { + $destination = $this; + } else { + $destination = $(destination); + } + // set destination + $destination[$destination.is('input, select, textarea') ? 'val' : 'html'](money); + + if ( + hasDecimals && + settings.eventOnDecimalsEntered && + originalDecimals.length > settings.roundToDecimalPlace + ) { + $destination.trigger('decimalsEntered', originalDecimals); + } + + // colorize + if (settings.colorize) { + $destination.css('color', isPositive ? 'black' : 'red'); + } + }); + }; + + // Remove all non numbers from text + $.fn.toNumber = function(settings) { + var defaults = $.extend({ + name: "toNumber", + region: '', + global: true + }, $.formatCurrency.regions['']); + + settings = jQuery.extend(defaults, settings); + if (settings.region.length > 0) { + settings = $.extend(settings, getRegionOrCulture(settings.region)); + } + settings.regex = generateRegex(settings); + + return this.each(function() { + var method = $(this).is('input, select, textarea') ? 'val' : 'html'; + $(this)[method]($(this)[method]().replace('(', '(-').replace(settings.regex, '')); + }); + }; + + // returns the value from the first element as a number + $.fn.asNumber = function(settings) { + var defaults = $.extend({ + name: "asNumber", + region: '', + parse: true, + parseType: 'Float', + global: true + }, $.formatCurrency.regions['']); + settings = jQuery.extend(defaults, settings); + if (settings.region.length > 0) { + settings = $.extend(settings, getRegionOrCulture(settings.region)); + } + settings.regex = generateRegex(settings); + settings.parseType = validateParseType(settings.parseType); + + var method = $(this).is('input, select, textarea') ? 'val' : 'html'; + var num = $(this)[method](); + num = num ? num : ""; + num = num.replace('(', '(-'); + num = num.replace(settings.regex, ''); + if (!settings.parse) { + return num; + } + + if (num.length == 0) { + num = '0'; + } + + if (settings.decimalSymbol != '.') { + num = num.replace(settings.decimalSymbol, '.'); // reset to US decimal for arthmetic + } + + return window['parse' + settings.parseType](num); + }; + + function getRegionOrCulture(region) { + var regionInfo = $.formatCurrency.regions[region]; + if (regionInfo) { + return regionInfo; + } + else { + if (/(\w+)-(\w+)/g.test(region)) { + var culture = region.replace(/(\w+)-(\w+)/g, "$1"); + return $.formatCurrency.regions[culture]; + } + } + // fallback to extend(null) (i.e. nothing) + return null; + } + + function validateParseType(parseType) { + switch (parseType.toLowerCase()) { + case 'int': + return 'Int'; + case 'float': + return 'Float'; + default: + throw 'invalid parseType'; + } + } + + function generateRegex(settings) { + if (settings.symbol === '') { + return new RegExp("[^\\d" + settings.decimalSymbol + "-]", "g"); + } + else { + var symbol = settings.symbol.replace('$', '\\$').replace('.', '\\.'); + return new RegExp(symbol + "|[^\\d" + settings.decimalSymbol + "-]", "g"); + } + } + +})(jQuery); \ No newline at end of file diff --git a/lib/js/livevalidation_custom.js b/lib/js/livevalidation_custom.js new file mode 100644 index 0000000..aaf1407 --- /dev/null +++ b/lib/js/livevalidation_custom.js @@ -0,0 +1,34 @@ +jQuery(document).ready(function () { + + jQuery("body").on("click", "#payment", function() { + var f1 = new LiveValidation('card-number'); + var maximum = 16; + f1.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + f1.add( Validate.Length, { maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum), tooShortMessage:paymill_livevl.tooShort, tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } ); + + var f2 = new LiveValidation('card-cvc'); + var maximum = 4; + var minimum = 3; + f2.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + f2.add( Validate.Length, { minimum: minimum, maximum: maximum, wrongLengthMessage:paymill_livevl.wrongLength.replace('{maximum}',maximum).replace('{minimum}',minimum), tooShortMessage:paymill_livevl.tooShort.replace('{minimum}',minimum), tooLongMessage:paymill_livevl.tooLong.replace('{maximum}',maximum) } ); + + var f3 = new LiveValidation('card-expiry-month'); + var is = 2; + f3.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + f3.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } ); + + var f4 = new LiveValidation('card-expiry-year'); + var is = 4; + f4.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + f4.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } ); + + var f5 = new LiveValidation('transaction-form-account'); + f5.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + + var f6 = new LiveValidation('transaction-form-code'); + var is = 8; + f6.add( Validate.Numericality, { notANumberMessage:paymill_livevl.notANumber, notAnIntegerMessage:paymill_livevl.notAnInteger, wrongNumberMessage:paymill_livevl.wrongNumber, tooLowMessage:paymill_livevl.tooLow, Message:paymill_livevl.tooHigh } ); + f6.add( Validate.Length, { is: is, wrongLengthMessage:paymill_livevl.wrongLength.replace('{is}',is), tooShortMessage:paymill_livevl.tooShort.replace('{is}',is), tooLongMessage:paymill_livevl.tooLong.replace('{is}',is) } ); + }); + +}); \ No newline at end of file diff --git a/lib/js/livevalidation_standalone.compressed.js b/lib/js/livevalidation_standalone.compressed.js new file mode 100644 index 0000000..577d8b4 --- /dev/null +++ b/lib/js/livevalidation_standalone.compressed.js @@ -0,0 +1,4 @@ +// LiveValidation 1.3 (standalone version) +// Copyright (c) 2007-2008 Alec Hill (www.livevalidation.com) +// LiveValidation is licensed under the terms of the MIT License +var LiveValidation=function(B,A){this.initialize(B,A);};LiveValidation.VERSION="1.3 standalone";LiveValidation.TEXTAREA=1;LiveValidation.TEXT=2;LiveValidation.PASSWORD=3;LiveValidation.CHECKBOX=4;LiveValidation.SELECT=5;LiveValidation.FILE=6;LiveValidation.massValidate=function(C){var D=true;for(var B=0,A=C.length;B=300){this.removeMessageAndFieldClass();}var A=this;if(this.timeout){clearTimeout(A.timeout);}this.timeout=setTimeout(function(){A.validate();},A.wait);},doOnBlur:function(A){this.focused=false;this.validate(A);},doOnFocus:function(A){this.focused=true;this.removeMessageAndFieldClass();},getElementType:function(){switch(true){case (this.element.nodeName.toUpperCase()=="TEXTAREA"):return LiveValidation.TEXTAREA;case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="TEXT"):return LiveValidation.TEXT;case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="PASSWORD"):return LiveValidation.PASSWORD;case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="CHECKBOX"):return LiveValidation.CHECKBOX;case (this.element.nodeName.toUpperCase()=="INPUT"&&this.element.type.toUpperCase()=="FILE"):return LiveValidation.FILE;case (this.element.nodeName.toUpperCase()=="SELECT"):return LiveValidation.SELECT;case (this.element.nodeName.toUpperCase()=="INPUT"):throw new Error("LiveValidation::getElementType - Cannot use LiveValidation on an "+this.element.type+" input!");default:throw new Error("LiveValidation::getElementType - Element must be an input, select, or textarea!");}},doValidations:function(){this.validationFailed=false;for(var C=0,A=this.validations.length;CNumber(C)){Validate.fail(K);}break;}return true;},Format:function(C,E){var C=String(C);var E=E||{};var A=E.failureMessage||"Not valid!";var B=E.pattern||/./;var D=E.negate||false;if(!D&&!B.test(C)){Validate.fail(A);}if(D&&B.test(C)){Validate.fail(A);}return true;},Email:function(B,C){var C=C||{};var A=C.failureMessage||"Must be a valid email address!";Validate.Format(B,{failureMessage:A,pattern:/^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i});return true;},Length:function(F,G){var F=String(F);var G=G||{};var E=((G.minimum)||(G.minimum==0))?G.minimum:null;var H=((G.maximum)||(G.maximum==0))?G.maximum:null;var C=((G.is)||(G.is==0))?G.is:null;var A=G.wrongLengthMessage||"Must be "+C+" characters long!";var B=G.tooShortMessage||"Must not be less than "+E+" characters long!";var D=G.tooLongMessage||"Must not be more than "+H+" characters long!";switch(true){case (C!==null):if(F.length!=Number(C)){Validate.fail(A);}break;case (E!==null&&H!==null):Validate.Length(F,{tooShortMessage:B,minimum:E});Validate.Length(F,{tooLongMessage:D,maximum:H});break;case (E!==null):if(F.lengthNumber(H)){Validate.fail(D);}break;default:throw new Error("Validate::Length - Length(s) to validate against must be provided!");}return true;},Inclusion:function(H,F){var F=F||{};var K=F.failureMessage||"Must be included in the list!";var G=(F.caseSensitive===false)?false:true;if(F.allowNull&&H==null){return true;}if(!F.allowNull&&H==null){Validate.fail(K);}var D=F.within||[];if(!G){var A=[];for(var C=0,B=D.length;C"); + + // Paymill Formular entfernen + jQuery("#paymill_payment-form").remove(); + + jQuery(".checkout").submit(); + } + + jQuery(".submit-button").removeAttr("disabled"); + } + + jQuery("body").on("click", "#place_order", function() { + // check which payment method is active + if(jQuery('#form-switch-credit').hasClass('paymill_form-switch_active')){ + + if (false == paymill.validateCardNumber(jQuery('.paymill_card-number').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateCardNumber); + return false; + } + + if (false == paymill.validateExpiry(jQuery('.paymill_card-expiry-month').val(), jQuery('.paymill_card-expiry-year').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateExpiry); + return false; + } + + if (false == paymill.validateCvc(jQuery('#card-cvc').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateCvc); + return false; + } + + paymill.createToken({ + number:jQuery('.paymill_card-number').val(), + exp_month:jQuery('.paymill_card-expiry-month').val(), + exp_year:jQuery('.paymill_card-expiry-year').val(), + cvc:jQuery('.paymill_card-cvc').val(), + cardholdername:jQuery('.paymill_holdername').val(), + amount:jQuery('.paymill_amount').val(), + currency:jQuery('.paymill_currency').val() + }, PaymillResponseHandler); + + return false; + }else if(jQuery('#form-switch-elv').hasClass('paymill_form-switch_active')){ + if (false == paymill.validateAccountNumber(jQuery('#transaction-form-account').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateAccountNumber); + return false; + } + + if (false == paymill.validateBankCode(jQuery('#transaction-form-code').val())) { + jQuery(".paymill_payment_errors").text(paymill_lang.validateBankCode); + return false; + } + + paymill.createToken({ + number:jQuery('#transaction-form-account').val(), + bank:jQuery('#transaction-form-code').val(), + accountholder:jQuery('.paymill_holdername').val(), + amount:jQuery('.paymill_amount').val(), + currency:jQuery('.paymill_currency').val() + }, PaymillResponseHandler); + + return false; + } + }); + + // show ELV as menu option + jQuery('body').on('click', '#form-switch-elv', function() { + jQuery('#form-credit').hide('slow'); + jQuery('#form-switch-credit').removeClass('paymill_form-switch_active'); + + jQuery('#form-elv').show('slow'); + jQuery('#form-switch-elv').addClass('paymill_form-switch_active'); + }); + jQuery('body').on('click', '#form-switch-credit', function() { + jQuery('#form-elv').hide('slow'); + jQuery('#form-switch-elv').removeClass('paymill_form-switch_active'); + + jQuery('#form-credit').show('slow'); + jQuery('#form-switch-credit').addClass('paymill_form-switch_active'); + }); + + jQuery("body").on("change", "#card-number", function() { + var cc_type = paymill.cardType(jQuery('#card-number').val()); + //alert(cc_type); + if(cc_type == 'Visa'){ + jQuery('#cctype').show().css("backgroundPosition","0px"); + }else if(cc_type == 'Mastercard'){ + jQuery('#cctype').show().css("backgroundPosition","-51px 0"); + }else if(cc_type == 'American Express'){ + jQuery('#cctype').show().css("backgroundPosition","-100px 0"); + }else if(cc_type == 'Diners Club'){ + jQuery('#cctype').show().css("backgroundPosition","-150px 0"); + }else if(cc_type == 'Discover'){ + jQuery('#cctype').show().css("backgroundPosition","-200px 0"); + }else if(cc_type == 'JCB'){ + jQuery('#cctype').show().css("backgroundPosition","-250px 0"); + }else if(cc_type == 'Maestro'){ + jQuery('#cctype').show().css("backgroundPosition","-300px 0"); + }else if(cc_type == 'CuP'){ + jQuery('#cctype').show().css("backgroundPosition","-350px 0"); + }else{ + jQuery('#cctype').hide(); + } + }); + +}); \ No newline at end of file diff --git a/lib/js/paymill_admin.js b/lib/js/paymill_admin.js new file mode 100644 index 0000000..3a2ba61 --- /dev/null +++ b/lib/js/paymill_admin.js @@ -0,0 +1,24 @@ +jQuery(document).ready(function () { + jQuery('#common_toggle').click(function() { + jQuery('#common_content').toggle('slow', function() { + // Animation complete. + + }); + return false; + }); + jQuery('#products_toggle').click(function() { + jQuery('#products_content').toggle('slow', function() { + // Animation complete. + + }); + return false; + }); + jQuery('#shipping_toggle').click(function() { + jQuery('#shipping_content').toggle('slow', function() { + // Animation complete. + + }); + return false; + }); + +}); \ No newline at end of file diff --git a/lib/tpl/checkout_form.php b/lib/tpl/checkout_form.php new file mode 100644 index 0000000..8598f25 --- /dev/null +++ b/lib/tpl/checkout_form.php @@ -0,0 +1,49 @@ +
+ +
+ +
+ + +
+
+ +
+ +
+
+ + +
+
+
+ + +
+
+ + + / + +
+
+
+
+ + +
+
+ + +
+
+ + + +
\ No newline at end of file diff --git a/lib/tpl/pay_button.php b/lib/tpl/pay_button.php new file mode 100644 index 0000000..fb4e70b --- /dev/null +++ b/lib/tpl/pay_button.php @@ -0,0 +1,78 @@ +
+paymill_pay_button_settings['products'] as $id => $product){ + if(strlen($product['title']) > 0 && (!is_array($products_whitelist) || $products_whitelist[0] == '' || in_array($id,$products_whitelist))){ +?> +
+
+ 0){ ?>
+
+ +
+ 0){ ?>
paymill_pay_button_settings['number_decimal'],$GLOBALS['paymill_settings']->paymill_pay_button_settings['number_thousands']).' '.$GLOBALS['paymill_settings']->paymill_pay_button_settings['currency']; ?>
+ 0){ ?>
+ 0){ ?>
+
+ + +
0
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
\ No newline at end of file diff --git a/lib/translate/paymill-de_DE.po b/lib/translate/paymill-de_DE.po new file mode 100644 index 0000000..7dce3f1 --- /dev/null +++ b/lib/translate/paymill-de_DE.po @@ -0,0 +1,427 @@ +msgid "" +msgstr "" +"Project-Id-Version: Paymill\n" +"POT-Creation-Date: 2013-06-08 20:28+0100\n" +"PO-Revision-Date: 2013-06-08 20:38+0100\n" +"Last-Translator: Matthias Reuter \n" +"Language-Team: Matthias Reuter \n" +"Language: DE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-KeywordsList: esc_attr__;__;_e\n" +"X-Poedit-Basepath: d:\\BUSINESS\\KUNDEN\\elbnetz\\paymill\\DEV\\paymill\\\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: d:\\BUSINESS\\KUNDEN\\elbnetz\\paymill\\DEV\\paymill\n" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:116 +msgid "Invalid Credit Card Number" +msgstr "Ungültige Kreditkartennummer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:117 +msgid "Invalid Expiration Date" +msgstr "Ungültiges Ablaufdatum" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:118 +msgid "Invalid CVC" +msgstr "Ungültige Prüfziffer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:119 +msgid "Invalid Account Number" +msgstr "Ungültige Kontonummer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:120 +msgid "Invalid Bank Code" +msgstr "Ungültige Bankleitzahl" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:129 +msgid "Must be {is} characters long!" +msgstr "Muss genau {is} Zeichen lang sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:130 +msgid "Must not be less than {minimum} characters long!" +msgstr "Muss länger als {minimum} sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:131 +msgid "Must not be more than {maximum} characters long!" +msgstr "Müssen weniger als {maximum} Zeichen sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:132 +msgid "Must be a number!" +msgstr "Muss eine Nummer sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:133 +msgid "Must be an integer!" +msgstr "Muss ein Integer sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:134 +msgid "Must be {is}!" +msgstr "Muss {is} sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:135 +msgid "Must not be less than {minimum}!" +msgstr "Darf nicht kleiner als {minimum} sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:136 +msgid "Must not be more than {maximum}!" +msgstr "Darf nicht größer als {maximum} sein!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:71 +msgid "General Plugin Settings" +msgstr "Generelle Plugin Einstellungen" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:73 +msgid "Paymill PRIVATE API key" +msgstr "Paymill PRIVATE API Key" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:74 +msgid "Paymill PUBLIC API key" +msgstr "Paymill PUBLIC API Key" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:75 +msgid "Paymill API endpoint URL" +msgstr "Paymill API Endpoint URL" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:89 +msgid "Currency" +msgstr "Währung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:90 +msgid "Number Format: Decimal Point" +msgstr "Nummern Formatierung: Dezimalpunkt" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:91 +msgid "Number Format: Thousands Seperator" +msgstr "Nummern Formatierung: Tausender-Trenner" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:92 +msgid "Outgoing Email" +msgstr "Ausgehende Emailadresse" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:93 +msgid "Incoming Email" +msgstr "Eingehende Emailadresse" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:105 +msgid "Product" +msgstr "Produkt" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:106 +msgid "Description" +msgstr "Beschreibung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:107 +msgid "Price" +msgstr "Preis" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:108 +msgid "VAT" +msgstr "Umsatzsteuer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:109 +msgid "Delivery Time" +msgstr "Lieferzeit" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:122 +msgid "Shipping Country" +msgstr "Lieferland" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:123 +msgid "Shipping Costs" +msgstr "Lieferkosten" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:124 +msgid "Shipping VAT" +msgstr "Liefer Umsatzsteuer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:133 +msgid "Please insert your API settings here." +msgstr "Bitte fügen Sie Ihre API Einstellungen hier ein." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +msgid "Common Settings" +msgstr "Gemeinsame Einstellungen" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +msgid "The Paymill Pay Buton is a simple, independent payment solution." +msgstr "" +"Der Paymill Pay Button ist eine einfache, unabhängige Bezahlmöglichkeit." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +msgid "Configure common settings" +msgstr "Gemeinsame Einstellungen" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "Toggle View" +msgstr "Ansicht umschalten" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +msgid "Products" +msgstr "Produkte" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +msgid "" +"Configure products for the Pay Button. This list has a dynamic length and " +"extends for 5 extra slots when last slot is filled and saved." +msgstr "" +"Konfigurieren Sie die Produkte für den Pay Button. Diese Liste hat eine " +"dynamische Länge und erweitert sich jedesmal um 5 extra Einträge, wenn der " +"letzte Eintrag gefüllt und abgespeichert wurde." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "Shipping" +msgstr "Lieferung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "" +"Set delivery countries and shipping costs. This list has a dynamic length " +"and extends for 5 extra slots when last slot is filled and saved." +msgstr "" +"Legen Sie Lieferländer und Lieferkosten fest. Diese Liste hat eine " +"dynamische Länge und erweitert sich jedesmal um 5 extra Einträge, wenn der " +"letzte Eintrag gefüllt und abgespeichert wurde." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:145 +msgid "Insert your Paymill PRIVATE API key." +msgstr "Fügen Sie Ihren PRIVATEN Paymill API Schlüssel ein." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:146 +msgid "Insert your Paymill PUBLIC API key." +msgstr "" +"Fügen Sie Ihren ÖFFENTLICHEN Paymill API Schlüssel ein." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:147 +msgid "Insert your Paymill endpoint URL." +msgstr "Fügen Sie Ihre Paymill Endpoint Adresse ein." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:166 +msgid "" +"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\"" +msgstr "" +"Währung, ISO 4217 z.B. \"EUR\" or \"GBP\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:167 +msgid "Set a symbol used for decimal point. Default: ." +msgstr "Lege ein Symbol für den Dezimalpunkt fest. Standard: ." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:168 +msgid "Set a symbol used for thousands seperator. Default: ," +msgstr "Lege ein Symbol für das Tausender-Trennzeichen fest. Standard: ," + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:169 +msgid "Outgoing Emailaddress for customer order confirmation mail." +msgstr "Ausgehende Emailadresse für die Kundenbestellbestätigung." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:170 +msgid "Incoming Emailaddress for Copy of customer order confirmation mail." +msgstr "Eingehende Emailadresse für eine Kopie der Kundenbestellbestätigung." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:172 +msgid "Name of the available delivery country, e.g. \"England\"" +msgstr "Name des verfügbaren Lieferlandes, z.B. \"England\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:173 +msgid "Gross fee for the flat shipping costs., e.g. \"7\" or \"4.90\"" +msgstr "" +"Brutto Gebühr für die pauschalen Versandkosten, z.B. \"7\" oder \"4.90\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:174 +#, php-format +msgid "" +"Value-Added-Tax Rate in % for the flat shipping costs., e.g. \"19\" or \"7\"" +msgstr "" +"Umsatzsteuerrate in % für die pauschalen Versandkosten, z.B. \"19\" oder " +"\"7\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:176 +msgid "Name of the product" +msgstr "Name des Produkts" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:177 +msgid "Detailed description of the product" +msgstr "Detaillierte Beschreibung des Produkts" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:178 +msgid "Gross Price of the product, e.g. \"40\" or \"6.99\"" +msgstr "Brutto Preis des Produkts, z.B. \"40\" oder \"6.99\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:179 +#, php-format +msgid "Value-Added-Tax Rate in % for the product, e.g. \"19\" or \"7\"" +msgstr "Umsatzsteuerrate in % für das Produkt, z.B. \"19\" oder \"7\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:180 +msgid "Delivery Time of the product, e.g. \"2 Days\" or \"1 Week\"" +msgstr "Lieferzeit des Produkts, z.B. \"2 Tage\" oder \"1 Woche\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:63 +msgid "Order" +msgstr "Bestellung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:43 +msgid "Company Name" +msgstr "Firmenname" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:47 +msgid "Forename" +msgstr "Vorname" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:51 +msgid "Surname" +msgstr "Nachname" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:55 +msgid "Street" +msgstr "Straße" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:59 +msgid "Number" +msgstr "Nummer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:63 +msgid "ZIP" +msgstr "PLZ" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:67 +msgid "City" +msgstr "Ort" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +msgid "Country" +msgstr "Land" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:71 +msgid "Email" +msgstr "Email" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:75 +msgid "Phone" +msgstr "Telefon" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:82 +msgid "Confirmation of your Order" +msgstr "Bestellbestätigung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:83 +msgid "New Order received" +msgstr "Neue Bestellung erhalten" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:92 +msgid "Shows a Paymill Payment Button." +msgstr "Zeigt einen Paymill Payment Button." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:107 +msgid "Thank you for your order." +msgstr "Vielen Dank für Ihre Bestellung." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:117 +msgid "Payment" +msgstr "Bezahlung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:119 +msgid "Pay now" +msgstr "Jetzt bezahlen" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:140 +msgid "Title:" +msgstr "Titel:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:147 +msgid "Show these products only:" +msgstr "Zeige nur diese Produkte:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:150 +msgid "All Products" +msgstr "Alle Produkte" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:42 +msgid "Enable/Disable" +msgstr "Aktivieren/Deaktivieren" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:44 +msgid "Enable Paymill Payment" +msgstr "Aktiviere Paymill Bezahlung" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:48 +msgid "Title" +msgstr "Titel" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:50 +msgid "This controls the title which the user sees during checkout." +msgstr "" +"Dies legt den Titel fest, den ein Benutzer während des Bezahlprozesses sieht." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:51 +msgid "Paymill Payment" +msgstr "Paymill Payment" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:55 +msgid "Customer Message" +msgstr "Kundennachricht" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:8 +msgid "Name" +msgstr "Name" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:11 +msgid "Credit Card" +msgstr "Kreditkarte" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:15 +msgid "Debit Payment" +msgstr "ELV" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:21 +msgid "Credit Card Number" +msgstr "Kreditkarten Nummer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:26 +msgid "CVC" +msgstr "Prüfziffer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:30 +msgid "Expire Date (MM/YYYY)" +msgstr "Gültigkeitsdatum (MM/JJJJ)" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:38 +msgid "Account #" +msgstr "Kontonummer" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:42 +msgid "Bank code" +msgstr "Bankleitzahl" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:17 +msgid "% VAT included." +msgstr "% USt. inbegriffen." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:18 +msgid "Delivery Time: " +msgstr "Lieferzeit:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:25 +msgid "Choose Country" +msgstr "Wähle ein Land" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:36 +msgid "Total Price:" +msgstr "Gesamtsumme:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:41 +msgid "Address" +msgstr "Adresse" diff --git a/lib/translate/paymill-en_GB.po b/lib/translate/paymill-en_GB.po new file mode 100644 index 0000000..9652a2a --- /dev/null +++ b/lib/translate/paymill-en_GB.po @@ -0,0 +1,410 @@ +msgid "" +msgstr "" +"Project-Id-Version: Paymill\n" +"POT-Creation-Date: 2013-06-07 19:56+0100\n" +"PO-Revision-Date: 2013-06-07 19:57+0100\n" +"Last-Translator: Matthias Reuter \n" +"Language-Team: Matthias Reuter \n" +"Language: EN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-KeywordsList: esc_attr__;__;_e\n" +"X-Poedit-Basepath: d:\\BUSINESS\\KUNDEN\\elbnetz\\paymill\\DEV\\paymill\\\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: d:\\BUSINESS\\KUNDEN\\elbnetz\\paymill\\DEV\\paymill\n" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:115 +msgid "Invalid Credit Card Number" +msgstr "Invalid Credit Card Number" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:116 +msgid "Invalid Expiration Date" +msgstr "Invalid Expiration Date" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:117 +msgid "Invalid CVC" +msgstr "Invalid CVC" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:118 +msgid "Invalid Account Number" +msgstr "Invalid Account Number" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:119 +msgid "Invalid Bank Code" +msgstr "Invalid Bank Code" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:128 +msgid "Must be {is} characters long!" +msgstr "Must be {is} characters long!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:129 +msgid "Must not be less than {minimum} characters long!" +msgstr "Must not be less than {minimum} characters long!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:130 +msgid "Must not be more than {maximum} characters long!" +msgstr "Must not be more than {maximum} characters long!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:131 +msgid "Must be a number!" +msgstr "Must be a number!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:132 +msgid "Must be an integer!" +msgstr "Must be an integer!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:133 +msgid "Must be {is}!" +msgstr "Must be {is}!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:134 +msgid "Must not be less than {minimum}!" +msgstr "Must not be less than {minimum}!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/paymill.php:135 +msgid "Must not be more than {maximum}!" +msgstr "Must not be more than {maximum}!" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:73 +msgid "Paymill PRIVATE API key" +msgstr "Paymill PRIVATE API key" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:74 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:146 +msgid "Paymill PUBLIC API key" +msgstr "Paymill PUBLIC API key" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:75 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:147 +msgid "Paymill API endpoint URL" +msgstr "Paymill API endpoint URL" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:89 +msgid "Currency" +msgstr "Currency" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:90 +msgid "Number Format: Decimal Point" +msgstr "Number Format: Decimal Point" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:91 +msgid "Number Format: Thousands Seperator" +msgstr "Number Format: Thousands Seperator" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:92 +msgid "Outgoing Email" +msgstr "Outgoing Email" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:93 +msgid "Incoming Email" +msgstr "Incoming Email" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:105 +msgid "Product" +msgstr "Product" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:106 +msgid "Description" +msgstr "Description" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:107 +msgid "Price" +msgstr "Price" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:108 +msgid "VAT" +msgstr "VAT" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:109 +msgid "Delivery Time" +msgstr "Delivery Time" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:122 +msgid "Shipping Country" +msgstr "Shipping Country" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:123 +msgid "Shipping Costs" +msgstr "Shipping Costs" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:124 +msgid "Shipping VAT" +msgstr "Shipping VAT" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:133 +msgid "Please insert your API settings here." +msgstr "Please insert your API settings here." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +msgid "Common Settings" +msgstr "Common Settings" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +msgid "" +"

The Paymill Pay Buton is a simple, independent payment solution.Configure common settings." +msgstr "" +"

The Paymill Pay Buton is a simple, independent payment solution.Configure common settings." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:134 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "Toggle View" +msgstr "Toggle View" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +msgid "Products" +msgstr "Products" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:135 +msgid "" +"Configure products for the Pay Button. This list has a dynamic length and " +"extends for 5 extra slots when last slot is filled and saved." +msgstr "" +"Configure products for the Pay Button. This list has a dynamic length and " +"extends for 5 extra slots when last slot is filled and saved." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "Shipping" +msgstr "Shipping" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:136 +msgid "" +"Set delivery countries and shipping costs. This list has a dynamic length " +"and extends for 5 extra slots when last slot is filled and saved." +msgstr "" +"Set delivery countries and shipping costs. This list has a dynamic length " +"and extends for 5 extra slots when last slot is filled and saved." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:145 +msgid "Insert your Paymill PRIVATE API key." +msgstr "Insert your Paymill PRIVATE API key." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:166 +msgid "" +"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\"" +msgstr "" +"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:167 +msgid "Set a symbol used for decimal point. Default: ." +msgstr "Set a symbol used for decimal point. Default: ." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:168 +msgid "Set a symbol used for thousands seperator. Default: ," +msgstr "Set a symbol used for thousands seperator. Default: ," + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:169 +msgid "Outgoing Emailaddress for customer order confirmation mail." +msgstr "Outgoing Emailaddress for customer order confirmation mail." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:170 +msgid "Incoming Emailaddress for Copy of customer order confirmation mail." +msgstr "Incoming Emailaddress for Copy of customer order confirmation mail." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:172 +msgid "Name of the available delivery country, e.g. \"England\"" +msgstr "Name of the available delivery country, e.g. \"England\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:173 +msgid "Gross fee for the flat shipping costs., e.g. \"7\" or \"4.90\"" +msgstr "Gross fee for the flat shipping costs., e.g. \"7\" or \"4.90\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:174 +#, php-format +msgid "" +"Value-Added-Tax Rate in % for the flat shipping costs., e.g. \"19\" or \"7\"" +msgstr "" +"Value-Added-Tax Rate in % for the flat shipping costs., e.g. \"19\" or \"7\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:176 +msgid "Name of the product" +msgstr "Name of the product" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:177 +msgid "Detailed description of the product" +msgstr "Detailed description of the product" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:178 +msgid "Gross Price of the product, e.g. \"40\" or \"6.99\"" +msgstr "Gross Price of the product, e.g. \"40\" or \"6.99\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:179 +#, php-format +msgid "Value-Added-Tax Rate in % for the product, e.g. \"19\" or \"7\"" +msgstr "Value-Added-Tax Rate in % for the product, e.g. \"19\" or \"7\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/config.inc.php:180 +msgid "Delivery Time of the product, e.g. \"2 Days\" or \"1 Week\"" +msgstr "Delivery Time of the product, e.g. \"2 Days\" or \"1 Week\"" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:63 +msgid "Order" +msgstr "Order" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:43 +msgid "Company Name" +msgstr "Company Name" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:47 +msgid "Forename" +msgstr "Forename" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:51 +msgid "Surname" +msgstr "Surname" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:55 +msgid "Street" +msgstr "Street" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:59 +msgid "Number" +msgstr "Number" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:63 +msgid "ZIP" +msgstr "ZIP" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:67 +msgid "City" +msgstr "City" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +msgid "Country" +msgstr "Country" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:71 +msgid "Email" +msgstr "Email" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:60 +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:75 +msgid "Phone" +msgstr "Phone" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:82 +msgid "Confirmation of your Order" +msgstr "Confirmation of your Order" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:83 +msgid "New Order received" +msgstr "New Order received" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:92 +msgid "Shows a Paymill Payment Button." +msgstr "Shows a Paymill Payment Button." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:107 +msgid "Thank you for your order." +msgstr "Thank you for your order." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:117 +msgid "Payment" +msgstr "Payment" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:119 +msgid "Pay now" +msgstr "Pay now" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:140 +msgid "Title:" +msgstr "Title:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:147 +msgid "Show these products only:" +msgstr "Show these products only:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/pay_button.inc.php:150 +msgid "All Products" +msgstr "All Products" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:42 +msgid "Enable/Disable" +msgstr "Enable/Disable" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:44 +msgid "Enable Paymill Payment" +msgstr "Enable Paymill Payment" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:48 +msgid "Title" +msgstr "Title" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:50 +msgid "This controls the title which the user sees during checkout." +msgstr "This controls the title which the user sees during checkout." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:51 +msgid "Paymill Payment" +msgstr "Paymill Payment" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/integration/woocommerce.inc.php:55 +msgid "Customer Message" +msgstr "Customer Message" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:8 +msgid "Name" +msgstr "Name" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:11 +msgid "Credit Card" +msgstr "Credit Card" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:15 +msgid "Debit Payment" +msgstr "Debit Payment" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:21 +msgid "Credit Card Number" +msgstr "Credit Card Number" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:26 +msgid "CVC" +msgstr "CVC" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:30 +msgid "Expire Date (MM/YYYY)" +msgstr "Expire Date (MM/YYYY)" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:38 +msgid "Account #" +msgstr "Account #" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/checkout_form.php:42 +msgid "Bank code" +msgstr "Bank code" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:17 +msgid "% VAT included." +msgstr "% VAT included." + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:18 +msgid "Delivery Time: " +msgstr "Delivery Time: " + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:25 +msgid "Choose Country" +msgstr "Choose Country" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:36 +msgid "Total Price:" +msgstr "Total Price:" + +#: d:\BUSINESS\KUNDEN\elbnetz\paymill\DEV\paymill/lib/tpl/pay_button.php:41 +msgid "Address" +msgstr "Address" diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..945126c --- /dev/null +++ b/license.txt @@ -0,0 +1,18 @@ + Paymill WordPress Plugin + is a plugin based on Paymill API allowing credit card payment in WordPress. (Currently supports WooCommerce only) + Code (c) 2013 Matthias Reuter + Project Leader: Matthias Reuter + Project Website: https://www.paymill.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . \ No newline at end of file diff --git a/manual_de.pdf b/manual_de.pdf new file mode 100644 index 0000000..1393a8b Binary files /dev/null and b/manual_de.pdf differ diff --git a/manual_en.pdf b/manual_en.pdf new file mode 100644 index 0000000..98cc1c5 Binary files /dev/null and b/manual_en.pdf differ diff --git a/paymill.php b/paymill.php new file mode 100644 index 0000000..66438bd --- /dev/null +++ b/paymill.php @@ -0,0 +1,143 @@ +prefix.'paymill_clients ( + paymill_client_id varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + paymill_client_email varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + paymill_client_description varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + wp_member_id int(11) NOT NULL, + PRIMARY KEY ( paymill_client_id), + KEY paymill_client_email ( paymill_client_email));'; + +$sql .= 'CREATE TABLE '.$wpdb->prefix.'paymill_transactions ( + paymill_transaction_id varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + paymill_payment_id varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + paymill_client_id varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + paymill_transaction_time int(11) NOT NULL, + paymill_transaction_data varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, + woocommerce_order_id int(11) NOT NULL, + pay_button_order_id int(11) NOT NULL, + PRIMARY KEY ( paymill_transaction_id), + KEY paymill_payment_id ( paymill_payment_id));'; + + dbDelta($sql); + + if(!get_option('paymill_db_version')){ + add_option('paymill_db_version', PAYMILL_VERSION); + }elseif(get_option('paymill_db_version') != PAYMILL_VERSION){ + update_option('paymill_db_version', PAYMILL_VERSION); + } +} + +register_activation_hook(__FILE__,'paymill_install'); + +if(!get_option('paymill_db_version')){ + paymill_install(); +}elseif(get_option('paymill_db_version') != PAYMILL_VERSION){ + paymill_install(); +} + + /* + load config + */ + require_once('lib/config.inc.php'); + + /* + load admin scripts + */ + function pw_load_scripts($hook) { + if(!in_array($_GET['tab'],$GLOBALS['paymill_settings']->setting_keys)){ + return; + } + + wp_enqueue_script( 'paymill_admin_js', plugins_url('/lib/js/paymill_admin.js',__FILE__ ), array('jquery'), PAYMILL_VERSION); + } + add_action('admin_enqueue_scripts', 'pw_load_scripts'); + + /* + load Paymill API + */ + require_once('lib/api/Transactions.php'); + require_once('lib/api/Clients.php'); + + /* + load payment forms + */ + require_once(PAYMILL_DIR.'lib/integration/pay_button.inc.php'); // pay button + require_once(PAYMILL_DIR.'lib/integration/woocommerce.inc.php'); // WooCommerce + + function paymill_scripts(){ + wp_deregister_script(array('paymill_bridge','paymill_bridge_custom')); + wp_enqueue_script('jquery.formatCurrency-1.4.0.js', plugins_url( '/lib/js/jquery.formatCurrency-1.4.0.js' , __FILE__ ), array('jquery'), PAYMILL_VERSION); + wp_enqueue_script('paymill_bridge', 'https://bridge.paymill.de/', array('jquery'), PAYMILL_VERSION); + wp_localize_script('paymill_bridge', 'paymill_lang', array( + 'validateCardNumber' => esc_attr__('Invalid Credit Card Number', 'paymill'), + 'validateExpiry' => esc_attr__('Invalid Expiration Date', 'paymill'), + 'validateCvc' => esc_attr__('Invalid CVC', 'paymill'), + 'validateAccountNumber' => esc_attr__('Invalid Account Number', 'paymill'), + 'validateBankCode' => esc_attr__('Invalid Bank Code', 'paymill'), + 'decimalSymbol' => esc_attr__($GLOBALS['paymill_settings']->paymill_pay_button_settings['number_decimal'], 'paymill'), + 'digitGroupSymbol' => esc_attr__($GLOBALS['paymill_settings']->paymill_pay_button_settings['number_thousands'], 'paymill'), + 'symbol' => esc_attr__($GLOBALS['paymill_settings']->paymill_pay_button_settings['currency'], 'paymill'), + )); + wp_enqueue_script('paymill_bridge_custom', plugins_url( '/lib/js/paymill.js' , __FILE__ ), array('paymill_bridge'), PAYMILL_VERSION); + wp_enqueue_script('livevalidation', plugins_url( '/lib/js/livevalidation_standalone.compressed.js' , __FILE__ ), array('paymill_bridge_custom'), PAYMILL_VERSION); + wp_enqueue_script('livevalidation_custom', plugins_url( '/lib/js/livevalidation_custom.js' , __FILE__ ), array('livevalidation'), PAYMILL_VERSION); + wp_localize_script('livevalidation_custom', 'paymill_livevl', array( + 'wrongLength' => esc_attr__('Must be {is} characters long!', 'paymill'), + 'tooShort' => esc_attr__('Must not be less than {minimum} characters long!', 'paymill'), + 'tooLong' => esc_attr__('Must not be more than {maximum} characters long!', 'paymill'), + 'notANumber' => esc_attr__('Must be a number!', 'paymill'), + 'notAnInteger' => esc_attr__('Must be an integer!', 'paymill'), + 'wrongNumber' => esc_attr__('Must be {is}!', 'paymill'), + 'tooLow' => esc_attr__('Must not be less than {minimum}!', 'paymill'), + 'tooHigh' => esc_attr__('Must not be more than {maximum}!', 'paymill'), + )); + + wp_enqueue_style('paymill', plugins_url( '/lib/css/paymill.css' , __FILE__ ), $deps, PAYMILL_VERSION, $media); + } + add_action('wp_enqueue_scripts', 'paymill_scripts'); + +?> \ No newline at end of file