diff --git a/CHANGES.md b/CHANGES.md
index 67def80..b1070e9 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -3,6 +3,16 @@
Changelog
=========
+1.6
+-----
+* Major Update!
+* Common: payment channel SEPA added
+* Common: update to new API PHP Wrapper
+* Common: better theme support
+* MagicMembers: released as final
+* WooCommerce: many bugs fixed, support for webhooks added
+* PayButton: completely rewritten
+
1.5.2
-----
* Common: "Fatal error: Call to a member function payment_complete() on a non-object" fixed
diff --git a/FAQ.md b/FAQ.md
index ebb5a7c..e2e76c4 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -8,6 +8,9 @@ Is this plugin for free?
This plugin is for free and licensed to GPL.
It's open source following the GPL policy.
+= How can I revert all changes or reset the plugin? =
+Paymill for WordPress brings an uninstall routine which allows completely removing all data generated by the plugin from WordPress. This is a great feature for a plugin reset, too which helps if there were upgrade or go live issues. You just have to go to your WordPress Admin Dashboard -> Plugins Overview and deactivate Paymill for WordPress. After that, a "delete" Link will appear which allows completely removing Paymill for WordPress.
+
Does this plugin calls to another server?
-----------------------------------------
Yes. As Pamill is a payment service provider, it is absolutely required to call home to make sure that the payments are valid.
@@ -15,7 +18,7 @@ We are talking about three different reasons for calling home:
1. PAYMILL Javascript Bridge makes sure that payment data is correct and creates a payment token delivered to your server after checkout. This avoids delivering payment data to your server, what is -in most cases- absolutely prohibited by all common credit card providers.
2. PAYMILL PHP Bridge finishes the order and delivers the generated token to the PAYMILL server.
-3. For security purposes we will implement a feature which delivers WordPress version number and PAYMILL Plugin version number upon payment process. This will give us the ability to warn paymill merchants who are using a very outdated WordPress version or about known security holes in specific version when still using them.
+3. For security purposes there is a feature which delivers WordPress version number and PAYMILL Plugin version number upon payment process. This will give us the ability to warn paymill merchants who are using a very outdated WordPress version or about known security holes in specific version when still using them.
Are there any fees for payments?
--------------------------------
@@ -45,6 +48,11 @@ What is ELV and why it's supported?
ELV is a German banking service and stands for "Elektronisches Lastschriftverfahren".
This is a very convenience payment solution for German users, as credit cards are not very common in Germany compared to e.g. USA.
+What is SEPA and why it's supported?
+-----------------------------------
+SEPA is a European banking service and stands for "Single Euro Payments Area".
+This is a very convenience payment solution for European users, as credit cards are not very common in Europe compared to e.g. USA.
+
Can I use shortcodes to display the Pay Button?
-----------------------------------------------
Yes, here's an example shortcode with all currently available parameters: '[paymill_pb title="test title" products_list="1,2"]'
@@ -52,4 +60,4 @@ Yes, here's an example shortcode with all currently available parameters: '[paym
Are there actions/filters/hooks in the Pay Button?
--------------------------------------------------
Yes, all of them have 1 parameter as array with several vars.
-You may use var_dump to get their content and structure.
+You may use var_dump to get their content and structure.
\ No newline at end of file
diff --git a/README.md b/README.md
index 10bf64a..f332df8 100644
--- a/README.md
+++ b/README.md
@@ -5,9 +5,9 @@ PAYMILL for WordPress
* Contributors: Matthias Reuter
* Donate link:
* Tags: paymill, creditcard, elv, payment, woocommerce, paybutton, ecommerce, debitcard, subscriptions
-* Requires at least: 3.5
-* Tested up to: 3.8
-* Stable tag: 1.5.2
+* Requires at least: 3.9
+* Tested up to: 3.9
+* Stable tag: 1.6
* License: [GPLv3 or later](http://www.gnu.org/licenses/gpl-3.0.html)
With PAYMILL you are able to provide credit card based payments for your customers.
@@ -18,13 +18,10 @@ Plugin Description
This plugin currently allows:
-* Payment Gateway for WooCommerce, including subscription support
+* Payment Gateway for WooCommerce - incl. subscription support
* Payment Gateway for ShopPlugin
-* Pay Button. including subscription support
-
-Features in Development:
-
-* Payment Gateway for Magic Members (70% done) - beta for subscriptions included
+* Payment Gateway for Magic Members - incl. subscription support
+* Pay Button - incl. subscription support
Service Description
===================
@@ -38,7 +35,7 @@ Top-notch customer support.
Subscriptions supported and Mobile SDKs for iOS and Android available.
Accept payments in up to 100 currencies.
All major card brands like MasterCard, VISA, American Express, Diner's Club, Maestro etc. supported.
-Available in 39 countries across Europe so far.
+Available in 40 countries across Europe so far.
Installation
============
@@ -49,8 +46,10 @@ There is a manual included in English and German as PDF, but in short:
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Register a free account on https://www.paymill.com/
4. Insert TEST Api Keys for testing purposes in plugin settings
-5. If you are happy how the plugin works, enable your live account on https://www.paymill.com/ - this could take a couple of days.
-6. After your paymill account has been activated for LIVE mode, switch your account to live and replace your TEST API Keys with your LIVE API Keys in plugin settings.
+5. Integrate the widget somewhere in your wordpress. Without one of the supported shops, the easiest method is the pay button, available in the admin interface at _Design » Widgets_, or [as a shortcode](FAQ.md) for individual pages.
+6. Play around in test mode.
+7. If you are happy how the plugin works, enable your live account on https://www.paymill.com/ - this could take a couple of days.
+8. After your paymill account has been activated for LIVE mode, switch your account to live and replace your TEST API Keys with your LIVE API Keys in plugin settings.
actions
-------
@@ -62,20 +61,13 @@ actions
filters
-------
* paymill_paybutton_order_desc
+* paymill_paybutton_client_desc
* paymill_paybutton_email_text
Customizing the Pay Button
--------------------------
-The Pay Button is made for customizing and you should make intensive use of CSS to cutomize it. Examples:
-
-```css
-/* hide country selection */
-.paymill_shipping { display: none; }
-
-/* hide company name */
-.paymill_address div:nth-child(2) { display: none; }
-```
+The Pay Button is made for customizing and you should make intensive use of CSS to cutomize it.
Additionally, you may want to replace the default order form with your own.
Create a custom theme file on `THEME_DIR/paymill/pay_button.php`,
diff --git a/copy_this/shopp/gateways/Paymill/paymill.php b/copy_this/shopp/wp-content/shopp-addons/paymill.php
similarity index 55%
rename from copy_this/shopp/gateways/Paymill/paymill.php
rename to copy_this/shopp/wp-content/shopp-addons/paymill.php
index 0d8e260..8c06fbf 100644
--- a/copy_this/shopp/gateways/Paymill/paymill.php
+++ b/copy_this/shopp/wp-content/shopp-addons/paymill.php
@@ -11,6 +11,8 @@
* @subpackage PaymillShopp
**/
-require_once(PAYMILL_DIR.'lib/integration/shopplugin.inc.php');
+if(defined('PAYMILL_DIR') && file_exists(PAYMILL_DIR.'lib/integration/shopplugin.inc.php')){
+ require_once(PAYMILL_DIR.'lib/integration/shopplugin.inc.php');
+}
?>
\ No newline at end of file
diff --git a/lib/api/.gitignore b/lib/api/.gitignore
new file mode 100644
index 0000000..01d0f7b
--- /dev/null
+++ b/lib/api/.gitignore
@@ -0,0 +1,4 @@
+/.idea/
+/build/
+/vendor
+phpunit.xml
\ No newline at end of file
diff --git a/lib/api/.travis.yml b/lib/api/.travis.yml
new file mode 100644
index 0000000..9d3f1c5
--- /dev/null
+++ b/lib/api/.travis.yml
@@ -0,0 +1,12 @@
+---
+php:
+- "5.5"
+- "5.4"
+- "5.3"
+script: ant test
+env:
+ global:
+ secure: "StaRWxgVW55YXMetUfL91rGDHJCBC0e3Nv9qYx5jg2aa9H0BIYhJ8vYtDXbKFEeGXWRnlLdPVclzRiIMdYQTZaBrjHxWVzE9N5stIyIq/Ik5hvkRs3h78ICSsDJB7SAun+aYv4vV/2kR44B0YiOhWZehV3IhAWO1Csd4HDjiQHY="
+language: php
+before_install: composer self-update
+install: composer install
diff --git a/lib/api/Apiclient/Curl.php b/lib/api/Apiclient/Curl.php
deleted file mode 100644
index b61f4b4..0000000
--- a/lib/api/Apiclient/Curl.php
+++ /dev/null
@@ -1,190 +0,0 @@
-_apiKey = $apiKey;
- $this->_apiUrl = $apiEndpoint;
- /**
- * Proxy support. The proxy can be SOCKS5 or HTTP.
- * Also the connection could be tunneled through.
- */
- if (!empty($extracURL)) {
- $this->_extraOptions = $extracURL;
- }
- }
-
- /**
- * 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 {
- $this->_responseArray = $this->_requestApi($action, $params, $method);
- $httpStatusCode = $this->_responseArray['header']['status'];
- if ($httpStatusCode != 200) {
- $errorMessage = 'Client returned HTTP status code ' . $httpStatusCode;
- if (isset($this->_responseArray['body']['error'])) {
- $errorMessage = $this->_responseArray['body']['error'];
- }
- $responseCode = '';
- if (isset($this->_responseArray['body']['response_code'])) {
- $responseCode = $this->_responseArray['body']['response_code'];
- }
- if ($responseCode === '' && isset($this->_responseArray['body']['data']['response_code'])) {
- $responseCode = $this->_responseArray['body']['data']['response_code'];
- }
-
- return array('data' => array(
- 'error' => $errorMessage,
- 'response_code' => $responseCode,
- 'http_status_code' => $httpStatusCode
- ));
- }
-
- return $this->_responseArray['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 => true,
- CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt',
- );
-
- // Add extra options to cURL if defined.
- if (!empty($this->_extraOptions)) {
- $curlOpts += $this->_extraOptions;
- }
-
- 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
- );
- }
-
- /**
- * Returns the response of the request as an array.
- * @return mixed Response
- * @todo Create Unit Test
- */
- public function getResponse()
- {
- return $this->_responseArray;
- }
-
-}
\ No newline at end of file
diff --git a/lib/api/Apiclient/Interface.php b/lib/api/Apiclient/Interface.php
deleted file mode 100644
index 224b825..0000000
--- a/lib/api/Apiclient/Interface.php
+++ /dev/null
@@ -1,20 +0,0 @@
-_httpClient = new Services_Paymill_Apiclient_Curl($apiKey, $apiEndpoint, $extraData);
- }
-
- /**
- * 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'];
- }
-
- /**
- * Returns the response of the last request as an array
- * @return mixed Response
- * @todo Add Unit test
- */
- public function getResponse(){
- return $this->_httpClient->getResponse();
- }
-}
\ No newline at end of file
diff --git a/lib/api/Clients.php b/lib/api/Clients.php
deleted file mode 100644
index e8e861a..0000000
--- a/lib/api/Clients.php
+++ /dev/null
@@ -1,14 +0,0 @@
-$name = $value;
- }
-
- /**
- * Magic getter to avoid the access of undefined vars
- * @param type $name
- * @return null
- */
- public function __get($name)
- {
- if (isset($this->$name)) {
- return $this->$name;
- }
-
- return null;
- }
-
- /**
- * Fill the model with the given json data
- * @param string $json
- */
- public function fill($json)
- {
- $data = json_decode($json, true);
-
- foreach ($data as $name => $value) {
- $this->$name = $value;
- }
- }
-
- /**
- * To array
- *
- * @return array
- */
- public function toArray()
- {
- $data = array();
- foreach ($this as $key => $value) {
- $data[$key] = $value;
- }
-
- return $data;
- }
-
- /**
- * To json
- *
- * @return string
- */
- public function toJson()
- {
- return json_encode($this->toArray());
- }
-}
\ No newline at end of file
diff --git a/lib/api/LoggingInterface.php b/lib/api/LoggingInterface.php
deleted file mode 100644
index 696f71e..0000000
--- a/lib/api/LoggingInterface.php
+++ /dev/null
@@ -1,14 +0,0 @@
-$privateKey Paymill-PrivateKey
- * @param String $apiUrl Paymill-Api Url
- * @param String $libBase Path to the lib Base (Can be null, Default Path will be used)
- * @param array $params(
- * token, generated Token
- * amount, Basketamount
- * currency, Transaction currency
- * name, Customer name
- * email, Customer emailaddress
- * description, Description for transactions
- * )
(If not set here, the use of setters is required for the class to work)
- * @param object $loggingClassInstance Instance of Object implementing the Services_Paymill_PaymentProcessorInterface. If not set, there will be no logging.
- */
- public function __construct($privateKey = null, $apiUrl = null, $libBase = null, $params = null, Services_Paymill_LoggingInterface $loggingClassInstance = null)
- {
- $this->setPrivateKey($privateKey);
- $this->setApiUrl($apiUrl);
- $this->setLibBase($libBase);
- $this->_preAuthAmount = $params['preauthamount'];
- $this->_token = $params['token'];
- $this->_amount = $params['amount'];
- $this->_currency = $params['currency'];
- $this->_name = $params['name'];
- $this->_email = $params['email'];
- $this->_description = $params['description'];
- $this->setLogger($loggingClassInstance);
- }
-
- /**
- * Creates a Paymill-Client with the given Data
- *
- * @param array $params
- * @return boolean
- */
- private function _createClient()
- {
- if (isset($this->_clientId)) {
- $this->_log("Client using: " . $this->_clientId);
- } else {
- $client = $this->_clientsObject->create(
- array(
- 'email' => $this->_email,
- 'description' => $this->_description
- )
- );
-
- $this->_validateResult($client, 'Client');
-
- $this->_clientId = $client['id'];
- }
- return $this->_clientId;
- }
-
- /**
- * Creates a Paymill-Payment with the given Data
- *
- * @param array $params
- * @return boolean
- */
- private function _createPayment()
- {
- if (isset($this->_paymentId)) {
- $this->_log("Payment using: " . $this->_paymentId);
- } else {
- $payment = $this->_paymentsObject->create(
- array(
- 'token' => $this->_token,
- 'client' => $this->_clientId
- )
- );
- $this->_validateResult($payment, 'Payment');
-
- $this->_paymentId = $payment['id'];
- }
- return true;
- }
-
- /**
- * Creates a Paymill-Transaction with the given Data
- *
- * @param array $params
- * @return boolean
- */
- private function _createTransaction()
- {
- $parameter = array(
- 'amount' => $this->_amount,
- 'currency' => $this->_currency,
- 'description' => $this->_description,
- 'source' => $this->_source
- );
- $this->_preauthId != null ? $parameter['preauthorization'] = $this->_preauthId : $parameter['payment'] = $this->_paymentId ;
- $transaction = $this->_transactionsObject->create($parameter);
- $this->_validateResult($transaction, 'Transaction');
-
- $this->_transactionId = $transaction['id'];
- return true;
- }
-
- /**
- * Creates a Paymill-Transaction with the given Data
- *
- * @param array $params
- * @return boolean
- */
- private function _createPreauthorization()
- {
- $preAuth = $this->_preauthObject->create(
- array(
- 'amount' => $this->_preAuthAmount,
- 'currency' => $this->_currency,
- 'description' => $this->_description,
- 'payment' => $this->_paymentId,
- 'client' => $this->_clientId,
- )
- );
- $this->_validateResult($preAuth, 'Preauthorization');
- $this->_preauthId = $preAuth['preauthorization']['id'];
- return true;
- }
-
- /**
- * Load the PhpWrapper-Classes and creates an instance for each class.
- */
- private function _initiatePhpWrapperClasses()
- {
- require_once $this->_libBase . 'Transactions.php';
- require_once $this->_libBase . 'Preauthorizations.php';
- require_once $this->_libBase . 'Clients.php';
- require_once $this->_libBase . 'Payments.php';
-
- $this->_transactionsObject = new Services_Paymill_Transactions($this->_privateKey, $this->_apiUrl);
- $this->_preauthObject = new Services_Paymill_Preauthorizations($this->_privateKey, $this->_apiUrl);
- $this->_clientsObject = new Services_Paymill_Clients($this->_privateKey, $this->_apiUrl);
- $this->_paymentsObject = new Services_Paymill_Payments($this->_privateKey, $this->_apiUrl);
- }
-
- /**
- * Calls the log() function of the logger object if the object has been set.
- *
- * @param string $message
- * @param string $debugInfo
- */
- private function _log($message, $debugInfo = null)
- {
- if (isset($this->_logger)) {
- $this->_logger->log($message, $debugInfo);
- }
- }
-
- /**
- * Validates the array passed as an argument to be processPayment() compliant
- * @param mixed $parameter
- * @return boolean
- */
- private function _validateParameter()
- {
- if ($this->_preAuthAmount == null) {
- $this->_preAuthAmount = $this->_amount;
- }
-
- $validation = true;
- $parameter = array(
- "token" => $this->_token,
- "amount" => $this->_amount,
- "currency" => $this->_currency,
- "name" => $this->_name,
- "email" => $this->_email,
- "description" => $this->_description);
-
- $arrayMask = array(
- "token" => 'string',
- "amount" => 'integer',
- "currency" => 'string',
- "name" => 'string',
- "email" => 'string',
- "description" => 'string');
-
- foreach ($arrayMask as $mask => $type) {
- if (is_null($parameter[$mask])) {
- $validation = false;
- $this->_logger->paramName = $mask;
- $this->_log("The Parameter $mask is missing.", var_export($parameter, true));
- } else {
- switch ($type) {
- case 'string':
- if (!is_string($parameter[$mask])) {
- $this->_logger->paramName = $mask;
- $this->_log("The Parameter $mask is not a string.", var_export($parameter, true));
- $validation = false;
- }
- break;
- case 'integer':
- if (!is_integer($parameter[$mask])) {
- $this->_logger->paramName = $mask;
- $this->_log("The Parameter $mask is not an integer.", var_export($parameter, true));
- $validation = false;
- }
- break;
- }
- }
-
- if (!$validation) {
- break;
- }
- }
- return $validation;
- }
-
- /**
- * Validates the created Paymill-Objects
- *
- * @param array $transaction
- * @param string $type
- * @return boolean
- */
- private function _validateResult($transaction, $type)
- {
- $this->_lastResponse = $transaction;
- if (isset($transaction['data']['response_code']) && $transaction['data']['response_code'] !== 20000) {
- $this->_logger->paramName = 'response_error';
- $this->_log("An Error occured: " . $transaction['data']['response_code'], var_export($transaction, true));
- throw new Exception("Invalid Result Exception: Invalid ResponseCode");
- }
-
- if (!isset($transaction['id']) && !isset($transaction['data']['id'])) {
- $this->_logger->paramName = $type . '_error';
- $this->_log("No $type created.", var_export($transaction, true));
- throw new Exception("Invalid Result Exception: Invalid Id");
- } else {
- $this->_logger->paramName = $type . '_success';
- $this->_log("$type created.", isset($transaction['id']) ? $transaction['id'] : $transaction['data']['id']);
- }
-
- // check result
- if ($type == 'Transaction') {
- if (is_array($transaction) && array_key_exists('status', $transaction)) {
- if ($transaction['status'] == "closed") {
- // transaction was successfully issued
- return true;
- } elseif ($transaction['status'] == "open") {
- // transaction was issued but status is open for any reason
- $this->_logger->paramName = 'transaction_success';
- $this->_log("Status is open.", var_export($transaction, true));
- throw new Exception("Invalid Result Exception: Invalid Orderstate");
- } else {
- // another error occured
- $this->_logger->paramName = 'unknown_error';
- $this->_log("Unknown error." . var_export($transaction, true));
- throw new Exception("Invalid Result Exception: Unknown Error");
- }
- } else {
- // another error occured
- $this->_logger->paramName = $type . '_error';
- $this->_log("$type could not be issued.", var_export($transaction, true));
- throw new Exception("Invalid Result Exception: $type could not be issued.");
- }
- } else {
- return true;
- }
- }
-
- private function _processPreAuthCapture($captureNow)
- {
- $this->_createPreauthorization();
- if ($captureNow) {
- $this->_createTransaction();
- }
- return true;
- }
-
- /**
- * Executes the Payment Process
- *
- * @return boolean
- */
- final public function processPayment($captureNow = true)
- {
- $this->_initiatePhpWrapperClasses();
- if (!$this->_validateParameter()) {
- return false;
- }
-
- $this->_logger->paramName = 'process_payment_data';
- $this->_log('Process payment with following data', print_r($this->toArray(), true));
-
- try {
-
- $this->_createClient();
- $this->_logger->paramName = 'client_api_response';
- $this->_log('Client API Response', print_r($this->_clientsObject->getResponse(), true));
- $this->_createPayment();
- $this->_logger->paramName = 'payment_api_response';
- $this->_log('Payment API Response', print_r($this->_paymentsObject->getResponse(), true));
-
- //creates a transaction if there is no difference between the amount
- if ($this->_preAuthAmount === $this->_amount && $captureNow) {
- $this->_createTransaction();
- $this->_logger->paramName = 'transaction_api_response';
- $this->_log('Transaction API Response', print_r($this->getLastResponse(), true));
- } else {
- $this->_processPreAuthCapture($captureNow);
- $this->_logger->paramName = 'pre_auth_api_response';
- $this->_log('Pre-Auth API Response', print_r($this->getLastResponse(), true));
- }
-
- return true;
- } catch (Exception $ex) {
- // paymill wrapper threw an exception
- $this->_logger->paramName = 'exception_response';
- $this->_log("Exception thrown from paymill wrapper.", $ex->getMessage());
- return false;
- }
- }
-
- final public function capture()
- {
- $this->_initiatePhpWrapperClasses();
- if (!isset($this->_amount) || !isset($this->_currency) || !isset($this->_preauthId)) {
- return false;
- }
- return $this->_createTransaction();
- }
-
- /**
- * Returns the objects data
- *
- * @return array
- */
- public function toArray()
- {
- return array(
- 'apiurl' => $this->_apiUrl,
- 'libbase' => $this->_libBase,
- 'privatekey' => $this->_privateKey,
- 'token' => $this->_token,
- 'amount' => $this->_amount,
- 'preauthamount' => $this->_preAuthAmount,
- 'currency' => $this->_currency,
- 'description' => $this->_description,
- 'email' => $this->_email,
- 'name' => $this->_name,
- 'source' => $this->_source
- );
- }
-
- /* * **************************************************************************************************************
- * *********************************************** Getter **************************************************
- * *************************************************************************************************************** */
-
- /**
- *
Can only be called after the call of processPayment(). Otherwise null will be returned
- * Returns the ClientId
- * @return String ClientId
- */
- public function getClientId()
- {
- return $this->_clientId;
- }
-
- /**
- *
Can only be called after the call of processPayment(). Otherwise null will be returned
- * Returns the PaymentId
- * @return String PaymentId
- */
- public function getPaymentId()
- {
- return $this->_paymentId;
- }
-
- /**
- *
Can only be called after the call of processPayment(). Otherwise null will be returned
- * Returns the TransactionId
- * @return String TransactionId
- */
- public function getTransactionId()
- {
- return $this->_transactionId;
- }
-
- /**
- *
Can only be called after the call of processPayment(). Otherwise null will be returned
- * Returns the preauthId
- * @return String preauthId
- */
- public function getPreauthId()
- {
- return $this->_preauthId;
- }
-
- /**
- *
Can only be called after the call of processPayment(). Otherwise null will be returned
- * Returns the last response send by Paymill
- * @return array LastResponse
- */
- public function getLastResponse()
- {
- return $this->_lastResponse;
- }
-
- /* * **************************************************************************************************************
- * *********************************************** Setter **************************************************
- * *************************************************************************************************************** */
-
- /**
- * Sets the clientId
- * @param String $clientId
- */
- public function setClientId($clientId = null)
- {
- $this->_clientId = $clientId;
- }
-
- /**
- * Sets the paymentId
- * @param String $paymentId
- */
- public function setPaymentId($paymentId = null)
- {
- $this->_paymentId = $paymentId;
- }
-
- /**
- * This method sets the token
- * @param String $token
- */
- public function setToken($token = null)
- {
- $this->_token = $token;
- }
-
- /**
- * This method sets the preAuthAmount
- * @param String $preAuthAmount
- */
- public function setPreAuthAmount($preAuthAmount = null)
- {
- $this->_preAuthAmount = $preAuthAmount;
- }
-
- /**
- * This method sets the amount
- * @param String $amount
- */
- public function setAmount($amount = null)
- {
- $this->_amount = $amount;
- }
-
- /**
- * Sets the currency
- * @param String $currency
- */
- public function setCurrency($currency = null)
- {
- $this->_currency = $currency;
- }
-
- /**
- * Sets the Customer name
- * @param String $name
- */
- public function setName($name = null)
- {
- $this->_name = $name;
- }
-
- /**
- * Sets the Customer Email Adress
- * @param String $email
- */
- public function setEmail($email = null)
- {
- $this->_email = $email;
- }
-
- /**
- * Sets the Description
- * @param String $description
- */
- public function setDescription($description = null)
- {
- $this->_description = $description;
- }
-
- /**
- * Sets the Api URL
- * @param String $apiUrl
- */
- public function setApiUrl($apiUrl = null)
- {
- $this->_apiUrl = $apiUrl;
- }
-
- /**
- * Sets the Path to the libBase
- * @param String $libBase Path to the Lib base. If not set, the default path is set.
- */
- public function setLibBase($libBase = null)
- {
- $this->_libBase = $libBase == null ? dirname(__FILE__) . DIRECTORY_SEPARATOR : $libBase;
- }
-
- /**
- * Sets up the Logger Object.
- * The Logger object can be any class implementing the Services_Paymill_PaymentProcessorInterface.
- * @param any $logger
- */
- public function setLogger(Services_Paymill_LoggingInterface $logger = null)
- {
- $this->_logger = $logger;
- }
-
- /**
- * Sets the Paymill-PrivateKey
- * @param string $privateKey
- */
- public function setPrivateKey($privateKey = null)
- {
- $this->_privateKey = $privateKey;
- }
-
- /**
- * Set the request source
- * (Modulversion_Shopname_Shopversion)
- * @param string $source
- */
- public function setSource($source)
- {
- $this->_source = $source;
- }
-
- /**
- * Set PreauthorizationID to be captured
- *
- * @param string $preauthId
- */
- public function setPreauthId($preauthId)
- {
- $this->_preauthId = $preauthId;
- }
-
-}
\ No newline at end of file
diff --git a/lib/api/Payments.php b/lib/api/Payments.php
deleted file mode 100644
index 81b9a41..0000000
--- a/lib/api/Payments.php
+++ /dev/null
@@ -1,27 +0,0 @@
-setToken("098f6bcd4621d373cade4e832627b4f6");
+ ```
+3. Use your desired function:
+
+ ```php
+ $response = $request->create($payment);
+ $paymentId = $response->getId();
+ ```
+
+ It recommend to wrap it into a "try/catch" to handle exceptions like this:
+ ```php
+ try{
+ $response = $request->create($payment);
+ $paymentId = $response->getId();
+ }catch(PaymillException $e){
+ //Do something with the error informations below
+ $e->getResponseCode();
+ $e->getStatusCode();
+ $e->getErrorMessage();
+ }
+ ```
+
+Receiving Response
+--------------
+
+This section shows diffrent ways how to receive a response.
+The followings examples show how to get the Id for a transaction.
+
+1. The default response is one of the response-models.
+```php
+ $response = $request->create($payment);
+ $response->getId();
+```
+
+2. getLastResponse() returns the unconverted response from the API.
+```php
+ $request->create($payment);
+ $response = $request->getLastResponse();
+ $response['body']['data']['id'];
+```
+
+3. getJSONObject returns the response as stdClass-Object.
+```php
+ $request->create($payment);
+ $response = $request->getJSONObject();
+ $response->data->id;
+```
+
+Documentation
+--------------
+
+For further information, please refer to our official PHP library reference: https://www.paymill.com/en-gb/documentation-3/reference/api-reference/index.html
diff --git a/lib/api/Refunds.php b/lib/api/Refunds.php
deleted file mode 100644
index 34c640c..0000000
--- a/lib/api/Refunds.php
+++ /dev/null
@@ -1,56 +0,0 @@
-_httpClient->request(
- $this->_serviceResource . "$transactionId",
- $params,
- Services_Paymill_Apiclient_Interface::HTTP_POST
- );
- return $result['data'];
- }
-
- /**
- * 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
deleted file mode 100644
index 5fb20c0..0000000
--- a/lib/api/Subscriptions.php
+++ /dev/null
@@ -1,14 +0,0 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/lib/api/composer.json b/lib/api/composer.json
new file mode 100644
index 0000000..705a6cd
--- /dev/null
+++ b/lib/api/composer.json
@@ -0,0 +1,19 @@
+{
+ "name": "paymill/paymill",
+ "type": "library",
+ "description": "Paymill PHPLib",
+ "keywords": ["payment", "provider"],
+ "license": "MIT",
+ "homepage": "https://www.paymill.de",
+ "authors": [
+ {
+ "name": "Paymill GmbH",
+ "homepage": "https://www.paymill.de"
+ }
+ ],
+ "autoload": {
+ "psr-0": {
+ "Paymill": "lib/"
+ }
+ }
+}
diff --git a/lib/api/lib/Paymill/API/CommunicationAbstract.php b/lib/api/lib/Paymill/API/CommunicationAbstract.php
new file mode 100644
index 0000000..4dc7dcf
--- /dev/null
+++ b/lib/api/lib/Paymill/API/CommunicationAbstract.php
@@ -0,0 +1,20 @@
+_apiKey = $apiKey;
+ $this->_apiUrl = $apiEndpoint;
+ /**
+ * Proxy support. The proxy can be SOCKS5 or HTTP.
+ * Also the connection could be tunneled through.
+ */
+ $this->_extraOptions = $extracURL;
+ }
+
+ /**
+ * Perform HTTP request to REST endpoint
+ *
+ * @param string $action
+ * @param array $params
+ * @param string $method
+ * @return array
+ */
+ public function requestApi($action = '', $params = array(), $method = 'POST')
+ {
+ $curlOpts = array(
+ CURLOPT_URL => $this->_apiUrl . $action,
+ CURLOPT_RETURNTRANSFER => true,
+ CURLOPT_CUSTOMREQUEST => $method,
+ CURLOPT_USERAGENT => 'Paymill-php/0.0.2',
+ CURLOPT_SSL_VERIFYPEER => true,
+ CURLOPT_CAINFO => realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'paymill.crt',
+ );
+
+ // Add extra options to cURL if defined.
+ if (!empty($this->_extraOptions)) {
+ $curlOpts = $this->_extraOptions + $curlOpts;
+ }
+
+ if ('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 = $this->_curlExec($curl);
+ $responseInfo = $this->_curlInfo($curl);
+
+ if ($responseBody === false) {
+ $responseBody = array('error' => $this->_curlError($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
+ );
+ }
+
+ /**
+ * Wrapps the curlExec function call
+ * @param cURL handle success $curl
+ * @return mixed
+ */
+ protected function _curlExec($curl)
+ {
+ return curl_exec($curl);
+ }
+
+ /**
+ * Wrapps the curlInfo function call
+ * @param cURL handle success $curl
+ * @return mixed
+ */
+ protected function _curlInfo($curl)
+ {
+ return curl_getinfo($curl);
+ }
+
+ /**
+ * Wrapps the curlError function call
+ * @param cURL handle success $curl
+ * @return mixed
+ */
+ protected function _curlError($curl)
+ {
+ return curl_error($curl);
+ }
+}
diff --git a/lib/api/Apiclient/paymill.crt b/lib/api/lib/Paymill/API/paymill.crt
similarity index 100%
rename from lib/api/Apiclient/paymill.crt
rename to lib/api/lib/Paymill/API/paymill.crt
diff --git a/lib/api/lib/Paymill/Models/Request/Base.php b/lib/api/lib/Paymill/Models/Request/Base.php
new file mode 100644
index 0000000..5e3b16a
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Base.php
@@ -0,0 +1,73 @@
+_serviceResource;
+ }
+
+ /**
+ * Returns this objects unique identifier
+ * @return string identifier
+ */
+ public function getId()
+ {
+ return $this->_id;
+ }
+
+ /**
+ * Sets the unique identifier of this object
+ * @param string $id
+ * @return \Paymill\Models\Request\Base
+ */
+ public function setId($id)
+ {
+ $this->_id = $id;
+ return $this;
+ }
+ /**
+ * Returns the filterArray for getAll
+ * @return array
+ */
+ public function getFilter()
+ {
+ return $this->_filter;
+ }
+
+ /**
+ * Sets the filterArray for getAll
+ * @param array $filter
+ * @return \Paymill\Models\Request\Base
+ */
+ public function setFilter($filter)
+ {
+ $this->_filter = $filter;
+ return $this;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Client.php b/lib/api/lib/Paymill/Models/Request/Client.php
new file mode 100644
index 0000000..b533790
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Client.php
@@ -0,0 +1,100 @@
+_serviceResource = 'clients/';
+ }
+
+ /**
+ * Returns the Mail address of this client.
+ * @return string
+ */
+ public function getEmail()
+ {
+ return $this->_email;
+ }
+
+ /**
+ * Sets the Mail address of this client.
+ * @param string $email
+ * @return \Paymill\Models\Request\Client
+ */
+ public function setEmail($email)
+ {
+ $this->_email = $email;
+ return $this;
+ }
+
+ /**
+ * Returns the additional description for this client, perhaps the identifier from your CRM system?
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets an additional description for this client. We recommend some sort of identifier from your CRM system
+ * @param string $description
+ * @return \Paymill\Models\Request\Client
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ case 'update':
+ $parameterArray['email'] = $this->getEmail();
+ $parameterArray['description'] = $this->getDescription();
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ case 'delete':
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Offer.php b/lib/api/lib/Paymill/Models/Request/Offer.php
new file mode 100644
index 0000000..d4d647e
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Offer.php
@@ -0,0 +1,178 @@
+_serviceResource = 'Offers/';
+ }
+
+ /**
+ * Returns Your name for this offer
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Sets Your name for this offer
+ * @param string $name
+ * @return \Paymill\Models\Request\Offer
+ */
+ public function setName($name)
+ {
+ $this->_name = $name;
+ return $this;
+ }
+
+ /**
+ * Returns the amount as an integer
+ * @return integer
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the amount.
+ * Every interval the specified amount will be charged. Only integer values are allowed (e.g. 42.00 = 4200)
+ * @param integer $amount
+ * @return \Paymill\Models\Request\Offer
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = (int) $amount;
+ return $this;
+ }
+
+ /**
+ * Returns the interval defining how often the client should be charged.
+ * @return string
+ */
+ public function getInterval()
+ {
+ return $this->_interval;
+ }
+
+ /**
+ * Sets the interval defining how often the client should be charged.
+ * @example Format: number DAY | WEEK | MONTH | YEAR Example: 2 DAY
+ * @param string $interval
+ * @return \Paymill\Models\Request\Offer
+ */
+ public function setInterval($interval)
+ {
+ $this->_interval = $interval;
+ return $this;
+ }
+
+ /**
+ * Returns the number of days to try
+ * @return integer
+ */
+ public function getTrialPeriodDays()
+ {
+ return $this->_trialPeriodDays;
+ }
+
+ /**
+ * Sets the number of days to try
+ * @param integer $trialPeriodDays
+ * @return \Paymill\Models\Request\Offer
+ */
+ public function setTrialPeriodDays($trialPeriodDays)
+ {
+ $this->_trialPeriodDays = $trialPeriodDays;
+ return $this;
+ }
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return \Paymill\Models\Request\Offer
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ $parameterArray['amount'] = $this->getAmount();
+ $parameterArray['currency'] = $this->getCurrency();
+ $parameterArray['interval'] = $this->getInterval();
+ $parameterArray['name'] = $this->getName();
+ $parameterArray['trial_period_days'] = $this->getTrialPeriodDays();
+ break;
+ case 'update':
+ $parameterArray['name'] = $this->getName();
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ case 'delete':
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Payment.php b/lib/api/lib/Paymill/Models/Request/Payment.php
new file mode 100644
index 0000000..e419c73
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Payment.php
@@ -0,0 +1,98 @@
+_serviceResource = 'Payments/';
+ }
+
+ /**
+ * Returns the identifier of a client (client-object)
+ * @return string The identifier of a client (client-object)
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the identifier of a client (client-object)
+ * @param string $client
+ * @return Payment
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * Returns the Token
+ * @return String
+ */
+ public function getToken()
+ {
+ return $this->_token;
+ }
+
+ /**
+ * Sets the token required for payment creation
+ * @param string $token
+ * @return Payment
+ */
+ public function setToken($token)
+ {
+ $this->_token = $token;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ $parameterArray['token'] = $this->getToken();
+ $parameterArray['client'] = $this->getClient();
+ break;
+ case 'delete':
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Preauthorization.php b/lib/api/lib/Paymill/Models/Request/Preauthorization.php
new file mode 100644
index 0000000..1623204
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Preauthorization.php
@@ -0,0 +1,154 @@
+_serviceResource = 'Preauthorizations/';
+ }
+
+ /**
+ * Returns the amount
+ * @return string
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the amount
+ * @param string $amount
+ * @return \Paymill\Models\Request\Preauthorization
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return \Paymill\Models\Request\Preauthorization
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of a payment
+ * @return string
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the identifier of a payment
+ * @param string $payment
+ * @return \Paymill\Models\Request\Preauthorization
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Returns the token required for the creation of preAuths
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->_token;
+ }
+
+ /**
+ * Sets the token required for the creation of preAuths
+ * @param string $token
+ * @return \Paymill\Models\Request\Preauthorization
+ */
+ public function setToken($token)
+ {
+ $this->_token = $token;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ if (!is_null($this->getPayment())) {
+ $parameterArray['payment'] = $this->getPayment();
+ } else {
+ $parameterArray['token'] = $this->getToken();
+ }
+ $parameterArray['amount'] = $this->getAmount();
+ $parameterArray['currency'] = $this->getCurrency();
+
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ case 'delete':
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Refund.php b/lib/api/lib/Paymill/Models/Request/Refund.php
new file mode 100644
index 0000000..df6957e
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Refund.php
@@ -0,0 +1,94 @@
+_serviceResource = 'Refunds/';
+ }
+
+ /**
+ * Returns the amount
+ * @return string
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the amount
+ * @param string $amount
+ * @return \Paymill\Models\Request\Refund
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+ /**
+ * Returns the description
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets the description
+ * @param string $description
+ * @return \Paymill\Models\Request\Refund
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ $parameterArray['amount'] = $this->getAmount();
+ $parameterArray['description'] = $this->getDescription();
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Subscription.php b/lib/api/lib/Paymill/Models/Request/Subscription.php
new file mode 100644
index 0000000..6a0fb58
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Subscription.php
@@ -0,0 +1,181 @@
+_serviceResource = 'Subscriptions/';
+ }
+
+ /**
+ * Returns the identifier of the offer the subscription is based on
+ * @return string
+ */
+ public function getOffer()
+ {
+ return $this->_offer;
+ }
+
+ /**
+ * Sets the identifier of the offer the subscription is based on
+ * @param string $offer
+ * @return \Paymill\Models\Request\Subscription
+ */
+ public function setOffer($offer)
+ {
+ $this->_offer = $offer;
+ return $this;
+ }
+
+ /**
+ * Returns the flag determining whether to cancel this subscription immediately or at the end of the current period
+ * @return boolean
+ */
+ public function getCancelAtPeriodEnd()
+ {
+ return $this->_cancelAtPeriodEnd;
+ }
+
+ /**
+ * Sets a flag determining whether to cancel this subscription immediately or at the end of the current period
+ * @param boolean $cancelAtPeriodEnd
+ * @return \Paymill\Models\Request\Subscription
+ */
+ public function setCancelAtPeriodEnd($cancelAtPeriodEnd)
+ {
+ $this->_cancelAtPeriodEnd = $cancelAtPeriodEnd;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the payment object registered with this subscription
+ * @return string
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the identifier of the payment object registered with this subscription
+ * @param string $payment
+ * @return \Paymill\Models\Request\Subscription
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Returns the id of the client associated with this subscription
+ * @return string
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the id of the client associated with this subscription
+ * @param string $client
+ * @return \Paymill\Models\Request\Subscription
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the trial period start
+ * @return integer
+ */
+ public function getStartAt()
+ {
+ return $this->_startAt;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the trial period start
+ * @param integer $startAt
+ * @return \Paymill\Models\Request\Subscription
+ */
+ public function setStartAt($startAt)
+ {
+ $this->_startAt = $startAt;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ $parameterArray['client'] = $this->getClient();
+ $parameterArray['offer'] = $this->getOffer();
+ $parameterArray['payment'] = $this->getPayment();
+ $parameterArray['start_at'] = $this->getStartAt();
+ break;
+ case 'update':
+ $parameterArray['cancel_at_period_end'] = $this->getCancelAtPeriodEnd();
+ $parameterArray['offer'] = $this->getOffer();
+ $parameterArray['payment'] = $this->getPayment();
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ case 'delete':
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Transaction.php b/lib/api/lib/Paymill/Models/Request/Transaction.php
new file mode 100644
index 0000000..3afde5e
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Transaction.php
@@ -0,0 +1,327 @@
+_serviceResource = 'Transactions/';
+ }
+
+ /**
+ * Returns the 'real' amount
+ * @return string
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the 'real' amount for the transaction.
+ * The number musst be in the smallest currency unit and will be saved as a string
+ * @param string $amount
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+ /**
+ * Returns the transaction description
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets the transaction description
+ * @param string $description
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the payment associated with the transaction
+ * @return string
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the identifier of the Payment for the transcation
+ * @param string $payment
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the Client associated with the transaction. If no client is available null will be returned
+ * @return string|null
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the identifier of the Client for the transaction
+ * @param string $client
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the Preauthorization associated with the transaction. If no preAuth is available null will be returned
+ * @return string|null
+ */
+ public function getPreauthorization()
+ {
+ return $this->_preauthorization;
+ }
+
+ /**
+ * Sets the identifier of the Preauthorization for the transaction
+ * @param string $preauthorization
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setPreauthorization($preauthorization)
+ {
+ $this->_preauthorization = $preauthorization;
+ return $this;
+ }
+
+ /**
+ * Returns the FeeAmount
+ * Fee included in the transaction amount (set by a connected app). Mandatory if feePayment is set
+ * @return integer
+ */
+ public function getFeeAmount()
+ {
+ return $this->_feeAmount;
+ }
+
+ /**
+ * Sets the Fee included in the transaction amount (set by a connected app).
+ * @param integer $feeAmount
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setFeeAmount($feeAmount)
+ {
+ $this->_feeAmount = $feeAmount;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the payment from which the fee will be charged (creditcard-object or directdebit-object).
+ * @return string
+ */
+ public function getFeePayment()
+ {
+ return $this->_feePayment;
+ }
+
+ /**
+ * Sets the identifier of the payment from which the fee will be charged (creditcard-object or directdebit-object).
+ * @param string $feePayment
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setFeePayment($feePayment)
+ {
+ $this->_feePayment = $feePayment;
+ return $this;
+ }
+
+ /**
+ * Set the currency which should be used for collecting the given fee
+ * @param string $feeCurrency (e.g. EUR, USD ...)
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setFeeCurrency($feeCurrency)
+ {
+ $this->_feeCurrency = $feeCurrency;
+ return $this;
+
+ }
+
+ /**
+ * returns the set fee currency which is used for the fee collection
+ * @return string
+ */
+ public function getFeeCurrency()
+ {
+ return $this->_feeCurrency;
+ }
+
+
+
+ /**
+ * Returns the token generated through our JavaScript-Bridge.
+ * When this parameter is used, none of the following should be used: payment, preauthorization.
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->_token;
+ }
+
+ /**
+ * Sets the token generated through our JavaScript-Bridge.
+ * When this parameter is used, none of the following should be used: payment, preauthorization.
+ * @param string $token
+ * @return \Paymill\Models\Request\Transaction
+ */
+ public function setToken($token)
+ {
+ $this->_token = $token;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ if (!is_null($this->getPreauthorization())) {
+ $parameterArray['preauthorization'] = $this->getPreauthorization();
+ } elseif (!is_null($this->getPayment())) {
+ $parameterArray['payment'] = $this->getPayment();
+ } else {
+ $parameterArray['token'] = $this->getToken();
+ }
+ $parameterArray['amount'] = $this->getAmount();
+ $parameterArray['currency'] = $this->getCurrency();
+ $parameterArray['description'] = $this->getDescription();
+ $parameterArray['client'] = $this->getClient();
+ if (!is_null($this->getFeeAmount())) {
+ $parameterArray['fee_amount'] = $this->getFeeAmount();
+ }
+ if (!is_null($this->getFeePayment())) {
+ $parameterArray['fee_payment'] = $this->getFeePayment();
+ }
+ if (!is_null($this->getFeeCurrency())) {
+ $parameterArray['fee_currency'] = $this->getFeeCurrency();
+ }
+ break;
+ case 'update':
+ $parameterArray['description'] = $this->getDescription();
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'delete':
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Request/Webhook.php b/lib/api/lib/Paymill/Models/Request/Webhook.php
new file mode 100644
index 0000000..1943371
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Request/Webhook.php
@@ -0,0 +1,141 @@
+_serviceResource = 'Webhooks/';
+ }
+
+ /**
+ * Returns the webhook url
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->_url;
+ }
+
+ /**
+ * Sets the webhook url
+ * @param string $url
+ * @return \Paymill\Models\Request\Webhook
+ */
+ public function setUrl($url)
+ {
+ $this->_url = $url;
+ return $this;
+ }
+
+ /**
+ * Returns the event types as an array
+ * @return array
+ */
+ public function getEventTypes()
+ {
+ return $this->_eventTypes;
+ }
+
+ /**
+ * Sets the event types for the webhook.
+ * There are a number of events you can react to. Each webhook can be configured to catch any kind of event
+ * individually, so you can create different webhooks for different events. Each Webhook needs to be attached
+ * to at least one event. For example the event subscription.succeeded is triggered every time a successful
+ * transaction has been made in our system that is based on a subscription. Shortly after that has been triggered,
+ * we will call every webhook you defined for this event and send detailed information to it.
+ * @tutorial https://paymill.com/de-de/dokumentation/referenz/api-referenz/#document-webhooks
+ * @param array $eventTypes
+ * @return \Paymill\Models\Request\Webhook
+ */
+ public function setEventTypes($eventTypes)
+ {
+ $this->_eventTypes = $eventTypes;
+ return $this;
+ }
+
+ /**
+ * Returns the email registered for this webhook
+ * @return string||null
+ */
+ public function getEmail()
+ {
+ return $this->_email;
+ }
+
+ /**
+ * Sets the email for the webhook.
+ * @param string $email Instead of setting the url parameter you can set the email parameter to create a webhook,
+ * where we send mails to in case of an event.
+ * @return \Paymill\Models\Request\Webhook
+ */
+ public function setEmail($email)
+ {
+ $this->_email = $email;
+ return $this;
+ }
+
+ /**
+ * Returns an array of parameters customized for the argumented methodname
+ * @param string $method
+ * @return array
+ */
+ public function parameterize($method)
+ {
+ $parameterArray = array();
+ switch ($method) {
+ case 'create':
+ if(!is_null($this->getUrl())){
+ $parameterArray['url'] = $this->getUrl();
+ }else{
+ $parameterArray['email'] = $this->getEmail();
+ }
+ $parameterArray['event_types'] = $this->getEventTypes();
+ break;
+ case 'update':
+ if(!is_null($this->getUrl())){
+ $parameterArray['url'] = $this->getUrl();
+ }else{
+ $parameterArray['email'] = $this->getEmail();
+ }
+ $parameterArray['event_types'] = $this->getEventTypes();
+ break;
+ case 'delete':
+ break;
+ case 'getOne':
+ $parameterArray['count'] = 1;
+ $parameterArray['offset'] = 0;
+ break;
+ case 'getAll':
+ $parameterArray = $this->getFilter();
+ break;
+ }
+
+ return $parameterArray;
+ }
+}
diff --git a/lib/api/lib/Paymill/Models/Response/Base.php b/lib/api/lib/Paymill/Models/Response/Base.php
new file mode 100644
index 0000000..3cd5e4f
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Base.php
@@ -0,0 +1,115 @@
+_id;
+ }
+
+ /**
+ * Sets the Unique identifier
+ * @param string $id
+ * @return \Paymill\Models\Response\Base
+ */
+ public function setId($id)
+ {
+ $this->_id = $id;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix timestamp of the creation
+ * @return integer
+ */
+ public function getCreatedAt()
+ {
+ return $this->_createdAt;
+ }
+
+ /**
+ * Sets the Unix timestamp of the creation
+ * @param integer $createdAt
+ * @return \Paymill\Models\Response\Base
+ */
+ public function setCreatedAt($createdAt)
+ {
+ $this->_createdAt = $createdAt;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix timestamp of the last update
+ * @return integer
+ */
+ public function getUpdatedAt()
+ {
+ return $this->_updatedAt;
+ }
+
+ /**
+ * Sets the Unix timestamp of the last update
+ * @param integer $updatedAt
+ * @return \Paymill\Models\Response\Base
+ */
+ public function setUpdatedAt($updatedAt)
+ {
+ $this->_updatedAt = $updatedAt;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of the object which created this object instance
+ * @return string|null
+ */
+ public function getAppId()
+ {
+ return $this->_appId;
+ }
+
+ /**
+ * Sets the identifier of the object which created this object instance
+ * @param string|null $appId
+ * @return \Paymill\Models\Response\Base
+ */
+ public function setAppId($appId)
+ {
+ $this->_appId = $appId;
+ return $this;
+ }
+
+}
diff --git a/lib/api/lib/Paymill/Models/Response/Client.php b/lib/api/lib/Paymill/Models/Response/Client.php
new file mode 100644
index 0000000..a21eb2f
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Client.php
@@ -0,0 +1,119 @@
+_email;
+ }
+
+ /**
+ * Sets the Mail address of this client.
+ * @param string $email
+ * @return \Paymill\Models\Response\Client
+ */
+ public function setEmail($email)
+ {
+ $this->_email = $email;
+ return $this;
+ }
+
+ /**
+ * Returns the additional description for this client, perhaps the identifier from your CRM system?
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets an additional description for this client. We recommend some sort of identifier from your CRM system
+ * @param string $description
+ * @return \Paymill\Models\Response\Client
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * Returns a list of payment objects associated with this client
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the payment list stored in the client model
+ * @param \Paymill\Models\Response\Payment $payment
+ * @return \Paymill\Models\Response\Client
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Returns a list of subscription objects associated with this client
+ * @return array
+ */
+ public function getSubscription()
+ {
+ return $this->_subscription;
+ }
+
+ /**
+ * Sets the subscription list stored in the client model
+ * @param array $subscription
+ * @return \Paymill\Models\Response\Client
+ */
+ public function setSubscription($subscription)
+ {
+ $this->_subscription = $subscription;
+ return $this;
+ }
+
+}
diff --git a/lib/api/lib/Paymill/Models/Response/Error.php b/lib/api/lib/Paymill/Models/Response/Error.php
new file mode 100644
index 0000000..879cf20
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Error.php
@@ -0,0 +1,88 @@
+_errorMessage;
+ }
+
+ /**
+ * Sets the error message stored in this model
+ * @param string $errorMessage
+ * @return \Paymill\Models\Response\Error
+ */
+ public function setErrorMessage($errorMessage)
+ {
+ $this->_errorMessage = $errorMessage;
+ return $this;
+ }
+
+ /**
+ * Returns the response code
+ * @return int
+ */
+ public function getResponseCode()
+ {
+ return $this->_responseCode;
+ }
+
+ /**
+ * Sets the response code
+ * @param int $responseCode
+ * @return \Paymill\Models\Response\Error
+ */
+ public function setResponseCode($responseCode)
+ {
+ $this->_responseCode = $responseCode;
+ return $this;
+ }
+
+ /**
+ * Returns the status code
+ * @return int
+ */
+ public function getHttpStatusCode()
+ {
+ return $this->_httpStatusCode;
+ }
+
+ /**
+ * Sets the status code
+ * @param int $httpStatusCode
+ * @return \Paymill\Models\Response\Error
+ */
+ public function setHttpStatusCode($httpStatusCode)
+ {
+ $this->_httpStatusCode = $httpStatusCode;
+ return $this;
+ }
+
+}
diff --git a/lib/api/lib/Paymill/Models/Response/Offer.php b/lib/api/lib/Paymill/Models/Response/Offer.php
new file mode 100644
index 0000000..bc7a0ed
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Offer.php
@@ -0,0 +1,174 @@
+ [integer or string], inactive => [integer or string])
+ */
+ private $_subscriptionCount = array();
+
+ /**
+ * Returns Your name for this offer
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Sets Your name for this offer
+ * @param string $name
+ * @return \Paymill\Models\Response\Offer
+ */
+ public function setName($name)
+ {
+ $this->_name = $name;
+ return $this;
+ }
+
+ /**
+ * Returns the amount as an integer
+ * @return integer
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the amount.
+ * Every interval the specified amount will be charged. Only integer values are allowed (e.g. 42.00 = 4200)
+ * @param integer $amount
+ * @return \Paymill\Models\Response\Offer
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = (int)$amount;
+ return $this;
+ }
+
+ /**
+ * Returns the interval defining how often the client should be charged.
+ * @return string
+ */
+ public function getInterval()
+ {
+ return $this->_interval;
+ }
+
+ /**
+ * Sets the interval defining how often the client should be charged.
+ * @example Format: number DAY | WEEK | MONTH | YEAR Example: 2 DAY
+ * @param string $interval
+ * @return \Paymill\Models\Response\Offer
+ */
+ public function setInterval($interval)
+ {
+ $this->_interval = $interval;
+ return $this;
+ }
+
+ /**
+ * Returns the number of days to try
+ * @return integer
+ */
+ public function getTrialPeriodDays()
+ {
+ return $this->_trialPeriodDays;
+ }
+
+ /**
+ * Sets the number of days to try
+ * @param integer $trialPeriodDays
+ * @return \Paymill\Models\Response\Offer
+ */
+ public function setTrialPeriodDays($trialPeriodDays)
+ {
+ $this->_trialPeriodDays = $trialPeriodDays;
+ return $this;
+ }
+
+ /**
+ * Returns the subscriptionCount array
+ * @return array
+ */
+ public function getSubscriptionCount()
+ {
+ return $this->_subscriptionCount;
+ }
+
+ /**
+ * Sets the subscriptionCount array
+ * @param string|integer $active
+ * @param string|integer $inactive
+ * @return \Paymill\Models\Response\Offer
+ */
+ public function setSubscriptionCount($active, $inactive)
+ {
+ $this->_subscriptionCount['active'] = $active;
+ $this->_subscriptionCount['inactive'] = $inactive;
+ return $this;
+ }
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return Offer
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Payment.php b/lib/api/lib/Paymill/Models/Response/Payment.php
new file mode 100644
index 0000000..e848eb2
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Payment.php
@@ -0,0 +1,355 @@
+_type;
+ }
+
+ /**
+ * Sets the type of the Payment (f. ex. creditcard)
+ * @param string $type
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setType($type)
+ {
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Returns the identifier of a client (client-object)
+ * @return string The identifier of a client (client-object)
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the identifier of a client (client-object)
+ * @param string $client
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * Returns the card type
+ * @return string
+ */
+ public function getCardType()
+ {
+ return $this->_cardType;
+ }
+
+ /**
+ * Sets the card type
+ * @param string $cardType
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setCardType($cardType)
+ {
+ $this->_cardType = $cardType;
+ return $this;
+ }
+
+ /**
+ * Returns the country
+ * @return string
+ */
+ public function getCountry()
+ {
+ return $this->_country;
+ }
+
+ /**
+ * Sets the country
+ * @param string $country
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setCountry($country)
+ {
+ $this->_country = $country;
+ return $this;
+ }
+
+ /**
+ * Returns the expiry month
+ * @return string
+ */
+ public function getExpireMonth()
+ {
+ return $this->_expireMonth;
+ }
+
+ /**
+ * Sets the expiry month
+ * @param string $expireMonth
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setExpireMonth($expireMonth)
+ {
+ $this->_expireMonth = $expireMonth;
+ return $this;
+ }
+
+ /**
+ * Returns the expiry year
+ * @return string
+ */
+ public function getExpireYear()
+ {
+ return $this->_expireYear;
+ }
+
+ /**
+ * Sets the expiry year
+ * @param string $expireYear
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setExpireYear($expireYear)
+ {
+ $this->_expireYear = $expireYear;
+ return $this;
+ }
+
+ /**
+ * Returns the card holder name
+ * @return string
+ */
+ public function getCardHolder()
+ {
+ return $this->_cardHolder;
+ }
+
+ /**
+ * Sets the card holder name
+ * @param string $cardHolder
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setCardHolder($cardHolder)
+ {
+ $this->_cardHolder = $cardHolder;
+ return $this;
+ }
+
+ /**
+ * Returns the last four digests of the number (account-/cardnumber)
+ * @return string
+ */
+ public function getLastFour()
+ {
+ return $this->_lastFour;
+ }
+
+ /**
+ * Sets the last four digests of the number (account-/cardnumber)
+ * @param string $lastFour
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setLastFour($lastFour)
+ {
+ $this->_lastFour = $lastFour;
+ return $this;
+ }
+
+ /**
+ * Returns The used Bank Code
+ * @return string
+ */
+ public function getCode()
+ {
+ return $this->_code;
+ }
+
+ /**
+ * Sets The used Bank Code
+ * @param string $code
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setCode($code)
+ {
+ $this->_code = $code;
+ return $this;
+ }
+
+ /**
+ * Returns the used account number, for security reasons the number is masked
+ * @return string
+ */
+ public function getAccount()
+ {
+ return $this->_account;
+ }
+
+ /**
+ * Sets the used account number, for security reasons the number is masked
+ * @param string $account
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setAccount($account)
+ {
+ $this->_account = $account;
+ return $this;
+ }
+
+ /**
+ * Returns the Name of the account holder
+ * @return string
+ */
+ public function getHolder()
+ {
+ return $this->_holder;
+ }
+
+ /**
+ * Sets the Name of the account holder
+ * @param string $holder
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setHolder($holder)
+ {
+ $this->_holder = $holder;
+ return $this;
+ }
+
+ /**
+ * Returns used IBAN
+ *
+ * @return string
+ */
+ public function getIban()
+ {
+ return $this->_iban;
+ }
+
+ /**
+ * Sets the IBAN
+ *
+ * @param string $iban
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setIban($iban)
+ {
+ $this->_iban = $iban;
+ return $this;
+ }
+
+ /**
+ * Returns used BIC
+ *
+ * @return string
+ */
+ public function getBic()
+ {
+ return $this->_bic;
+ }
+
+ /**
+ * Sets the BIC
+ *
+ * @param string $bic
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function setBic($bic)
+ {
+ $this->_bic = $bic;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Preauthorization.php b/lib/api/lib/Paymill/Models/Response/Preauthorization.php
new file mode 100644
index 0000000..286ce36
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Preauthorization.php
@@ -0,0 +1,168 @@
+_amount;
+ }
+
+ /**
+ * Sets the amount
+ * @param string $amount
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+
+ /**
+ * @var string
+ */
+ private $_currency;
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+ /**
+ * Indicates the current status (open, pending, closed, failed, deleted, preauth)
+ * @var string
+ */
+ private $_status;
+
+ /**
+ * Returns the status
+ * @return string
+ */
+ public function getStatus()
+ {
+ return $this->_status;
+ }
+
+ /**
+ * Sets the status
+ * @param string $status
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setStatus($status)
+ {
+ $this->_status = $status;
+ return $this;
+ }
+
+ /**
+ * Whether this preauthorization was issued while being in live mode or not
+ * @var boolean
+ */
+ private $_livemode;
+
+ /**
+ * Returns the livemode flag of the preAuth object
+ * @return boolean
+ */
+ public function getLivemode()
+ {
+ return $this->_livemode;
+ }
+
+ /**
+ * Sets the livemode flag of the preAuth object
+ * @param boolean $livemode
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setLivemode($livemode)
+ {
+ $this->_livemode = $livemode;
+ return $this;
+ }
+
+ /**
+ * Payment Response Model
+ * @var Payment
+ */
+ private $_payment;
+
+ /**
+ * Returns the identifier of a payment
+ * @return Payment
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the identifier of a payment
+ * @param Payment $payment
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Client Response Model
+ * @var Client
+ */
+ private $_client;
+
+ /**
+ * Returns the identifier of a client
+ * @return Client
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the identifier of a client
+ * @param Client $client
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Refund.php b/lib/api/lib/Paymill/Models/Response/Refund.php
new file mode 100644
index 0000000..31fcb0c
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Refund.php
@@ -0,0 +1,167 @@
+_transaction;
+ }
+
+ /**
+ * Sets the transaction model
+ * @param \Paymill\Models\Response\Transaction $transaction
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setTransaction($transaction)
+ {
+ $this->_transaction = $transaction;
+ return $this;
+ }
+
+ /**
+ * Amount in the smallest possible unit per currency (for euro, we’re calculating the amount in cents).
+ * @var integer
+ */
+ private $_amount;
+
+ /**
+ * Returns the amount
+ * @return integer
+ */
+ public function getAmount()
+ {
+ return $this->_amount;
+ }
+
+ /**
+ * Sets the amount
+ * @param integer $amount
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+ /**
+ * Indicates the current status of this refund. (open, pending, refunded)
+ * @var string
+ */
+ private $_status;
+
+ /**
+ * Returns the Status of the refund
+ * @return string
+ */
+ public function getStatus()
+ {
+ return $this->_status;
+ }
+
+ /**
+ * Sets the Status of the refund
+ * @param string $status
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setStatus($status)
+ {
+ $this->_status = $status;
+ return $this;
+ }
+
+ /**
+ * The description given for this refund.
+ * @var string
+ */
+ private $_description;
+
+ /**
+ * Returns the description of this refund
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets the description of this refund
+ * @param string $description
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * Whether this refund happend in test- or in livemode.
+ * @var boolean
+ */
+ private $_livemode;
+
+ /**
+ * Returns the Livemode flag of this refund
+ * @return boolean
+ */
+ public function getLivemode()
+ {
+ return $this->_livemode;
+ }
+
+ /**
+ * Sets the Livemode flag of this refund
+ * @param boolean $livemode
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setLivemode($livemode)
+ {
+ $this->_livemode = $livemode;
+ return $this;
+ }
+
+ /**
+ * @var integer
+ */
+ private $_responseCode;
+
+ /**
+ * Returns the response code
+ * @return integer
+ */
+ public function getResponseCode()
+ {
+ return $this->_responseCode;
+ }
+
+ /**
+ * Sets the response code
+ * @param integer $responseCode
+ * @return \Paymill\Models\Response\Refund
+ */
+ public function setResponseCode($responseCode)
+ {
+ $this->_responseCode = $responseCode;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Subscription.php b/lib/api/lib/Paymill/Models/Response/Subscription.php
new file mode 100644
index 0000000..5e09de4
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Subscription.php
@@ -0,0 +1,264 @@
+_offer;
+ }
+
+ /**
+ * Sets the model of the offer the subscription is based on
+ * @param \Paymill\Models\Response\Offer $offer
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setOffer($offer)
+ {
+ $this->_offer = $offer;
+ return $this;
+ }
+
+ /**
+ * Returns the flag determining whether this subscription was issued while being in live mode or not.
+ * @return boolean
+ */
+ public function getLivemode()
+ {
+ return $this->_livemode;
+ }
+
+ /**
+ * Sets the flag determining whether this subscription was issued while being in live mode or not.
+ * @param string $livemode
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setLivemode($livemode)
+ {
+ $this->_livemode = $livemode;
+ return $this;
+ }
+
+ /**
+ * Returns the flag determining whether to cancel this subscription immediately or at the end of the current period
+ * @return boolean
+ */
+ public function getCancelAtPeriodEnd()
+ {
+ return $this->_cancelAtPeriodEnd;
+ }
+
+ /**
+ * Sets a flag determining whether to cancel this subscription immediately or at the end of the current period
+ * @param boolean $cancelAtPeriodEnd
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setCancelAtPeriodEnd($cancelAtPeriodEnd)
+ {
+ $this->_cancelAtPeriodEnd = $cancelAtPeriodEnd;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the trial period start
+ * @return integer
+ */
+ public function getTrialStart()
+ {
+ return $this->_trialStart;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the trial period start
+ * @param integer $trialStart
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setTrialStart($trialStart)
+ {
+ $this->_trialStart = $trialStart;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the trial period end.
+ * @return integer
+ */
+ public function getTrialEnd()
+ {
+ return $this->_trialEnd;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the trial period end.
+ * @param integer $trialEnd
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setTrialEnd($trialEnd)
+ {
+ $this->_trialEnd = $trialEnd;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the next charge.
+ * @return integer
+ */
+ public function getNextCaptureAt()
+ {
+ return $this->_nextCaptureAt;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the next charge.
+ * @param integer $nextCaptureAt
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setNextCaptureAt($nextCaptureAt)
+ {
+ $this->_nextCaptureAt = $nextCaptureAt;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the cancel date.
+ * @return integer
+ */
+ public function getCanceledAt()
+ {
+ return $this->_canceledAt;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the cancel date.
+ * @param integer $canceledAt
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setCanceledAt($canceledAt)
+ {
+ $this->_canceledAt = $canceledAt;
+ return $this;
+ }
+
+ /**
+ * Returns the payment object registered with this subscription
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the payment object registered with this subscription
+ * @param \Paymill\Models\Response\Payment $payment
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * Returns the client associated with this subscription
+ * @return \Paymill\Models\Response\Client
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the client associated with this subscription
+ * @param \Paymill\Models\Response\Client $client
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * Returns the Unix-Timestamp for the trial period start
+ * @return integer
+ */
+ public function getStartAt()
+ {
+ return $this->_startAt;
+ }
+
+ /**
+ * Sets the Unix-Timestamp for the trial period start
+ * @param integer $startAt
+ * @return \Paymill\Models\Response\Subscription
+ */
+ public function setStartAt($startAt)
+ {
+ $this->_startAt = $startAt;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Transaction.php b/lib/api/lib/Paymill/Models/Response/Transaction.php
new file mode 100644
index 0000000..eab7848
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Transaction.php
@@ -0,0 +1,374 @@
+_amount;
+ }
+
+ /**
+ * Sets the 'real' amount for the transaction.
+ * The number musst be in the smallest currency unit and will be saved as a string
+ * @param string $amount
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setAmount($amount)
+ {
+ $this->_amount = $amount;
+ return $this;
+ }
+
+ /**
+ * origin amount
+ * @var integer
+ */
+ private $_originAmount;
+
+ /**
+ * Returns the origin amount for the transaction.
+ * @return integer
+ */
+ public function getOriginAmount()
+ {
+ return $this->_originAmount;
+ }
+
+ /**
+ * Sets the origin amount for the transaction.
+ * The number musst be in the smallest currency unit and will be saved as a string
+ * @param integer $originAmount
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setOriginAmount($originAmount)
+ {
+ $this->_originAmount = $originAmount;
+ return $this;
+ }
+
+ /**
+ * Possible status values (open, closed, failed, preauth, pending, refunded, partially_refunded, chargeback)
+ * @var string
+ */
+ private $_status;
+
+ /**
+ * Returns the transaction status
+ * @return string
+ */
+ public function getStatus()
+ {
+ return $this->_status;
+ }
+
+ /**
+ * Sets the transaction status
+ * @param string $status
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setStatus($status)
+ {
+ $this->_status = $status;
+ return $this;
+ }
+
+ /**
+ * @var string
+ */
+ private $_description;
+
+ /**
+ * Returns the transaction description
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Sets the transaction description
+ * @param string $description
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setDescription($description)
+ {
+ $this->_description = $description;
+ return $this;
+ }
+
+ /**
+ * @var boolean
+ */
+ private $_livemode;
+
+ /**
+ * Returns the livemode flag of the transaction
+ * @return boolean
+ */
+ public function getLivemode()
+ {
+ return $this->_livemode;
+ }
+
+ /**
+ * Sets the livemode flag of the transaction
+ * @param boolean $livemode
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setLivemode($livemode)
+ {
+ $this->_livemode = $livemode;
+ return $this;
+ }
+
+ /**
+ * @var array
+ */
+ private $_refunds = null;
+
+ /**
+ * Returns the refunds stored in the transaction
+ * @return array|null
+ */
+ public function getRefunds()
+ {
+ return $this->_refunds;
+ }
+
+ /**
+ * Sets the refunds stored in the transaction
+ * @param array $refunds
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setRefunds($refunds)
+ {
+ $this->_refunds = $refunds;
+ return $this;
+ }
+
+ /**
+ * @var string
+ */
+ private $_currency;
+
+ /**
+ * Returns the currency
+ * @return string
+ */
+ public function getCurrency()
+ {
+ return $this->_currency;
+ }
+
+ /**
+ * Sets the currency
+ * @param string $currency
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setCurrency($currency)
+ {
+ $this->_currency = $currency;
+ return $this;
+ }
+
+ /**
+ * Response code for transaction feedback. 20000 marks a successful transaction
+ * @tutorial https://paymill.com/de-de/dokumentation/referenz/api-referenz/#document-statuscodes
+ * @var integer
+ */
+ private $_responseCode;
+
+ /**
+ * Returns the response code (20000 marks a successful transaction)
+ * @return integer
+ */
+ public function getResponseCode()
+ {
+ return $this->_responseCode;
+ }
+
+ /**
+ * Sets the response code of the transaction
+ * @param integer $responseCode
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setResponseCode($responseCode)
+ {
+ $this->_responseCode = $responseCode;
+ return $this;
+ }
+
+ /**
+ * Unique identifier of this transaction provided to the acquirer for the statements.
+ * @var string
+ */
+ private $_shortId;
+
+ /**
+ * Returns the short id of the transaction
+ * @return string
+ */
+ public function getShortId()
+ {
+ return $this->_shortId;
+ }
+
+ /**
+ * Sets the transaction short id
+ * @param string $shortId
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setShortId($shortId)
+ {
+ $this->_shortId = $shortId;
+ return $this;
+ }
+
+ /**
+ * PAYMILL invoice where the transaction fees are charged or null.
+ * @var array
+ */
+ private $_invoices = null;
+
+ /**
+ * Returns an array of invoices stored in the transaction
+ * @return array|null
+ */
+ public function getInvoices()
+ {
+ return $this->_invoices;
+ }
+
+ /**
+ * Stores an array of invoices in the transaction
+ * @param array $invoices
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setInvoices($invoices)
+ {
+ $this->_invoices = $invoices;
+ return $this;
+ }
+
+ /**
+ * @var \Paymill\Models\Response\Payment
+ */
+ private $_payment;
+
+ /**
+ * Returns the payment associated with the transaction
+ * @return \Paymill\Models\Response\Payment
+ */
+ public function getPayment()
+ {
+ return $this->_payment;
+ }
+
+ /**
+ * Sets the Payment for the transcation
+ * @param \Paymill\Models\Response\Payment $payment
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setPayment($payment)
+ {
+ $this->_payment = $payment;
+ return $this;
+ }
+
+ /**
+ * @var \Paymill\Models\Response\Client
+ */
+ private $_client = null;
+
+ /**
+ * Returns the Client associated with the transaction. If no client is available null will be returned
+ * @return \Paymill\Models\Response\Client|null
+ */
+ public function getClient()
+ {
+ return $this->_client;
+ }
+
+ /**
+ * Sets the Client for the transaction
+ * @param \Paymill\Models\Response\Client $client
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setClient($client)
+ {
+ $this->_client = $client;
+ return $this;
+ }
+
+ /**
+ * @var \Paymill\Models\Response\Preauthorization
+ */
+ private $_preauthorization = null;
+
+ /**
+ * Returns the Preauthorization associated with the transaction. If no preAuth is available null will be returned
+ * @return \Paymill\Models\Response\Preauthorization|null
+ */
+ public function getPreauthorization()
+ {
+ return $this->_preauthorization;
+ }
+
+ /**
+ * Sets the Preauthorization for the transaction
+ * @param \Paymill\Models\Response\Preauthorization $preauthorization
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setPreauthorization($preauthorization)
+ {
+ $this->_preauthorization = $preauthorization;
+ return $this;
+ }
+
+ /**
+ * @var array
+ */
+ private $_fees;
+
+ /**
+ * Returns the fee array stored in the transaction
+ * @return array
+ */
+ public function getFees()
+ {
+ return $this->_fees;
+ }
+
+ /**
+ * Sets the Fees array for the transaction
+ * @param array $fees
+ * @return \Paymill\Models\Response\Transaction
+ */
+ public function setFees($fees)
+ {
+ $this->_fees = $fees;
+ return $this;
+ }
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Models/Response/Webhook.php b/lib/api/lib/Paymill/Models/Response/Webhook.php
new file mode 100644
index 0000000..bf514c1
--- /dev/null
+++ b/lib/api/lib/Paymill/Models/Response/Webhook.php
@@ -0,0 +1,122 @@
+_url;
+ }
+
+ /**
+ * Sets the webhook url
+ * @param string $url
+ * @return \Paymill\Models\Response\Webhook
+ */
+ public function setUrl($url)
+ {
+ $this->_url = $url;
+ return $this;
+ }
+
+ /**
+ * Returns the livemode flag of the webhook
+ * @return boolean
+ */
+ public function getLivemode()
+ {
+ return $this->_livemode;
+ }
+
+ /**
+ * Sets the livemode flag of the webhook
+ * @param boolean $livemode
+ * @return \Paymill\Models\Response\Webhook
+ */
+ public function setLivemode($livemode)
+ {
+ $this->_livemode = $livemode;
+ return $this;
+ }
+
+ /**
+ * Returns the event types as an array
+ * @return array
+ */
+ public function getEventTypes()
+ {
+ return $this->_eventTypes;
+ }
+
+ /**
+ * Sets the event types for the webhook.
+ * There are a number of events you can react to. Each webhook can be configured to catch any kind of event
+ * individually, so you can create different webhooks for different events. Each Webhook needs to be attached
+ * to at least one event. For example the event subscription.succeeded is triggered every time a successful
+ * transaction has been made in our system that is based on a subscription. Shortly after that has been triggered,
+ * we will call every webhook you defined for this event and send detailed information to it.
+ * @tutorial https://paymill.com/de-de/dokumentation/referenz/api-referenz/#document-webhooks
+ * @param array $eventTypes
+ * @return \Paymill\Models\Response\Webhook
+ */
+ public function setEventTypes($eventTypes)
+ {
+ $this->_eventTypes = $eventTypes;
+ return $this;
+ }
+
+ /**
+ * Returns the email registered for this webhook
+ * @return string||null
+ */
+ public function getEmail()
+ {
+ return $this->_email;
+ }
+
+ /**
+ * Sets the email for the webhook.
+ * @param string $email Instead of setting the url parameter you can set the email parameter to create a webhook,
+ * where we send mails to in case of an event.
+ * @return \Paymill\Models\Response\Webhook
+ */
+ public function setEmail($email)
+ {
+ $this->_email = $email;
+ return $this;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/lib/Paymill/Request.php b/lib/api/lib/Paymill/Request.php
new file mode 100644
index 0000000..ef2e5ed
--- /dev/null
+++ b/lib/api/lib/Paymill/Request.php
@@ -0,0 +1,261 @@
+setConnectionClass(new Curl($privateKey));
+ }
+ }
+
+ /**
+ * @param \Paymill\API\CommunicationAbstract|Curl $communicationClass
+ * @return $this
+ */
+ public function setConnectionClass(CommunicationAbstract $communicationClass = null)
+ {
+ $this->_connectionClass = $communicationClass;
+ return $this;
+ }
+
+ /**
+ * Sends a creation request using the provided model
+ * @param \Paymill\Models\Request\Base $model
+ * @throws PaymillException
+ * @return \Paymill\Models\Response\Base
+ */
+ public function create($model)
+ {
+ return $this->_request($model, __FUNCTION__);
+ }
+
+ /**
+ * Sends an update request using the provided model
+ * @param \Paymill\Models\Request\Base $model
+ * @throws PaymillException
+ * @return \Paymill\Models\Response\Base
+ */
+ public function update($model)
+ {
+ return $this->_request($model, __FUNCTION__);
+ }
+
+ /**
+ * Sends a delete request using the provided model
+ * @param \Paymill\Models\Request\Base $model
+ * @throws PaymillException
+ * @return \Paymill\Models\Response\Base
+ */
+ public function delete($model)
+ {
+ return $this->_request($model, __FUNCTION__);
+ }
+
+ /**
+ * Sends a getAll request using the provided model
+ * @param \Paymill\Models\Request\Base $model
+ * @throws PaymillException
+ * @return array
+ */
+ public function getAll($model)
+ {
+ return $this->_request($model, __FUNCTION__);
+ }
+
+ /**
+ * Sends a getOne request using the provided model
+ * @param \Paymill\Models\Request\Base $model
+ * @throws PaymillException
+ * @return \Paymill\Models\Response\Base
+ */
+ public function getOne($model)
+ {
+ return $this->_request($model, __FUNCTION__);
+ }
+
+ /**
+ * Returns the response of the last request
+ * @return array
+ */
+ public function getLastResponse()
+ {
+ return $this->_lastResponse;
+ }
+
+ /**
+ * Returns the parameter which were used for the last request
+ * @return array
+ */
+ public function getLastRequest()
+ {
+ return $this->_lastRequest;
+ }
+
+ /**
+ * Returns the Version of this Lib
+ *
+ * @return string
+ */
+ public function getVersion(){
+ return $this->_version;
+ }
+
+ /**
+ * Returns the LastResponse as StdClassObject. Returns false if no request was made earlier.
+ *
+ * @return false | stdClass
+ */
+ public function getJSONObject(){
+ $result = false;
+ $responseHandler = new ResponseHandler();
+ if(is_array($this->_lastResponse)){
+ $result = $responseHandler->arrayToObject($this->_lastResponse['body']);
+ }
+ return $result;
+ }
+
+ /**
+ *
+ * @param string $method
+ * @return string
+ */
+ private function _getHTTPMethod($method)
+ {
+ $httpMethod = 'POST';
+ switch ($method) {
+ case 'create':
+ $httpMethod = 'POST';
+ break;
+ case 'update':
+ $httpMethod = 'PUT';
+ break;
+ case 'delete':
+ $httpMethod = 'DELETE';
+ break;
+ case 'getAll':
+ case 'getOne':
+ $httpMethod = 'GET';
+ break;
+ }
+ return $httpMethod;
+ }
+
+ /**
+ * Sends a request based on the provided request model and according to the argumented method
+ * @param \Paymill\Models\Request\Base $model
+ * @param string $method (Create, update, delete, getAll, getOne)
+ * @throws PaymillException
+ * @return \Paymill\Models\Response\Base|\Paymill\Models\Response\Error
+ */
+ private function _request(Base $model, $method)
+ {
+ if(!is_a($this->_connectionClass, '\Paymill\API\CommunicationAbstract')){
+ throw new PaymillException(null,'The connenction class is missing!');
+ }
+ $httpMethod = $this->_getHTTPMethod($method);
+ $parameter = $model->parameterize($method);
+ $serviceResource = $model->getServiceResource() . $model->getId();
+ if(is_a($model, "\Paymill\Models\Request\Transaction") && $method === "create"){
+ $source = empty($this->_source) ? "PhpLib" . $this->getVersion(): "PhpLib" . $this->getVersion() . "_" . $this->getSource();
+ $parameter['source'] = $source;
+ }
+
+ try {
+ $this->_lastRequest = $parameter;
+ $response = $this->_connectionClass->requestApi(
+ $serviceResource, $parameter, $httpMethod
+ );
+ $this->_lastResponse = $response;
+ $responseHandler = new ResponseHandler();
+ if ($method === 'getAll') {
+ if ($responseHandler->validateResponse($response)) {
+ $convertedResponse = $response['body']['data'];
+ } else {
+ $convertedResponse = $responseHandler->convertResponse($response, $model->getServiceResource());
+ }
+ } else {
+ $convertedResponse = $responseHandler->convertResponse($response, $model->getServiceResource());
+ }
+ } catch (\Exception $e) {
+ $errorModel = new Error();
+ $convertedResponse = $errorModel->setErrorMessage($e->getMessage());
+ }
+
+ if (is_a($convertedResponse, '\Paymill\Models\Response\Error')) {
+ throw new PaymillException(
+ $convertedResponse->getResponseCode(), $convertedResponse->getErrorMessage(), $convertedResponse->getHttpStatusCode()
+ );
+ }
+
+ return $convertedResponse;
+ }
+
+ /**
+ * Sets the source for requests
+ *
+ * @param string $source
+ * @return \Paymill\Request
+ */
+ public function setSource($source){
+ if(is_string($source)){
+ $this->_source = $source;
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the source for requests
+ *
+ * @return string
+ */
+ public function getSource(){
+ return $this->_source;
+ }
+
+}
diff --git a/lib/api/lib/Paymill/Services/PaymillException.php b/lib/api/lib/Paymill/Services/PaymillException.php
new file mode 100644
index 0000000..dad18c8
--- /dev/null
+++ b/lib/api/lib/Paymill/Services/PaymillException.php
@@ -0,0 +1,56 @@
+_errorMessage = $message;
+ $this->_responseCode = $responseCode;
+ $this->_httpStatusCode = $code;
+ }
+
+ /**
+ * @return string
+ */
+ public function getErrorMessage()
+ {
+ return $this->_errorMessage;
+ }
+
+ /**
+ * @return string
+ */
+ public function getStatusCode()
+ {
+ return $this->_httpStatusCode;
+ }
+
+ /**
+ * @return integer
+ */
+ public function getResponseCode()
+ {
+ return $this->_responseCode;
+ }
+
+}
diff --git a/lib/api/lib/Paymill/Services/ResponseHandler.php b/lib/api/lib/Paymill/Services/ResponseHandler.php
new file mode 100644
index 0000000..070fe3c
--- /dev/null
+++ b/lib/api/lib/Paymill/Services/ResponseHandler.php
@@ -0,0 +1,414 @@
+ "General undefined response.",
+ 10002 => "Still waiting on something.",
+ 20000 => "General success response.",
+ 40000 => "General problem with data.",
+ 40001 => "General problem with payment data.",
+ 40100 => "Problem with credit card data.",
+ 40101 => "Problem with cvv.",
+ 40102 => "Card expired or not yet valid.",
+ 40103 => "Limit exceeded.",
+ 40104 => "Card invalid.",
+ 40105 => "Expiry date not valid.",
+ 40106 => "Credit card brand required.",
+ 40200 => "Problem with bank account data.",
+ 40201 => "Bank account data combination mismatch.",
+ 40202 => "User authentication failed.",
+ 40300 => "Problem with 3d secure data.",
+ 40301 => "Currency / amount mismatch",
+ 40400 => "Problem with input data.",
+ 40401 => "Amount too low or zero.",
+ 40402 => "Usage field too long.",
+ 40403 => "Currency not allowed.",
+ 50000 => "General problem with backend.",
+ 50001 => "Country blacklisted.",
+ 50100 => "Technical error with credit card.",
+ 50101 => "Error limit exceeded.",
+ 50102 => "Card declined by authorization system.",
+ 50103 => "Manipulation or stolen card.",
+ 50104 => "Card restricted.",
+ 50105 => "Invalid card configuration data.",
+ 50200 => "Technical error with bank account.",
+ 50201 => "Card blacklisted.",
+ 50300 => "Technical error with 3D secure.",
+ 50400 => "Decline because of risk issues.",
+ 50500 => "General timeout.",
+ 50501 => "Timeout on side of the acquirer.",
+ 50502 => "Risk management transaction timeout.",
+ 50600 => "Duplicate transaction.",
+ );
+
+ /**
+ * Converts a response to a model
+ * @param array $response
+ * @param string $serviceResource
+ * @return Models\Base|Error
+ */
+ public function convertResponse($response, $serviceResource)
+ {
+ $resourceName = substr($serviceResource, 0, -2);
+ $resultValue = null;
+ if ($this->validateResponse($response)) {
+ $resultValue = $this->_convertResponseToModel($response['body']['data'], $resourceName);
+ } else {
+ $resultValue = $this->_convertErrorToModel($response);
+ }
+ return $resultValue;
+ }
+
+ /**
+ * Creates an object from a response array based on the call-context
+ * @param array $response Response from any Request
+ * @param string $resourceName
+ * @return Models\Base
+ */
+ private function _convertResponseToModel($response, $resourceName)
+ {
+ if (!is_array($response) || empty($response)) {
+ return $response;
+ }
+
+ $model = null;
+ switch (strtolower($resourceName)) {
+ case 'client':
+ $model = $this->_createClient($response);
+ break;
+ case 'payment':
+ $model = $this->_createPayment($response);
+ break;
+ case 'transaction':
+ $model = $this->_createTransaction($response);
+ break;
+ case 'preauthorization':
+ if (isset($response['preauthorization'])) {
+ $response = $response['preauthorization'];
+ }
+ $model = $this->_createPreauthorization($response);
+ break;
+ case 'refund':
+ $model = $this->_createRefund($response);
+ break;
+ case 'offer':
+ $model = $this->_createOffer($response);
+ break;
+ case 'subscription':
+ $model = $this->_createSubscription($response);
+ break;
+ case 'webhook':
+ $model = $this->_createWebhook($response);
+ break;
+ }
+
+ return $model;
+ }
+
+ /**
+ * Creates and fills a clientmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Client
+ */
+ private function _createClient($response)
+ {
+ $model = new Models\Client();
+ $model->setId($response['id']);
+ $model->setEmail($response['email']);
+ $model->setDescription($response['description']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setSubscription($this->_handleRecursive($response['subscription'], 'subscription'));
+ $model->setAppId($response['app_id']);
+ $model->setPayment($this->_handleRecursive($response['payment'], 'payment'));
+ return $model;
+ }
+
+ /**
+ * Creates and fills a paymentmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Payment
+ */
+ private function _createPayment($response)
+ {
+ $model = new Models\Payment();
+ $model->setId($response['id']);
+ $model->setType($response['type']);
+ $model->setClient($this->_convertResponseToModel($response['client'], "client"));
+ if ($response['type'] === "creditcard") {
+ $model->setCardType($response['card_type']);
+ $model->setCountry($response['country']);
+ $model->setExpireMonth($response['expire_month']);
+ $model->setExpireYear($response['expire_year']);
+ $model->setCardHolder($response['card_holder']);
+ $model->setLastFour($response['last4']);
+ } else if ($response['type'] === "debit") {
+ $model->setHolder($response['holder']);
+ $model->setCode($response['code']);
+ $model->setAccount($response['account']);
+ $model->setBic($response['bic']);
+ $model->setIban($response['iban']);
+ }
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a transactionmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Transaction
+ */
+ private function _createTransaction($response)
+ {
+ $model = new Models\Transaction();
+ $model->setId($response['id']);
+ $model->setAmount($response['amount']);
+ $model->setOriginAmount($response['origin_amount']);
+ $model->setStatus($response['status']);
+ $model->setDescription($response['description']);
+ $model->setLivemode($response['livemode']);
+ $model->setRefunds($this->_handleRecursive($response['refunds'], 'refund'));
+ $model->setCurrency($response['currency']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setResponseCode($response['response_code']);
+ $model->setShortId($response['short_id']);
+ $model->setInvoices($response['invoices']);
+ $model->setPayment($this->_convertResponseToModel($response['payment'], "payment"));
+ $model->setClient($this->_convertResponseToModel($response['client'], "client"));
+ $model->setPreauthorization($this->_convertResponseToModel($response['preauthorization'], "preauthorization"));
+ $model->setFees($response['fees']);
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a preauthorizationmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Preauthorization
+ */
+ private function _createPreauthorization($response)
+ {
+ $model = new Models\Preauthorization();
+ $model->setId($response['id']);
+ $model->setAmount($response['amount']);
+ $model->setCurrency($response['currency']);
+ $model->setStatus($response['status']);
+ $model->setLivemode($response['livemode']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setPayment($this->_convertResponseToModel($response['payment'], "payment"));
+ $model->setClient($this->_convertResponseToModel($response['client'], "client"));
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a refundmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Refund
+ */
+ private function _createRefund($response)
+ {
+ $model = new Models\Refund();
+ $model->setId($response['id']);
+ $model->setAmount($response['amount']);
+ $model->setStatus($response['status']);
+ $model->setDescription($response['description']);
+ $model->setLivemode($response['livemode']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setResponseCode($response['response_code']);
+ //Refund doesn't have the array index 'transaction' when using getOne
+ $model->setTransaction(isset($response['transaction']) ? $this->_convertResponseToModel($response['transaction'], 'transaction') : null);
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a offermodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Offer
+ */
+ private function _createOffer($response)
+ {
+ $model = new Models\Offer();
+ $model->setId($response['id']);
+ $model->setName($response['name']);
+ $model->setAmount($response['amount']);
+ $model->setCurrency($response['currency']);
+ $model->setInterval($response['interval']);
+ $model->setTrialPeriodDays($response['trial_period_days']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setSubscriptionCount($response['subscription_count']['active'], $response['subscription_count']['inactive']);
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a subscriptionmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Subscription
+ */
+ private function _createSubscription($response)
+ {
+ $model = new Models\Subscription();
+ $model->setId($response['id']);
+ $model->setOffer($this->_convertResponseToModel($response['offer'], 'offer'));
+ $model->setLivemode($response['livemode']);
+ $model->setCancelAtPeriodEnd($response['cancel_at_period_end']);
+ $model->setTrialStart($response['trial_start']);
+ $model->setTrialEnd($response['trial_end']);
+ $model->setNextCaptureAt($response['next_capture_at']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setCanceledAt($response['canceled_at']);
+ $model->setPayment($this->_convertResponseToModel($response['payment'], "payment"));
+ $model->setClient($this->_convertResponseToModel($response['client'], "client"));
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Creates and fills a webhookmodel
+ *
+ * @param array $response
+ * @return \Paymill\Models\Response\Webhook
+ */
+ private function _createWebhook($response)
+ {
+ $model = new Models\Webhook();
+ $model->setId($response['id']);
+ isset($response['url']) ? $model->setUrl($response['url']) : $model->setEmail($response['email']);
+ $model->setLivemode($response['livemode']);
+ $model->setEventTypes($response['event_types']);
+ $model->setCreatedAt($response['created_at']);
+ $model->setUpdatedAt($response['updated_at']);
+ $model->setAppId($response['app_id']);
+ return $model;
+ }
+
+ /**
+ * Handles the multidimensional param arrays during model creation
+ * @param array $response
+ * @param string $resourceName
+ * @return array|null|Models\Base
+ */
+ private function _handleRecursive($response, $resourceName)
+ {
+ $result = null;
+ if (isset($response['id'])) {
+ $result = $this->_convertResponseToModel($response, $resourceName);
+ } else if (!is_null($response)) {
+ $paymentArray = array();
+ foreach ($response as $paymentData) {
+ array_push($paymentArray, $this->_convertResponseToModel($paymentData, $resourceName));
+ }
+ $result = $paymentArray;
+ }
+ return $result;
+ }
+
+ /**
+ * Generates an error model based on the provided response array
+ * @param array $response
+ * @return Error
+ */
+ private function _convertErrorToModel($response)
+ {
+ $errorModel = new Error();
+
+ $httpStatusCode = isset($response['header']['status']) ? $response['header']['status'] : null;
+ $errorModel->setHttpStatusCode($httpStatusCode);
+
+ $responseCode = isset($response['body']['data']['response_code']) ? $response['body']['data']['response_code'] : null;
+ $errorModel->setResponseCode($responseCode);
+
+ $errorCode = 'Undefined Error. This should not happen!';
+ if (isset($this->_errorCodes[$responseCode])) {
+ $errorCode = $this->_errorCodes[$responseCode];
+ }
+
+ if (isset($response['body'])) {
+ if (is_array($response['body'])) {
+ if (isset($response['body']['error'])) {
+ if (is_array($response['body']['error'])) {
+ $errorCode = $this->getErrorMessageFromArray($response['body']['error']);
+ } elseif (is_string($response['body']['error'])) {
+ $errorCode = $response['body']['error'];
+ }
+ }
+ } elseif (is_string($response['body'])) {
+ $json = json_decode($response['body']);
+ $errorCode = $json->error;
+ }
+ }
+ $errorModel->setErrorMessage($errorCode);
+ return $errorModel;
+ }
+
+ /**
+ * Validates the data responsed by the API
+ *
+ * Only Refund, Transaction and Preauthorization return an response_code
+ * @param array $response
+ * @return boolean
+ */
+ public function validateResponse($response)
+ {
+ $returnValue = false;
+ if ($response['header']['status'] === 200) {
+ if (isset($response['body']['data']['response_code'])) {
+ $returnValue = false;
+ if ($response['body']['data']['response_code'] === 20000) {
+ $returnValue = true;
+ }
+ } else {
+ $returnValue = true;
+ }
+ }
+ return $returnValue;
+ }
+
+ private function getErrorMessageFromArray($errorArray)
+ {
+ $errorMessage = array_shift($errorArray);
+ if (is_array($errorMessage)) {
+ return $this->getErrorMessageFromArray($errorMessage);
+ } else {
+ return $errorMessage;
+ }
+ }
+
+ /**
+ * Converts an array into an object
+ *
+ * @param array $array
+ * @return stdClass
+ */
+ public function arrayToObject($array)
+ {
+ return is_array($array) ? (object) array_map(array($this, 'arrayToObject'), $array) : $array;
+ }
+
+}
diff --git a/lib/api/tests/bootstrap.php b/lib/api/tests/bootstrap.php
new file mode 100644
index 0000000..c86feed
--- /dev/null
+++ b/lib/api/tests/bootstrap.php
@@ -0,0 +1,21 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Client();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createClient()
+ {
+ $this->_model->setEmail('Plugins@Paymill.de')
+ ->setDescription('Test');
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Client', $result);
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createClient
+ */
+ public function updateClient($model)
+ {
+ $this->_model->setId($model->getId())
+ ->setDescription('UpdateSuccessful');
+ $result = $this->_service->update($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Client', $result, var_export($result, true));
+ $this->assertEquals('UpdateSuccessful', $result->getDescription());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Client not found
+ */
+ public function updateClientWithWrongId()
+ {
+ $this->_model->setId('YouWillNeverFindMe404')
+ ->setDescription('TEST');
+ $this->_service->update($this->_model);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createClient
+ */
+ public function getOneClient($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->getOne($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Client', $result, var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createClient
+ */
+ public function getAllClient()
+ {
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllClientWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createClient
+ * @depends getOneClient
+ * @depends updateClient
+ */
+ public function deleteClient($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->markTestIncomplete('Client does not return a empty array like the other resources.');
+ $result = $this->_service->delete($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage 'PluginsAtPaymillDotde' is not a valid email address.
+ */
+ public function createClientWithInvalidEmail()
+ {
+ $this->_model->setEmail('PluginsAtPaymillDotde')
+ ->setDescription('Test');
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Client', $result);
+ return $result;
+ }
+
+
+}
diff --git a/lib/api/tests/integration/OfferTest.php b/lib/api/tests/integration/OfferTest.php
new file mode 100644
index 0000000..c9d3644
--- /dev/null
+++ b/lib/api/tests/integration/OfferTest.php
@@ -0,0 +1,129 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Offer();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createOffer()
+ {
+ $this->_model->setAmount(100)
+ ->setCurrency('EUR')
+ ->setInterval('2 DAY')
+ ->setName('TestOffer');
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Offer', $result, var_export($result, true));
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createOffer
+ */
+ public function updateOffer($model)
+ {
+ $this->_model->setId($model->getId())
+ ->setName('NewName');
+ $result = $this->_service->update($this->_model);
+
+ $this->assertInstanceOf('Paymill\Models\Response\Offer', $result, var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createOffer
+ */
+ public function getOneOffer($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->assertInstanceOf('Paymill\Models\Response\Offer', $result = $this->_service->getOne($this->_model), var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createOffer
+ */
+ public function getAllOffer()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllOfferWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createOffer
+ * @depends getOneOffer
+ * @depends updateOffer
+ */
+ public function deleteOffer($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->delete($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+}
diff --git a/lib/api/tests/integration/PaymentTest.php b/lib/api/tests/integration/PaymentTest.php
new file mode 100644
index 0000000..f098689
--- /dev/null
+++ b/lib/api/tests/integration/PaymentTest.php
@@ -0,0 +1,125 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Payment();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createPayment()
+ {
+ $this->_model->setToken("098f6bcd4621d373cade4e832627b4f6");
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Payment', $result);
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPayment
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Method not Found
+ */
+ public function updatePayment($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->_service->update($this->_model);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPayment
+ */
+ public function getOnePayment($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->getOne($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Payment', $result, var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPayment
+ */
+ public function getAllPayment()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllPaymentWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPayment
+ * @depends getOnePayment
+ * @depends updatePayment
+ */
+ public function deletePayment($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->delete($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+}
diff --git a/lib/api/tests/integration/PreauthorizationTest.php b/lib/api/tests/integration/PreauthorizationTest.php
new file mode 100644
index 0000000..054e822
--- /dev/null
+++ b/lib/api/tests/integration/PreauthorizationTest.php
@@ -0,0 +1,131 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Preauthorization();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createPreauthorization()
+ {
+ $this->_model->setToken("098f6bcd4621d373cade4e832627b4f6")
+ ->setAmount(100)
+ ->setCurrency('EUR');
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Preauthorization', $result);
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPreauthorization
+ */
+ public function updatePreauthorization($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->markTestIncomplete(
+ 'Preauthorization should return a valid Object like Client "Method not found". Returns a empty 500-Response instead.'
+ );
+
+ $result = $this->_service->update($this->_model);
+
+ $this->assertInstanceOf('Paymill\Models\Response\Error', $result, var_export($result, true));
+ $this->assertEquals('Preauthorization was not found', $result->getErrorMessage());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPreauthorization
+ */
+ public function getOnePreauthorization($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->assertInstanceOf('Paymill\Models\Response\Preauthorization', $result = $this->_service->getOne($this->_model), var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPreauthorization
+ */
+ public function getAllPreauthorization()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllPreauthorizationWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createPreauthorization
+ * @depends getOnePreauthorization
+ * @depends updatePreauthorization
+ */
+ public function deletePreauthorization($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->delete($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+}
diff --git a/lib/api/tests/integration/RefundTest.php b/lib/api/tests/integration/RefundTest.php
new file mode 100644
index 0000000..a72a401
--- /dev/null
+++ b/lib/api/tests/integration/RefundTest.php
@@ -0,0 +1,136 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Refund();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createRefund()
+ {
+ $transactionModel = new Models\Request\Transaction();
+ $transactionModel->setAmount(200)
+ ->setCurrency('EUR')
+ ->setToken("098f6bcd4621d373cade4e832627b4f6");
+ $transactionModelResponse = $this->_service->create($transactionModel);
+ $this->assertInstanceOf('Paymill\Models\Response\Transaction', $transactionModelResponse, var_export($transactionModelResponse, true));
+
+ $this->_model->setAmount(100)
+ ->setDescription('EUR')
+ ->setId($transactionModelResponse->getId());
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Refund', $result, var_export($result, true));
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createRefund
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Method not Found
+ */
+ public function updateRefund($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->_service->update($this->_model);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createRefund
+ */
+ public function getOneRefund($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->assertInstanceOf('Paymill\Models\Response\Refund', $result = $this->_service->getOne($this->_model), var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createRefund
+ */
+ public function getAllRefund()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllRefundWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createRefund
+ * @depends getOneRefund
+ * @depends updateRefund
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Method not Found
+ */
+ public function deleteRefund($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->delete($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Error', $result, var_export($result, true));
+ $this->assertEquals('Method not Found', $result->getErrorMessage());
+ }
+
+}
diff --git a/lib/api/tests/integration/SubscriptionTest.php b/lib/api/tests/integration/SubscriptionTest.php
new file mode 100644
index 0000000..8e60d35
--- /dev/null
+++ b/lib/api/tests/integration/SubscriptionTest.php
@@ -0,0 +1,149 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Subscription();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createSubscription()
+ {
+ $this->markTestIncomplete(
+ 'Needs to be clarified with Paymill. Creation crashes with Message "currently there exists subscriptions, please delete them first"'
+ );
+
+ $OfferModel = new Models\Request\Offer();
+ $OfferModel->setAmount(100)
+ ->setCurrency('EUR')
+ ->setInterval('2 DAY')
+ ->setName('TestOffer');
+ $OfferModelResponse = $this->_service->create($OfferModel);
+ $this->assertInstanceOf('Paymill\Models\Response\Offer', $OfferModelResponse, var_export($OfferModelResponse, true));
+
+ $PaymentModel = new Models\Request\Payment();
+ $PaymentModel->setToken("098f6bcd4621d373cade4e832627b4f6");
+ $PaymentModelResponse = $this->_service->create($PaymentModel);
+ $this->assertInstanceOf('Paymill\Models\Response\Payment', $PaymentModelResponse, var_export($PaymentModelResponse, true));
+
+ $this->_model->setClient($PaymentModelResponse->getClient())
+ ->setOffer($OfferModelResponse->getId())
+ ->setPayment($PaymentModelResponse->getId())
+ ->setCancelAtPeriodEnd(false);
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Subscription', $result, var_export($result, true));
+ $this->_service->delete($OfferModel->setId($OfferModelResponse->getId()));
+ $this->_service->delete($PaymentModel->setId($PaymentModelResponse->getId()));
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createSubscription
+ */
+ public function updateSubscription($model)
+ {
+ $this->_model->setId($model->getId())
+ ->setCancelAtPeriodEnd(true);
+ $result = $this->_service->update($this->_model);
+
+ $this->assertInstanceOf('Paymill\Models\Response\Subscription', $result, var_export($result, true));
+ $this->assertTrue($result->getCancelAtPeriodEnd());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createSubscription
+ */
+ public function getOneSubscription($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->assertInstanceOf('Paymill\Models\Response\Subscription', $result = $this->_service->getOne($this->_model), var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createSubscription
+ */
+ public function getAllSubscription()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllSubscriptionWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createSubscription
+ * @depends getOneSubscription
+ * @depends updateSubscription
+ */
+ public function deleteSubscription($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->markTestIncomplete('Subscription does not return a empty array like the other resources.');
+ $result = $this->_service->delete($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+}
diff --git a/lib/api/tests/integration/TransactionTest.php b/lib/api/tests/integration/TransactionTest.php
new file mode 100644
index 0000000..c9979ac
--- /dev/null
+++ b/lib/api/tests/integration/TransactionTest.php
@@ -0,0 +1,155 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Transaction();
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Token, Payment or Preauthorization required
+ */
+ public function createTransactionWithoutToken()
+ {
+ $this->_model->setAmount(100)
+ ->setCurrency('EUR');
+ $this->_service->create($this->_model);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createTransactionWithToken()
+ {
+ $this->_model->setAmount(100)
+ ->setCurrency('EUR')
+ ->setToken('098f6bcd4621d373cade4e832627b4f6');
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Transaction', $result);
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createTransactionWithToken
+ */
+ public function updateTransaction($model)
+ {
+ $this->_model->setId($model->getId())
+ ->setDescription('TEST');
+ $result = $this->_service->update($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Transaction', $result, var_export($result, true));
+ $this->assertEquals('TEST', $result->getDescription());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Transaction not found
+ */
+ public function updateTransactionWithWrongId()
+ {
+ $this->_model->setId('YouWillNeverFindMe404')
+ ->setDescription('TEST');
+ $this->_service->update($this->_model);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createTransactionWithToken
+ */
+ public function getOneTransaction($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->getOne($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Transaction', $result, var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createTransactionWithToken
+ */
+ public function getAllTransaction()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllTransactionWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createTransactionWithToken
+ * @depends getOneTransaction
+ * @depends updateTransaction
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Method not Found
+ */
+ public function deleteTransaction($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->_service->delete($this->_model);
+ }
+
+}
diff --git a/lib/api/tests/integration/WebhookTest.php b/lib/api/tests/integration/WebhookTest.php
new file mode 100644
index 0000000..794a9c9
--- /dev/null
+++ b/lib/api/tests/integration/WebhookTest.php
@@ -0,0 +1,147 @@
+_service = new Request();
+ $this->_service->setConnectionClass(new Curl(API_TEST_KEY));
+ $this->_model = new Models\Request\Webhook();
+ $this->_email = 'dummy@example.com';
+ $this->_url = 'http://example.com/dummyCallback';
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_service = null;
+ $this->_model = null;
+ parent::tearDown();
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createWebhookWithUrl()
+ {
+ $this->_model->setUrl('http://example.com/dummyCallback')
+ ->setEventTypes(array(
+ 'transaction.succeeded', 'subscription.created'
+ ));
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Webhook', $result, var_export($result, true));
+ return $result;
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function createWebhookWithEmail()
+ {
+ $this->_model->setEmail('dummy@example.com')
+ ->setEventTypes(array(
+ 'transaction.succeeded', 'subscription.created'
+ ));
+ $result = $this->_service->create($this->_model);
+ $this->assertInstanceOf('Paymill\Models\Response\Webhook', $result, var_export($result, true));
+ $this->deleteWebhook($result);
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createWebhookWithUrl
+ */
+ public function updateWebhook($model)
+ {
+ $this->_model->setId($model->getId())
+ ->setUrl('http://example.com/dummyCallbackUpdate');
+ $result = $this->_service->update($this->_model);
+
+ $this->assertInstanceOf('Paymill\Models\Response\Webhook', $result, var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createWebhookWithUrl
+ */
+ public function getOneWebhook($model)
+ {
+ $this->_model->setId($model->getId());
+ $this->assertInstanceOf('Paymill\Models\Response\Webhook', $result = $this->_service->getOne($this->_model), var_export($result, true));
+ $this->assertEquals($model->getId(), $result->getId());
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createWebhookWithUrl
+ */
+ public function getAllWebhook()
+ {
+ $this->_model;
+ $result = $this->_service->getAll($this->_model);
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ */
+ public function getAllWebhookWithFilter()
+ {
+ $this->_model->setFilter(array(
+ 'count' => 2,
+ 'offset' => 0
+ )
+ );
+ $result = $this->_service->getAll($this->_model);
+ $this->assertEquals(2, count($result), var_export($result, true));
+ }
+
+ /**
+ * @test
+ * @codeCoverageIgnore
+ * @depends createWebhookWithUrl
+ * @depends getOneWebhook
+ * @depends updateWebhook
+ */
+ public function deleteWebhook($model)
+ {
+ $this->_model->setId($model->getId());
+ $result = $this->_service->delete($this->_model);
+ $this->markTestIncomplete('Webhook does not return a empty array like the other resources. Returns Null instead!');
+ $this->assertInternalType('array', $result, var_export($result, true));
+ }
+
+}
diff --git a/lib/api/tests/phpunit.xml.dist b/lib/api/tests/phpunit.xml.dist
new file mode 100644
index 0000000..edcb437
--- /dev/null
+++ b/lib/api/tests/phpunit.xml.dist
@@ -0,0 +1,14 @@
+
+
+
+ ./integration
+
+
+ ./unit
+
+
+
+
+
+
+
diff --git a/lib/api/tests/unit/Paymill/API/CurlTest.php b/lib/api/tests/unit/Paymill/API/CurlTest.php
new file mode 100644
index 0000000..c2e4b58
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/API/CurlTest.php
@@ -0,0 +1,128 @@
+_curlObject = $this->getMock('Paymill\API\Curl', array('_curlExec', '_curlInfo', '_curlError'), array("TestToken"));
+ parent::setUp();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_curlObject = null;
+ parent::tearDown();
+ }
+
+
+ /**
+ * Prepares the mocked curl object to return any desired value for the given method
+ * @param string $method
+ * @param mixed $response
+ */
+ private function _setMockProperties($method, $response)
+ {
+ $this->_curlObject->expects($this->any())->method($method)->will($this->returnValue($response));
+ }
+
+ //Testmethods
+
+
+ /**
+ * Tests the requestApi function using GET as the httpMethod
+ * @test
+ */
+ public function requestApiTestGET()
+ {
+ //Desired Results
+ $responseBody = array('test' => true);
+ $responseInfo = array('http_code' => 200, 'content_type' => 'test');
+
+ $this->_setMockProperties('_curlExec', $responseBody);
+ $this->_setMockProperties('_curlInfo', $responseInfo);
+
+ //Testing method using GET
+ $result = $this->_curlObject->requestApi("", array(), 'GET');
+ $this->assertEquals(
+ array(
+ 'header' => array(
+ 'status' => $responseInfo['http_code'],
+ 'reason' => null,
+ ),
+ 'body' => $responseBody)
+ ,$result);
+ }
+
+ /**
+ * Tests the requestApi function using POST as the httpMethod
+ * @test
+ */
+ public function requestApiTestPost()
+ {
+ //Desired Results
+ $responseBody = array('test' => true);
+ $responseInfo = array('http_code' => 200, 'content_type' => 'test');
+
+ $this->_setMockProperties('_curlExec', $responseBody);
+ $this->_setMockProperties('_curlInfo', $responseInfo);
+
+ //using POST to test the else case
+ $result = $this->_curlObject->requestApi("", array(), 'POST');
+ $this->assertEquals(
+ array(
+ 'header' => array(
+ 'status' => $responseInfo['http_code'],
+ 'reason' => null,
+ ),
+ 'body' => $responseBody)
+ ,$result);
+ }
+
+ /**
+ * Tests the requestApi function triggering the error case
+ * @test
+ */
+ public function requestApiTestError()
+ {
+ //Desired Results
+ $responseBody = false;
+ $responseInfo = array('http_code' => 666, 'content_type' => 'test');
+ $responseError = array('test' => true);
+
+ $this->_setMockProperties('_curlExec', $responseBody);
+ $this->_setMockProperties('_curlInfo', $responseInfo);
+ $this->_setMockProperties('_curlError', $responseError);
+
+ //using POST to test the else case
+ $result = $this->_curlObject->requestApi("", array(), 'POST');
+ $this->assertEquals(
+ array(
+ 'header' => array(
+ 'status' => $responseInfo['http_code'],
+ 'reason' => null,
+ ),
+ 'body' => array('error' => $responseError))
+ ,$result);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/BaseTest.php b/lib/api/tests/unit/Paymill/Models/Request/BaseTest.php
new file mode 100644
index 0000000..c899b04
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/BaseTest.php
@@ -0,0 +1,67 @@
+_model = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $id = "This a weird test";
+
+ $this->_model = new Request\Client();
+ $this->_model->setId($id);
+ $this->_model->setFilter(array('count' => 1));
+
+ $this->assertEquals($this->_model->getId(), $id);
+ $this->assertEquals($this->_model->getServiceResource(), "clients/");
+ $this->assertEquals($this->_model->getFilter(), array('count' => 1));
+ return $this->_model;
+ }
+
+ /**
+ * Tests the parameter return from parameterize('getAll')
+ * @param \Paymill\Models\Request\Client $model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeGetAll($model){
+ $this->assertEquals($model->parameterize('getAll'), array('count' => 1));
+ }
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/ClientTest.php b/lib/api/tests/unit/Paymill/Models/Request/ClientTest.php
new file mode 100644
index 0000000..f4527a1
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/ClientTest.php
@@ -0,0 +1,83 @@
+_client = new Request\Client();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_client = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $email = "lovely-client@example.com";
+ $description = "Lovely Client";
+
+ $this->_client->setEmail($email)->setDescription($description);
+
+ $this->assertEquals($this->_client->getEmail(), $email);
+ $this->assertEquals($this->_client->getDescription(), $description);
+ return $this->_client;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ * @param \Paymill\Models\Request\Client $client
+ */
+ public function parameterizeTest($client)
+ {
+ $testId = "client_88a388d9dd48f86c3136";
+ $client->setId($testId);
+
+ $creationArray = $client->parameterize("create");
+ $updateArray = $client->parameterize("update");
+ $getOneArray = $client->parameterize("getOne");
+
+ $this->assertEquals($creationArray,
+ array('email' => "lovely-client@example.com", 'description' => "Lovely Client"));
+ $this->assertEquals($updateArray,
+ array(
+ 'email' => 'lovely-client@example.com',
+ 'description' => 'Lovely Client'
+ ));
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ ));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/OfferTest.php b/lib/api/tests/unit/Paymill/Models/Request/OfferTest.php
new file mode 100644
index 0000000..a2cd40b
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/OfferTest.php
@@ -0,0 +1,87 @@
+_offer = new Request\Offer();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_offer = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $amount = '4200';
+ $currency = 'EUR';
+ $interval = '1 MONTH';
+ $name = 'Test Offer';
+
+ $this->_offer->setAmount($amount)->setCurrency($currency)->setInterval($interval)->setName($name);
+
+ $this->assertEquals($this->_offer->getAmount(), $amount);
+ $this->assertEquals($this->_offer->getCurrency(), $currency);
+ $this->assertEquals($this->_offer->getInterval(), $interval);
+ $this->assertEquals($this->_offer->getName(), $name);
+
+ return $this->_offer;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($offer)
+ {
+ $testId = "offer_88a388d9dd48f86c3136";
+ $offer->setId($testId);
+
+ $creationArray = $offer->parameterize("create");
+ $updateArray = $offer->parameterize("update");
+ $getOneArray = $offer->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array(
+ 'amount' => '4200', // E.g. "4200" for 42.00 EUR
+ 'currency' => 'EUR', // ISO 4217
+ 'interval' => '1 MONTH',
+ 'name' => 'Test Offer',
+ 'trial_period_days' => null
+ ));
+ $this->assertEquals($updateArray, array('name' => $offer->getName()));
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ ));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/PaymentTest.php b/lib/api/tests/unit/Paymill/Models/Request/PaymentTest.php
new file mode 100644
index 0000000..94ca655
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/PaymentTest.php
@@ -0,0 +1,78 @@
+_payment = new Request\Payment();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_payment = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'client' => 'client_88a388d9dd48f86c3136',
+ 'token' => '098f6bcd4621d373cade4e832627b4f6'
+ );
+
+ $this->_payment->setClient($sample['client'])->setToken($sample['token']);
+
+ $this->assertEquals($this->_payment->getClient(), $sample['client']);
+ $this->assertEquals($this->_payment->getToken(), $sample['token']);
+
+ return $this->_payment;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($payment)
+ {
+ $testId = "payment_88a388d9dd48f86c3136";
+ $payment->setId($testId);
+
+ $creationArray = $payment->parameterize("create");
+ $getOneArray = $payment->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array('client' => 'client_88a388d9dd48f86c3136', 'token' => '098f6bcd4621d373cade4e832627b4f6')
+ );
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ ));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/PreauthorizationTest.php b/lib/api/tests/unit/Paymill/Models/Request/PreauthorizationTest.php
new file mode 100644
index 0000000..39248f6
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/PreauthorizationTest.php
@@ -0,0 +1,87 @@
+_preauthorization = new Request\Preauthorization();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_preauthorization = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'token' => '098f6bcd4621d373cade4e832627b4f6',
+ 'payment' => 'pay_d43cf0ee969d9847512b',
+ 'amount' => '4200',
+ 'currency' => 'EUR'
+ );
+
+ $this->_preauthorization->setPayment($sample['payment'])->setToken($sample['token'])->setAmount($sample['amount'])->setCurrency($sample['currency']);
+
+ $this->assertEquals($this->_preauthorization->getToken(), $sample['token']);
+ $this->assertEquals($this->_preauthorization->getPayment(), $sample['payment']);
+ $this->assertEquals($this->_preauthorization->getAmount(), $sample['amount']);
+ $this->assertEquals($this->_preauthorization->getCurrency(), $sample['currency']);
+
+ return $this->_preauthorization;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($preauthorization)
+ {
+ $testId = "preauthorization_88a388d9dd48f86c3136";
+ $preauthorization->setId($testId);
+
+ $creationArray = $preauthorization->parameterize("create");
+ $getOneArray = $preauthorization->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array(
+ 'payment' => 'pay_d43cf0ee969d9847512b',
+ 'amount' => '4200',
+ 'currency' => 'EUR'
+ )
+ );
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ )
+ );
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/RefundTest.php b/lib/api/tests/unit/Paymill/Models/Request/RefundTest.php
new file mode 100644
index 0000000..c2c9c02
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/RefundTest.php
@@ -0,0 +1,75 @@
+_refund = new Request\Refund();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_refund = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'amount' => '4200', // e.g. "4200" for 42.00 EUR
+ 'description' => 'Sample Description'
+ );
+
+ $this->_refund->setAmount($sample['amount'])
+ ->setDescription($sample['description']);
+
+ $this->assertEquals($this->_refund->getAmount(), $sample['amount']);
+ $this->assertEquals($this->_refund->getDescription(), $sample['description']);
+
+ return $this->_refund;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($refund)
+ {
+ $testId = "refund_88a388d9dd48f86c3136";
+ $refund->setId($testId);
+
+ $creationArray = $refund->parameterize("create");
+ $getOneArray = $refund->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array('amount' => '4200', 'description' => 'Sample Description'));
+ $this->assertEquals($getOneArray, array('count' => 1, 'offset' => 0));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/SubscriptionTest.php b/lib/api/tests/unit/Paymill/Models/Request/SubscriptionTest.php
new file mode 100644
index 0000000..1e5e369
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/SubscriptionTest.php
@@ -0,0 +1,94 @@
+_subscription = new Request\Subscription();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_subscription = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'client' => 'client_88a388d9dd48f86c3136',
+ 'offer' => 'offer_40237e20a7d5a231d99b',
+ 'payment' => 'pay_95ba26ba2c613ebb0ca8'
+ );
+
+ $this->_subscription->setPayment($sample['payment'])->setOffer($sample['offer'])->setClient($sample['client']);
+
+ $this->assertEquals($this->_subscription->getClient(), $sample['client']);
+ $this->assertEquals($this->_subscription->getOffer(), $sample['offer']);
+ $this->assertEquals($this->_subscription->getPayment(), $sample['payment']);
+
+
+ return $this->_subscription;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($subscription)
+ {
+ $testId = "subscription_88a388d9dd48f86c3136";
+ $cancelAtPeriodEnd = true;
+ $subscription->setId($testId);
+ $subscription->setCancelAtPeriodEnd($cancelAtPeriodEnd);
+
+ $creationArray = $subscription->parameterize("create");
+ $updateArray = $subscription->parameterize("update");
+ $getOneArray = $subscription->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array(
+ 'client' => 'client_88a388d9dd48f86c3136',
+ 'offer' => 'offer_40237e20a7d5a231d99b',
+ 'payment' => 'pay_95ba26ba2c613ebb0ca8',
+ 'start_at' => null
+ ));
+
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ ));
+ $this->assertEquals($updateArray, array(
+ 'cancel_at_period_end' => true,
+ 'offer' => 'offer_40237e20a7d5a231d99b',
+ 'payment' => 'pay_95ba26ba2c613ebb0ca8'
+ ));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/TransactionTest.php b/lib/api/tests/unit/Paymill/Models/Request/TransactionTest.php
new file mode 100644
index 0000000..f7562e8
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/TransactionTest.php
@@ -0,0 +1,117 @@
+_transaction = new Request\Transaction();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_transaction = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'amount' => '4200', // e.g. "4200" for 42.00 EUR
+ 'currency' => 'EUR', // ISO 4217
+ 'payment' => 'pay_2f82a672574647cd911d',
+ 'token' => '098f6bcd4621d373cade4e832627b4f6',
+ 'client' => 'client_c781b1d2f7f0f664b4d9',
+ 'preauthorization' => 'preauth_ec54f67e52e92051bd65',
+ 'fee_amount' => '420', // e.g. "420" for 4.20 EUR
+ 'fee_payment' => 'pay_098f6bcd4621d373cade4e832627b4f6',
+ 'fee_currency' => 'EUR',
+ 'description' => 'Test Transaction'
+ );
+
+ $this->_transaction
+ ->setAmount($sample['amount'])
+ ->setCurrency($sample['currency'])
+ ->setPayment($sample['payment'])
+ ->setToken($sample['token'])
+ ->setClient($sample['client'])
+ ->setPreauthorization($sample['preauthorization'])
+ ->setFeeAmount($sample['fee_amount'])
+ ->setFeePayment($sample['fee_payment'])
+ ->setFeeCurrency($sample['fee_currency'])
+ ->setDescription($sample['description']);
+
+ $this->assertEquals($this->_transaction->getAmount(), $sample['amount']);
+ $this->assertEquals($this->_transaction->getCurrency(), $sample['currency']);
+ $this->assertEquals($this->_transaction->getPayment(), $sample['payment']);
+ $this->assertEquals($this->_transaction->getToken(), $sample['token']);
+ $this->assertEquals($this->_transaction->getClient(), $sample['client']);
+ $this->assertEquals($this->_transaction->getPreauthorization(), $sample['preauthorization']);
+ $this->assertEquals($this->_transaction->getFeeAmount(), $sample['fee_amount']);
+ $this->assertEquals($this->_transaction->getFeePayment(), $sample['fee_payment']);
+ $this->assertEquals($this->_transaction->getFeeCurrency(), $sample['fee_currency']);
+ $this->assertEquals($this->_transaction->getDescription(), $sample['description']);
+
+ return $this->_transaction;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($transaction)
+ {
+ $testId = "transaction_88a388d9dd48f86c3136";
+ $transaction->setId($testId);
+
+ $creationArray = $transaction->parameterize("create");
+ $updateArray = $transaction->parameterize("update");
+ $getOneArray = $transaction->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array(
+ 'amount' => '4200', // e.g. "4200" for 42.00 EUR
+ 'currency' => 'EUR', // ISO 4217
+ 'client' => 'client_c781b1d2f7f0f664b4d9',
+ 'preauthorization' => 'preauth_ec54f67e52e92051bd65',
+ 'fee_amount' => '420', // e.g. "420" for 4.20 EUR
+ 'fee_payment' => 'pay_098f6bcd4621d373cade4e832627b4f6',
+ 'fee_currency' => 'EUR',
+ 'description' => 'Test Transaction'
+ ));
+ $this->assertEquals($updateArray, array(
+ 'description' => 'Test Transaction'
+ ));
+ $this->assertEquals($getOneArray, array(
+ 'count' => 1,
+ 'offset' => 0
+ )
+ );
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Request/WebhookTest.php b/lib/api/tests/unit/Paymill/Models/Request/WebhookTest.php
new file mode 100644
index 0000000..12cac60
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Request/WebhookTest.php
@@ -0,0 +1,87 @@
+_webhook = new Request\Webhook();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_webhook = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $sample = array(
+ 'url' => 'your-webhook-url',
+ 'email' => 'your-webhook-email',
+ 'event_types' => array('transaction.succeeded', 'subscription.created')
+ );
+
+ $this->_webhook
+ ->setUrl($sample['url'])
+ ->setEmail($sample['email'])
+ ->setEventTypes($sample['event_types']);
+
+ $this->assertEquals($this->_webhook->getUrl(), $sample['url']);
+ $this->assertEquals($this->_webhook->getEmail(), $sample['email']);
+ $this->assertEquals($this->_webhook->getEventTypes(), $sample['event_types']);
+
+ return $this->_webhook;
+ }
+
+ /**
+ * Test the Parameterize function of the model
+ * @test
+ * @depends setGetTest
+ */
+ public function parameterizeTest($webhook)
+ {
+ $testId = "webhook_88a388d9dd48f86c3136";
+ $webhook->setId($testId);
+
+ $creationArray = $webhook->parameterize("create");
+ $updateArray = $webhook->parameterize("update");
+ $getOneArray = $webhook->parameterize("getOne");
+
+ $this->assertEquals($creationArray, array(
+ 'url' => 'your-webhook-url',
+ 'event_types' => array('transaction.succeeded', 'subscription.created')
+ ));
+ $this->assertEquals($updateArray, array(
+ 'url' => 'your-webhook-url',
+ 'event_types' => array('transaction.succeeded', 'subscription.created')
+ ));
+ $this->assertEquals($getOneArray, array('count' => 1, 'offset' => 0));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/BaseTest.php b/lib/api/tests/unit/Paymill/Models/Response/BaseTest.php
new file mode 100644
index 0000000..bc1510c
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/BaseTest.php
@@ -0,0 +1,58 @@
+_payment = new Response\Payment();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_payment = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $id = "This a weird test";
+ $createdAt = 1;
+ $updatedAt = 2;
+ $appId = 1337;
+
+ $this->_payment->setId($id)->setCreatedAt($createdAt)->setUpdatedAt($updatedAt)->setAppId($appId);
+
+ $this->assertEquals($this->_payment->getId(), $id);
+ $this->assertEquals($this->_payment->getCreatedAt(), $createdAt);
+ $this->assertEquals($this->_payment->getUpdatedAt(), $updatedAt);
+ $this->assertEquals($this->_payment->getAppId(), $appId);
+ }
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/ClientTest.php b/lib/api/tests/unit/Paymill/Models/Response/ClientTest.php
new file mode 100644
index 0000000..ba44bae
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/ClientTest.php
@@ -0,0 +1,58 @@
+_client = new Response\Client();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_client = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $paymentModel = new Response\Payment();
+ $email = "lovely-client@example.com";
+ $descriptionValue = "TestDesc";
+
+ $this->_client->setEmail($email)
+ ->setDescription($descriptionValue)
+ ->setPayment($paymentModel);
+
+ $this->assertEquals($this->_client->getEmail(), $email);
+ $this->assertEquals($this->_client->getDescription(), $descriptionValue);
+ $this->assertEquals($this->_client->getPayment(), $paymentModel);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/ErrorTest.php b/lib/api/tests/unit/Paymill/Models/Response/ErrorTest.php
new file mode 100644
index 0000000..1c29adb
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/ErrorTest.php
@@ -0,0 +1,50 @@
+setErrorMessage($errorMessage);
+ $errorModel->setHttpStatusCode($httpStatusCode);
+ $errorModel->setResponseCode($responseCode);
+
+ $this->assertEquals($errorMessage, $errorModel->getErrorMessage());
+ $this->assertEquals($httpStatusCode, $errorModel->getHttpStatusCode());
+ $this->assertEquals($responseCode, $errorModel->getResponseCode());
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/OfferTest.php b/lib/api/tests/unit/Paymill/Models/Response/OfferTest.php
new file mode 100644
index 0000000..8dd1a00
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/OfferTest.php
@@ -0,0 +1,68 @@
+_offer = new Response\Offer();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_offer = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $name = "Testoffer";
+ $amount = 4200;
+ $currency = "EUR";
+ $interval = "1 WEEK";
+ $trialPeriodDays = 0;
+ $active = 3;
+ $inactive = 0;
+
+ $this->_offer->setName($name)->
+ setAmount($amount)->
+ setCurrency($currency)->
+ setInterval($interval)->
+ setTrialPeriodDays($trialPeriodDays)->
+ setSubscriptionCount($active, $inactive);
+
+ $this->assertEquals($this->_offer->getName(), $name);
+ $this->assertEquals($this->_offer->getAmount(), $amount);
+ $this->assertEquals($this->_offer->getCurrency(), $currency);
+ $this->assertEquals($this->_offer->getInterval(), $interval);
+ $this->assertEquals($this->_offer->getTrialPeriodDays(), $trialPeriodDays);
+ $this->assertEquals($this->_offer->getSubscriptionCount(), array('active' => $active, 'inactive' => $inactive));
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/PaymentTest.php b/lib/api/tests/unit/Paymill/Models/Response/PaymentTest.php
new file mode 100644
index 0000000..a86d831
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/PaymentTest.php
@@ -0,0 +1,90 @@
+_payment = new Response\Payment();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_payment = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $type = "Test";
+ $client = "Test";
+ $cardType = "Test";
+ $country = "Test";
+ $expireMonth = 1;
+ $expireYear = 2;
+ $cardHolder = "Test";
+ $lastFour = "Test";
+ $code = "Test";
+ $account = "Test";
+ $holder = "Test";
+ $iban = "Test";
+ $bic = "Test";
+
+
+ $this->_payment->setType($type)
+ ->setClient($client)
+ ->setCardType($cardType)
+ ->setCountry($country)
+ ->setExpireMonth($expireMonth)
+ ->setExpireYear($expireYear)
+ ->setCardHolder($cardHolder)
+ ->setLastFour($lastFour)
+ ->setCode($code)
+ ->setAccount($account)
+ ->setHolder($holder)
+ ->setIban($iban)
+ ->setBic($bic);
+
+
+ $this->assertEquals($this->_payment->getType(),$type);
+ $this->assertEquals($this->_payment->getClient(),$client);
+ $this->assertEquals($this->_payment->getCardType(),$cardType);
+ $this->assertEquals($this->_payment->getCountry(),$country);
+ $this->assertEquals($this->_payment->getExpireMonth(),$expireMonth);
+ $this->assertEquals($this->_payment->getExpireYear(),$expireYear);
+ $this->assertEquals($this->_payment->getCardHolder(),$cardHolder);
+ $this->assertEquals($this->_payment->getLastFour(),$lastFour);
+ $this->assertEquals($this->_payment->getCode(),$code);
+ $this->assertEquals($this->_payment->getAccount(),$account);
+ $this->assertEquals($this->_payment->getHolder(),$holder);
+ $this->assertEquals($this->_payment->getBic(),$bic);
+ $this->assertEquals($this->_payment->getIban(),$iban);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/PreauthorizationTest.php b/lib/api/tests/unit/Paymill/Models/Response/PreauthorizationTest.php
new file mode 100644
index 0000000..b8dc745
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/PreauthorizationTest.php
@@ -0,0 +1,67 @@
+_preauthorization = new Response\Preauthorization();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_preauthorization = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $amount = "4200";
+ $currency = "EUR";
+ $status = "closed";
+ $livemode = false;
+ $payment = new Response\Payment();
+ $client = new Response\Client();
+
+ $this->_preauthorization->setAmount($amount)
+ ->setCurrency($currency)
+ ->setStatus($status)
+ ->setLivemode($livemode)
+ ->setPayment($payment)
+ ->setClient($client);
+
+ $this->assertEquals($this->_preauthorization->getAmount(), $amount);
+ $this->assertEquals($this->_preauthorization->getCurrency(), $currency);
+ $this->assertEquals($this->_preauthorization->getStatus(), $status);
+ $this->assertEquals($this->_preauthorization->getLivemode(), $livemode);
+ $this->assertEquals($this->_preauthorization->getPayment(), $payment);
+ $this->assertEquals($this->_preauthorization->getClient(), $client);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/RefundTest.php b/lib/api/tests/unit/Paymill/Models/Response/RefundTest.php
new file mode 100644
index 0000000..09b4d26
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/RefundTest.php
@@ -0,0 +1,67 @@
+_refund = new Response\Refund();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_refund = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $amount = "010";
+ $status = "closed";
+ $description = "Test Description";
+ $livemode = false;
+ $responseCode = 20000;
+ $transaction = new Response\Transaction();
+
+ $this->_refund->setAmount($amount)
+ ->setStatus($status)
+ ->setDescription($description)
+ ->setLivemode($livemode)
+ ->setResponseCode($responseCode)
+ ->setTransaction($transaction);
+
+ $this->assertEquals($this->_refund->getAmount(), $amount);
+ $this->assertEquals($this->_refund->getStatus(), $status);
+ $this->assertEquals($this->_refund->getDescription(), $description);
+ $this->assertEquals($this->_refund->getLivemode(), $livemode);
+ $this->assertEquals($this->_refund->getResponseCode(), $responseCode);
+ $this->assertEquals($this->_refund->getTransaction(), $transaction);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/SubscriptionTest.php b/lib/api/tests/unit/Paymill/Models/Response/SubscriptionTest.php
new file mode 100644
index 0000000..d696ba2
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/SubscriptionTest.php
@@ -0,0 +1,76 @@
+_subscription = new Response\Subscription();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_subscription = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $offer = new Response\Offer();
+ $liveMode = false;
+ $cancelAtPeriodEnd = false;
+ $trialStart = null;
+ $trialEnd = null;
+ $nextCaptureAt = 1369563095;
+ $canceledAt = null;
+ $payment = new Response\Payment();
+ $client = new Response\Client();
+
+ $this->_subscription->setOffer($offer)
+ ->setLivemode($liveMode)
+ ->setCancelAtPeriodEnd($cancelAtPeriodEnd)
+ ->setTrialStart($trialStart)
+ ->setTrialEnd($trialEnd)
+ ->setNextCaptureAt($nextCaptureAt)
+ ->setCanceledAt($canceledAt)
+ ->setClient($client)
+ ->setPayment($payment);
+
+ $this->assertEquals($this->_subscription->getOffer(), $offer);
+ $this->assertEquals($this->_subscription->getLivemode(), $liveMode);
+ $this->assertEquals($this->_subscription->getCancelAtPeriodEnd(), $cancelAtPeriodEnd);
+ $this->assertEquals($this->_subscription->getTrialStart(), $trialStart);
+ $this->assertEquals($this->_subscription->getTrialEnd(), $trialEnd);
+ $this->assertEquals($this->_subscription->getNextCaptureAt(), $nextCaptureAt);
+ $this->assertEquals($this->_subscription->getCanceledAt(), $canceledAt);
+ $this->assertEquals($this->_subscription->getClient(), $client);
+ $this->assertEquals($this->_subscription->getPayment(), $payment);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/TransactionTest.php b/lib/api/tests/unit/Paymill/Models/Response/TransactionTest.php
new file mode 100644
index 0000000..9257003
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/TransactionTest.php
@@ -0,0 +1,91 @@
+_transaction = new Response\Transaction();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_transaction = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $amount = "4200";
+ $originAmount = 4200;
+ $status = "closed";
+ $description = "Test Desc";
+ $livemode = false;
+ $refunds = null;
+ $currency = "EUR";
+ $responseCode = 200000;
+ $shortId = "This is a short string?!";
+ $invoices = array();
+ $payment = new Response\Payment();
+ $client = new Response\Client();
+ $preAuth = new Response\Preauthorization();
+ $fees = array();
+
+ $this->_transaction->setAmount($amount)
+ ->setOriginAmount($originAmount)
+ ->setStatus($status)
+ ->setDescription($description)
+ ->setLivemode($livemode)
+ ->setRefunds($refunds)
+ ->setCurrency($currency)
+ ->setResponseCode($responseCode)
+ ->setShortId($shortId)
+ ->setInvoices($invoices)
+ ->setPayment($payment)
+ ->setClient($client)
+ ->setPreauthorization($preAuth)
+ ->setFees($fees);
+
+ $this->assertEquals($this->_transaction->getAmount(), $amount);
+ $this->assertEquals($this->_transaction->getOriginAmount(), $originAmount);
+ $this->assertEquals($this->_transaction->getStatus(), $status);
+ $this->assertEquals($this->_transaction->getDescription(), $description);
+ $this->assertEquals($this->_transaction->getLivemode(), $livemode);
+ $this->assertEquals($this->_transaction->getRefunds(), $refunds);
+ $this->assertEquals($this->_transaction->getCurrency(), $currency);
+ $this->assertEquals($this->_transaction->getResponseCode(), $responseCode);
+ $this->assertEquals($this->_transaction->getShortId(), $shortId);
+ $this->assertEquals($this->_transaction->getInvoices(), $invoices);
+ $this->assertEquals($this->_transaction->getPayment(), $payment);
+ $this->assertEquals($this->_transaction->getClient(), $client);
+ $this->assertEquals($this->_transaction->getPreauthorization(), $preAuth);
+ $this->assertEquals($this->_transaction->getFees(), $fees);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Models/Response/WebhookTest.php b/lib/api/tests/unit/Paymill/Models/Response/WebhookTest.php
new file mode 100644
index 0000000..41b560a
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Models/Response/WebhookTest.php
@@ -0,0 +1,65 @@
+_webhook = new Response\Webhook();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_webhook = null;
+ parent::tearDown();
+ }
+
+ //Testmethods
+ /**
+ * Tests the getters and setters of the model
+ * @test
+ */
+ public function setGetTest()
+ {
+ $url = "www.test.ing";
+ $email = "test@test.ing";
+ $livemode = false;
+ $eventTypes = array(
+ "transaction.succeeded",
+ "transaction.failed"
+ );
+
+
+ $this->_webhook->setUrl($url)
+ ->setEmail($email)
+ ->setLivemode($livemode)
+ ->setEventTypes($eventTypes);
+
+ $this->assertEquals($this->_webhook->getUrl(), $url);
+ $this->assertEquals($this->_webhook->getEmail(), $email);
+ $this->assertEquals($this->_webhook->getLivemode(), $livemode);
+ $this->assertEquals($this->_webhook->getEventTypes(), $eventTypes);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Services/RequestTest.php b/lib/api/tests/unit/Paymill/Services/RequestTest.php
new file mode 100644
index 0000000..2f71cec
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Services/RequestTest.php
@@ -0,0 +1,502 @@
+_request = new RequestService();
+ $this->_client = new Request\Client();
+ $this->_curlObjectMock = $this->getMock('Paymill\API\Curl', array('requestApi'), array("TestToken"));
+ $this->_request->setSource("UNITTEST");
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_request = null;
+ $this->_client = null;
+ parent::tearDown();
+ }
+
+ /**
+ * Test the setter for the connection class
+ * @test
+ */
+ public function setConnectionClassTest()
+ {
+ $connector = new Curl("This connector will never be used.");
+ $request = $this->_request->setConnectionClass($connector);
+ $this->assertEquals($request, $this->_request);
+ }
+
+ /**
+ * Test the setter for the connection class
+ * @test
+ */
+ public function setConnectionClassWithinConstructorTest()
+ {
+ $this->_request = new RequestService("TestToken");
+ $this->assertInstanceOf('Paymill\Request', $this->_request);
+ }
+
+ /**
+ * Test the setter for the connection class
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage The connenction class is missing!
+ */
+ public function missingConnectionClassTest()
+ {
+ $this->_request = new RequestService();
+ $this->_request->getOne($this->_client);
+ }
+
+ /**
+ * Tests the create request method
+ * @test
+ */
+ public function createTest()
+ {
+ $inputArray = array(
+ 'email' => "max.mustermann@example.com",
+ 'description' => "Lovely Client"
+ );
+ $inputModel = $this->_client->setEmail($inputArray['email'])->setDescription($inputArray['description']);
+ $outputArray = array();
+ $outputArray['header']['status'] = 200;
+ $outputArray['body']['data'] = array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => "Lovely Client",
+ "created_at" => 1342438695,
+ "updated_at" => 1342438695,
+ "payment" => array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "creditcard",
+ "client" => "client_88a388d9dd48f86c3136",
+ "card_type" => "visa",
+ "country" => null,
+ "expire_month" => 10,
+ "expire_year" => 2013,
+ "card_holder" => null,
+ "last4" => "1111",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ ),
+ "subscription" => null,
+ "app_id" => null
+ );
+ $paymentModel = new Response\Payment();
+ $paymentModel->setId($outputArray['body']['data']['payment']['id'])
+ ->setType($outputArray['body']['data']['payment']['type'])
+ ->setClient($outputArray['body']['data']['payment']['client'])
+ ->setCardType($outputArray['body']['data']['payment']['card_type'])
+ ->setCountry($outputArray['body']['data']['payment']['country'])
+ ->setExpireMonth($outputArray['body']['data']['payment']['expire_month'])
+ ->setExpireYear($outputArray['body']['data']['payment']['expire_year'])
+ ->setCardHolder($outputArray['body']['data']['payment']['card_holder'])
+ ->setLastFour($outputArray['body']['data']['payment']['last4'])
+ ->setCreatedAt($outputArray['body']['data']['payment']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['payment']['updated_at'])
+ ->setAppId($outputArray['body']['data']['payment']['app_id']);
+ $outputModel = new Response\Client();
+ $outputModel->setId($outputArray['body']['data']['id'])
+ ->setEmail($outputArray['body']['data']['email'])
+ ->setDescription($outputArray['body']['data']['description'])
+ ->setCreatedAt($outputArray['body']['data']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['updated_at'])
+ ->setPayment($paymentModel)
+ ->setSubscription($outputArray['body']['data']['subscription'])
+ ->setAppId($outputArray['body']['data']['app_id']);
+
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $inputArray, "POST", $outputArray
+ );
+
+ $this->assertEquals($outputModel, $this->_request->create($inputModel));
+ return $this->_client;
+ }
+
+ /**
+ * Tests the update request method
+ * @test
+ */
+ public function updateTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 200;
+ $outputArray['body']['data'] = array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => null,
+ "description" => "Lovely Client",
+ "created_at" => 1342438695,
+ "updated_at" => 1342438695,
+ "payment" => array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "creditcard",
+ "client" => "client_88a388d9dd48f86c3136",
+ "card_type" => "visa",
+ "country" => null,
+ "expire_month" => 10,
+ "expire_year" => 2013,
+ "card_holder" => null,
+ "last4" => "1111",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ ),
+ "subscription" => null,
+ "app_id" => null
+ );
+ $paymentModel = new Response\Payment();
+ $paymentModel->setId($outputArray['body']['data']['payment']['id'])
+ ->setType($outputArray['body']['data']['payment']['type'])
+ ->setClient($outputArray['body']['data']['payment']['client'])
+ ->setCardType($outputArray['body']['data']['payment']['card_type'])
+ ->setCountry($outputArray['body']['data']['payment']['country'])
+ ->setExpireMonth($outputArray['body']['data']['payment']['expire_month'])
+ ->setExpireYear($outputArray['body']['data']['payment']['expire_year'])
+ ->setCardHolder($outputArray['body']['data']['payment']['card_holder'])
+ ->setLastFour($outputArray['body']['data']['payment']['last4'])
+ ->setCreatedAt($outputArray['body']['data']['payment']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['payment']['updated_at'])
+ ->setAppId($outputArray['body']['data']['payment']['app_id']);
+ $outputModel = new Response\Client();
+ $outputModel->setId($outputArray['body']['data']['id'])
+ ->setEmail($outputArray['body']['data']['email'])
+ ->setDescription($outputArray['body']['data']['description'])
+ ->setCreatedAt($outputArray['body']['data']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['updated_at'])
+ ->setPayment($paymentModel)
+ ->setSubscription($outputArray['body']['data']['subscription'])
+ ->setAppId($outputArray['body']['data']['app_id']);
+
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("update"), "PUT", $outputArray
+ );
+
+ $this->_client->setEmail(null);
+
+ $this->_client = $this->_request->update($this->_client);
+ $this->assertEquals($outputModel, $this->_client);
+ return $this->_client;
+ }
+
+ /**
+ * Tests the delete request method
+ * @test
+ * @depends updateTest
+ */
+ public function deleteTest($client)
+ {
+
+ $inputModel = new Request\Client();
+ $inputModel->setId($client->getId());
+ $outputArray = array();
+ $outputArray['header']['status'] = 200;
+ $outputArray['body']['data'] = array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => null,
+ "description" => "Lovely Client",
+ "created_at" => 1342438695,
+ "updated_at" => 1342438695,
+ "payment" => array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "creditcard",
+ "client" => "client_88a388d9dd48f86c3136",
+ "card_type" => "visa",
+ "country" => null,
+ "expire_month" => 10,
+ "expire_year" => 2013,
+ "card_holder" => null,
+ "last4" => "1111",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ ),
+ "subscription" => null,
+ "app_id" => null
+ );
+
+ $paymentModel = new Response\Payment();
+ $paymentModel->setId($outputArray['body']['data']['payment']['id'])
+ ->setType($outputArray['body']['data']['payment']['type'])
+ ->setClient($outputArray['body']['data']['payment']['client'])
+ ->setCardType($outputArray['body']['data']['payment']['card_type'])
+ ->setCountry($outputArray['body']['data']['payment']['country'])
+ ->setExpireMonth($outputArray['body']['data']['payment']['expire_month'])
+ ->setExpireYear($outputArray['body']['data']['payment']['expire_year'])
+ ->setCardHolder($outputArray['body']['data']['payment']['card_holder'])
+ ->setLastFour($outputArray['body']['data']['payment']['last4'])
+ ->setCreatedAt($outputArray['body']['data']['payment']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['payment']['updated_at'])
+ ->setAppId($outputArray['body']['data']['payment']['app_id']);
+ $outputModel = new Response\Client();
+ $outputModel->setId($outputArray['body']['data']['id'])
+ ->setEmail($outputArray['body']['data']['email'])
+ ->setDescription($outputArray['body']['data']['description'])
+ ->setCreatedAt($outputArray['body']['data']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['updated_at'])
+ ->setPayment($paymentModel)
+ ->setSubscription($outputArray['body']['data']['subscription'])
+ ->setAppId($outputArray['body']['data']['app_id']);
+
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("delete"), "DELETE", $outputArray
+ );
+
+ $this->_client = $this->_request->delete($inputModel);
+ $this->assertEquals($outputModel, $this->_client);
+ return $this->_client;
+ }
+
+ /**
+ * Tests the getAll request method
+ * @test
+ */
+ public function getAllTest()
+ {
+ $outputArray['header']['status'] = 200;
+ $outputArray['body']['data'] = null;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("getAll"), "GET", $outputArray
+ );
+ $result = $this->_request->getAll($this->_client);
+ $this->assertEquals($result, null);
+ }
+
+ /**
+ * Tests the getOne request method
+ * @test
+ * @depends createTest
+ */
+ public function getOneTest($client)
+ {
+
+ $outputArray = array();
+ $outputArray['header']['status'] = 200;
+ $outputArray['body']['data'] = array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => "Lovely Client",
+ "created_at" => 1342438695,
+ "updated_at" => 1342438695,
+ "payment" => array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "creditcard",
+ "client" => "client_88a388d9dd48f86c3136",
+ "card_type" => "visa",
+ "country" => null,
+ "expire_month" => 10,
+ "expire_year" => 2013,
+ "card_holder" => null,
+ "last4" => "1111",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ ),
+ "subscription" => null,
+ "app_id" => null
+ );
+
+ $paymentModel = new Response\Payment();
+ $paymentModel->setId($outputArray['body']['data']['payment']['id'])
+ ->setType($outputArray['body']['data']['payment']['type'])
+ ->setClient($outputArray['body']['data']['payment']['client'])
+ ->setCardType($outputArray['body']['data']['payment']['card_type'])
+ ->setCountry($outputArray['body']['data']['payment']['country'])
+ ->setExpireMonth($outputArray['body']['data']['payment']['expire_month'])
+ ->setExpireYear($outputArray['body']['data']['payment']['expire_year'])
+ ->setCardHolder($outputArray['body']['data']['payment']['card_holder'])
+ ->setLastFour($outputArray['body']['data']['payment']['last4'])
+ ->setCreatedAt($outputArray['body']['data']['payment']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['payment']['updated_at'])
+ ->setAppId($outputArray['body']['data']['payment']['app_id']);
+ $outputModel = new Response\Client();
+ $outputModel->setId($outputArray['body']['data']['id'])
+ ->setEmail($outputArray['body']['data']['email'])
+ ->setDescription($outputArray['body']['data']['description'])
+ ->setCreatedAt($outputArray['body']['data']['created_at'])
+ ->setUpdatedAt($outputArray['body']['data']['updated_at'])
+ ->setPayment($paymentModel)
+ ->setSubscription($outputArray['body']['data']['subscription'])
+ ->setAppId($outputArray['body']['data']['app_id']);
+
+ $this->_getCurlMock(
+ $client->getServiceResource() . $client->getId(), $client->parameterize("getOne"), "GET", $outputArray
+ );
+
+ $this->_client = $this->_request->getOne($client);
+ $this->assertEquals($outputModel, $this->_client);
+ return $this->_request;
+ }
+
+ /**
+ * Tests the exception trigger in the create request method
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Undefined Error. This should not happen!
+ */
+ public function createExceptionTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 500;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("create"), "POST", $outputArray
+ );
+
+ $this->_client = $this->_request->create($this->_client);
+ }
+
+ /**
+ * Tests the exception trigger in the update request method
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Undefined Error. This should not happen!
+ */
+ public function updateExceptionTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 500;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("update"), "PUT", $outputArray
+ );
+
+ $this->_client = $this->_request->update($this->_client);
+ }
+
+ /**
+ * Tests the exception trigger in the delete request method
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Undefined Error. This should not happen!
+ */
+ public function deleteExceptionTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 500;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("delete"), "DELETE", $outputArray
+ );
+
+ $this->_client = $this->_request->delete($this->_client);
+ }
+
+ /**
+ * Tests the exception trigger in the getAll request method
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Undefined Error. This should not happen!
+ */
+ public function getAllExceptionTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 666;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("getAll"), "GET", $outputArray
+ );
+
+ $this->_client = $this->_request->getAll($this->_client);
+ }
+
+
+ /**
+ * Tests the exception trigger in the getOne request method
+ * @test
+ * @expectedException \Paymill\Services\PaymillException
+ * @expectedExceptionMessage Undefined Error. This should not happen!
+ */
+ public function getOneExceptionTest()
+ {
+ $outputArray = array();
+ $outputArray['header']['status'] = 500;
+ $this->_getCurlMock(
+ $this->_client->getServiceResource() . $this->_client->getId(), $this->_client->parameterize("getOne"), "GET", $outputArray
+ );
+
+ $this->_client = $this->_request->getOne($this->_client);
+ }
+
+ /**
+ * Tests the getter for the last response array
+ * @test
+ * @param Request $request
+ * @depends getOneTest
+ */
+ public function getLastResponseTest($request)
+ {
+ $result = $request->getLastResponse();
+ $this->assertInternalType("array", $result);
+ }
+
+ /**
+ * Tests the getter for the last response array
+ * @test
+ * @param Request $request
+ * @depends getOneTest
+ */
+ public function getLastRequestTest($request)
+ {
+ $result = $request->getLastRequest();
+ $this->assertInternalType("array", $result);
+ $this->assertArrayHasKey("count", $result);
+ $this->assertArrayHasKey("offset", $result);
+ }
+
+ /**
+ * Returns a mocked Curl Object
+ * @param string $action Api Action
+ * @param array $params Param Array for the action call
+ * @param string $method httpMethod
+ * @param array $response Array returned by the function
+ * @return array Response Array
+ */
+ private function _getCurlMock($action, $params, $method, $response)
+ {
+ $this->_curlObjectMock->expects($this->any())
+ ->method('requestApi')
+ ->with(
+ $this->stringContains($action), $this->equalTo($params), $this->matches($method)
+ )
+ ->will($this->returnValue($response));
+ $this->_request->setConnectionClass($this->_curlObjectMock);
+ return $this->_curlObjectMock;
+ }
+
+}
\ No newline at end of file
diff --git a/lib/api/tests/unit/Paymill/Services/ResponseHandlerTest.php b/lib/api/tests/unit/Paymill/Services/ResponseHandlerTest.php
new file mode 100644
index 0000000..c112a4e
--- /dev/null
+++ b/lib/api/tests/unit/Paymill/Services/ResponseHandlerTest.php
@@ -0,0 +1,684 @@
+ "General undefined response.",
+ 10002 => "Still waiting on something.",
+ 20000 => "General success response.",
+ 40000 => "General problem with data.",
+ 40001 => "General problem with payment data.",
+ 40100 => "Problem with credit card data.",
+ 40101 => "Problem with cvv.",
+ 40102 => "Card expired or not yet valid.",
+ 40103 => "Limit exceeded.",
+ 40104 => "Card invalid.",
+ 40105 => "Expiry date not valid.",
+ 40106 => "Credit card brand required.",
+ 40200 => "Problem with bank account data.",
+ 40201 => "Bank account data combination mismatch.",
+ 40202 => "User authentication failed.",
+ 40300 => "Problem with 3d secure data.",
+ 40301 => "Currency / amount mismatch",
+ 40400 => "Problem with input data.",
+ 40401 => "Amount too low or zero.",
+ 40402 => "Usage field too long.",
+ 40403 => "Currency not allowed.",
+ 50000 => "General problem with backend.",
+ 50001 => "Country blacklisted.",
+ 50100 => "Technical error with credit card.",
+ 50101 => "Error limit exceeded.",
+ 50102 => "Card declined by authorization system.",
+ 50103 => "Manipulation or stolen card.",
+ 50104 => "Card restricted.",
+ 50105 => "Invalid card configuration data.",
+ 50200 => "Technical error with bank account.",
+ 50201 => "Card blacklisted.",
+ 50300 => "Technical error with 3D secure.",
+ 50400 => "Decline because of risk issues.",
+ 50500 => "General timeout.",
+ 50501 => "Timeout on side of the acquirer.",
+ 50502 => "Risk management transaction timeout.",
+ 50600 => "Duplicate transaction.",
+ );
+
+ /**
+ *
+ * @var \Paymill\Services\ResponseHandler
+ */
+ private $_responseHandler;
+
+ /**
+ * Prepares the environment before running a test.
+ */
+ protected function setUp()
+ {
+ parent::setUp();
+ $this->_responseHandler = new ResponseHandler();
+ }
+
+ /**
+ * Cleans up the environment after running a test.
+ */
+ protected function tearDown()
+ {
+ $this->_responseHandler = null;
+ parent::tearDown();
+ }
+
+ /**
+ * Tests the convertResponseModel method with the client model as outcome
+ * @test
+ */
+ public function clientTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "subscription" => null,
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "clients/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Client", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the client model as outcome using a client with multiple payment objects
+ * @test
+ */
+ public function clientMultiPaymentTest()
+ {
+ $response = array();
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ 'id' => "client_018dcaf0d8d03dde3ff6",
+ 'email' => "Some@Testemail.de",
+ 'description' => "This is a Testuser.123",
+ 'created_at' => 1378472311,
+ 'updated_at' => 1378472311,
+ 'app_id' => null,
+ 'payment' => array(
+ array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ), array
+ (
+ 'id' => "pay_8ff8fb0e864ea55b8b2eb876",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472406,
+ 'updated_at' => 1378472407,
+ 'app_id' => null
+ )
+ ),
+ 'subscription' => null);
+
+ $subject = $this->_responseHandler->convertResponse($response, "clients/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Client", $subject, var_export($subject, true));
+ $this->assertInternalType("array", $subject->getPayment(), var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the payment model as outcome
+ * @test
+ */
+ public function paymentCCTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "creditcard",
+ "client" => null,
+ "card_type" => "visa",
+ "country" => null,
+ "expire_month" => 10,
+ "expire_year" => 2013,
+ "card_holder" => null,
+ "last4" => "1111",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "payments/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Payment", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the payment model as outcome
+ * @test
+ */
+ public function paymentSEPATest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "pay_3af44644dd6d25c820a8",
+ "type" => "debit",
+ "client" => null,
+ "code" => "70090100",
+ "account" => "******7890",
+ "iban" => "DE0870090100******7890",
+ "bic" => "DEUTDEDB110",
+ "holder" => "test",
+ "created_at" => 1349942085,
+ "updated_at" => 1349942085,
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "payments/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Payment", $subject, var_export($subject, true));
+ $this->assertEquals("DE0870090100******7890", $subject->getIban());
+ $this->assertEquals("DEUTDEDB110", $subject->getBic());
+ }
+
+ /**
+ * Tests the convertResponseModel method with the transaction model as outcome
+ * @test
+ */
+ public function transactionTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "tran_54645bcb98ba7acfe204",
+ "amount" => "4200",
+ "origin_amount" => 4200,
+ "status" => "closed",
+ "description" => null,
+ "livemode" => false,
+ "refunds" => null,
+ "currency" => "EUR",
+ "created_at" => 1349946151,
+ "updated_at" => 1349946151,
+ "response_code" => 20000,
+ "short_id" => '0000.1212.3434',
+ "invoices" => array(),
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "client" => array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "subscription" => null,
+ 'app_id' => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ )),
+ "preauthorization" => null,
+ "fees" => array(),
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "transactions/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Transaction", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the preauthorization model as outcome
+ * @test
+ */
+ public function preauthorizationTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "tran_54645bcb98ba7acfe204",
+ "amount" => "4200",
+ "origin_amount" => 4200,
+ "status" => "closed",
+ "description" => null,
+ "livemode" => false,
+ "refunds" => null,
+ "currency" => "EUR",
+ "created_at" => 1349946151,
+ "updated_at" => 1349946151,
+ "response_code" => 20000,
+ "short_id" => '0000.1212.3434',
+ "invoices" => array(),
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "client" => array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "subscription" => null,
+ 'app_id' => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ )),
+ "preauthorization" => array(
+ "id" => "preauth_0b771c503680c341548e",
+ "amount" => "4200",
+ "currency" => "EUR",
+ "status" => "closed",
+ "livemode" => false,
+ "created_at" => 1349950324,
+ "updated_at" => 1349950324,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "client" => array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "subscription" => null,
+ 'app_id' => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ )),
+ "app_id" => null
+ ),
+ "fees" => array(),
+ "app_id" => null
+ );
+
+ $subject = $this->_responseHandler->convertResponse($response, "preauthorizations/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Preauthorization", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the refund model as outcome
+ * @test
+ */
+ public function refundTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "refund_87bc404a95d5ce616049",
+ "amount" => "042",
+ "status" => "refunded",
+ "description" => null,
+ "livemode" => false,
+ "created_at" => 1349947042,
+ "updated_at" => 1349947042,
+ "response_code" => 20000,
+ "transaction" => array(
+ "id" => "tran_54645bcb98ba7acfe204",
+ "amount" => "4200",
+ "origin_amount" => 4200,
+ "status" => "closed",
+ "description" => null,
+ "livemode" => false,
+ "refunds" => null,
+ "currency" => "EUR",
+ "created_at" => 1349946151,
+ "updated_at" => 1349946151,
+ "response_code" => 20000,
+ "short_id" => '0000.1212.3434',
+ "invoices" => array(),
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "client" => array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "subscription" => null,
+ 'app_id' => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ )),
+ "preauthorization" => null,
+ "fees" => array(),
+ "app_id" => null
+ ),
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "refunds/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Refund", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the offer model as outcome
+ * @test
+ */
+ public function offerTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "offer_40237e20a7d5a231d99b",
+ "name" => "Nerd Special",
+ "amount" => 4200,
+ "currency" => "EUR",
+ "interval" => "1 WEEK",
+ "trial_period_days" => 0,
+ "created_at" => 1341935129,
+ "updated_at" => 1341935129,
+ "subscription_count" => array(
+ "active" => "3",
+ "inactive" => 0
+ ),
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "offers/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Offer", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the subscription model as outcome
+ * @test
+ */
+ public function subscriptionTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "sub_012db05186ccfe22d86c",
+ "offer" => array(
+ "id" => "offer_40237e20a7d5a231d99b",
+ "name" => "Nerd Special",
+ "amount" => 4200,
+ "currency" => "EUR",
+ "interval" => "1 WEEK",
+ "trial_period_days" => 0,
+ "created_at" => 1341935129,
+ "updated_at" => 1341935129,
+ "subscription_count" => array(
+ "active" => "3",
+ "inactive" => 0
+ ),
+ "app_id" => null
+ ),
+ "livemode" => false,
+ "cancel_at_period_end" => false,
+ "trial_start" => null,
+ "trial_end" => null,
+ "next_capture_at" => 1369563095,
+ "created_at" => 1341935490,
+ "updated_at" => 1341935490,
+ "canceled_at" => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ ),
+ "client" => array(
+ "id" => "client_88a388d9dd48f86c3136",
+ "email" => "lovely-client@example.com",
+ "description" => null,
+ "created_at" => 1340199740,
+ "updated_at" => 1340199760,
+ "subscription" => null,
+ 'app_id' => null,
+ "payment" => array(
+ 'id' => "pay_be64260ee1b0a368efe597e8",
+ 'type' => "creditcard",
+ 'client' => "client_018dcaf0d8d03dde3ff6",
+ 'card_type' => "visa",
+ 'country' => null,
+ 'expire_month' => 12,
+ 'expire_year' => 2015,
+ 'card_holder' => null,
+ 'last4' => 1111,
+ 'created_at' => 1378472387,
+ 'updated_at' => 1378472387,
+ 'app_id' => null
+ )),
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "subscriptions/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Subscription", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the url version of the Webhook model as outcome
+ * @test
+ */
+ public function urlWebhookTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "hook_40237e20a7d5a231d99b",
+ "url" => "your-webhook-url",
+ "livemode" => false,
+ "event_types" => array(
+ "transaction.succeeded",
+ "transaction.failed"
+ ),
+ "created_at" => 1358982000,
+ "updated_at" => 1358982000,
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "webhooks/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Webhook", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the convertResponseModel method with the email version of the Webhook model as outcome
+ * @test
+ */
+ public function emailWebhookTest()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "hook_40237e20a7d5a231d99b",
+ "email" => "your-webhook-email",
+ "livemode" => false,
+ "event_types" => array(
+ "transaction.succeeded",
+ "transaction.failed"
+ ),
+ "created_at" => 1358982000,
+ "updated_at" => 1358982000,
+ "app_id" => null
+ );
+ $subject = $this->_responseHandler->convertResponse($response, "webhooks/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Webhook", $subject, var_export($subject, true));
+ }
+
+ /**
+ * Tests the handling of ResponseCodes
+ * @test
+ */
+ public function checkResponseCodes()
+ {
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "tran_54645bcb98ba7acfe204",
+ "amount" => "4200",
+ "origin_amount" => 4200,
+ "status" => "closed",
+ "description" => null,
+ "livemode" => false,
+ "refunds" => null,
+ "currency" => "EUR",
+ "created_at" => 1349946151,
+ "updated_at" => 1349946151,
+ "short_id" => '0000.1212.3434',
+ "invoices" => array(),
+ "payment" => new Models\Response\Payment(),
+ "client" => new Models\Response\Client(),
+ "preauthorization" => null,
+ "fees" => array(),
+ "app_id" => null
+ );
+
+ foreach ($this->_errorCodes as $responseCode => $errorMessage) {
+ if ($responseCode === 20000) {
+ continue;
+ }
+ $response['body']['data']['response_code'] = $responseCode;
+ $subject = $this->_responseHandler->convertResponse($response, "transactions/");
+ $this->assertInstanceOf("\Paymill\Models\Response\Error", $subject);
+ $this->assertEquals($responseCode, $subject->getResponseCode(), "ResponseCode:" . $responseCode . "==" . $subject->getResponseCode() . "\n");
+ $this->assertEquals($errorMessage, $subject->getErrorMessage(), "ErrorMessage:" . $errorMessage . "==" . $subject->getErrorMessage() . "\n");
+ $response['body']['data']['response_code'] = null;
+ }
+ }
+
+ /**
+ * @test
+ */
+ public function ProveConversionToArray(){
+ $response = array();
+ $response['header']['status'] = 200;
+ $response['body']['data'] = array(
+ "id" => "tran_54645bcb98ba7acfe204",
+ "amount" => "4200",
+ "origin_amount" => 4200,
+ "status" => "closed",
+ "description" => null,
+ "livemode" => false,
+ "refunds" => null,
+ "currency" => "EUR",
+ "created_at" => 1349946151,
+ "updated_at" => 1349946151,
+ "short_id" => '0000.1212.3434',
+ "invoices" => array(),
+ "payment" => new Models\Response\Payment(),
+ "client" => new Models\Response\Client(),
+ "preauthorization" => null,
+ "fees" => array(),
+ "app_id" => null
+ );
+ $responseObject = $this->_responseHandler->arrayToObject($response['body']);
+ $this->assertInstanceOf('stdClass', $responseObject);
+ $this->assertEquals($response['body']['data']['id'], $responseObject->data->id);
+ }
+
+}
\ No newline at end of file
diff --git a/lib/benchmark.inc.php b/lib/benchmark.inc.php
new file mode 100644
index 0000000..2662751
--- /dev/null
+++ b/lib/benchmark.inc.php
@@ -0,0 +1,57 @@
+';
+ echo '
Feature
User Time
System Time
Sum
';
+ foreach($GLOBALS['paymillBenchmark'] as $feature => $data){
+ echo '
'; }
- function section_pay_button_products_desc() { echo '
'.__('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').'
'; }
- function section_pay_button_shipping_desc() { echo '
'.__('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').'
'; }
-
- /*
- * General Option field callback, renders a
- * text input, note the name and value.
- */
- function field_general_option($args) {
-
- $descriptions = array();
- $descriptions['currency'] = __('Currency, ISO 4217 e.g. "EUR" or "GBP"', 'paymill');
- $descriptions['payments_display'] = __('Check the boxes which payment types should be announced on payment form', 'paymill');
- $descriptions['api_key_private'] = __('Insert your Paymill PRIVATE API key.', 'paymill');
- $descriptions['api_key_public'] = __('Insert your Paymill PUBLIC API key.', 'paymill');
- $descriptions['api_endpoint'] = __('Insert your Paymill endpoint URL.', 'paymill');
-
- if($args['desc'] == 'payments_display'){
- echo $descriptions[$args['desc']].' ';
-
- $payment_types = array(
- 'amex',
- 'dc',
- 'discover',
- 'elv',
- 'jcb',
- 'maestro',
- 'mastercard',
- 'unionpay',
- 'visa',
+
+ $settings = array(
+ 'flat_shipping_country' => __('Shipping Country', 'paymill'),
+ 'flat_shipping_costs' => __('Shipping Costs', 'paymill'),
+ 'flat_shipping_vat' => __('Shipping VAT', 'paymill'),
);
- foreach($payment_types as $type){
- $checked = esc_attr( $this->paymill_general_settings[$args['option']][$type] );
-
- echo '
-
- ';
+
+ for($i = 1; $i <= $shipping; $i++){
+ foreach($settings as $setting => $description){
+ add_settings_field($setting.'_'.$i, $description, array(&$this, 'print_config_form_fields'), $this->setting_keys['paymill_pay_button_settings'], 'section_pay_button_shipping', array('desc' => $setting, 'id' => $i, 'group' => 'flat_shipping', 'page' => $this->setting_keys['paymill_pay_button_settings']));
+ }
}
- }else{
+
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_register_pay_button_setting'); // benchmark
+ }
+ // The following methods provide descriptions for their respective sections, used as callbacks with add_settings_section
+ public function section_general_desc() { echo __('Please insert your API settings here.', 'paymill'); }
+ public function section_pay_button_desc() { echo '
'.__('The Paymill Pay Buton is a simple, independent payment solution. As Paymill for WordPress is GPL licensed, feel free to customize that Pay Button to fit your needs.', 'paymill').'
'; }
+ public function section_pay_button_products_desc() { echo '
'.__('Products', 'paymill').'
'.__('Configure products for the Pay Button. This list has a dynamic length and extends for 5 extra slots when last slot\'s Product Title is filled and saved.', 'paymill').'
'; }
+ public function section_pay_button_shipping_desc() { echo '
'.__('Shipping', 'paymill').'
'.__('Set delivery countries and shipping costs. This list has a dynamic length and extends for 5 extra slots when last slot\'s Shipping Country is filled and saved.', 'paymill').'
';
+ }
}
- }
-
- /*
- * Called during admin_menu, adds an options
- * page under Settings called My Settings, rendered
- * using the plugin_options_page method.
- */
- function add_admin_menus() {
- add_menu_page('Paymill', 'Paymill', 8, $this->plugin_options_key, array( &$this, 'plugin_options_page' ), plugins_url('',__FILE__ ).'/img/icon.png');
- }
-
- /*
- * Plugin Options page rendering goes here, checks
- * for active tab and replaces key with the related
- * settings key. Uses the plugin_options_tabs method
- * to render the tabs.
- */
- function plugin_options_page() {
- $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->setting_keys['paymill_general_settings'];
-?>
-
-
- plugin_options_tabs(); ?>
-
-
-
-
- ISO 4217 e.g. "EUR" or "GBP"', 'paymill');
+ $descriptions['api_key_private'] = __('Insert your Paymill PRIVATE API key.', 'paymill');
+ $descriptions['api_key_public'] = __('Insert your Paymill PUBLIC API key.', 'paymill');
+
+ $descriptions['flat_shipping_country'] = __('Name of the available delivery country, e.g. England', 'paymill');
+ $descriptions['flat_shipping_costs'] = __('Gross fee for the flat shipping costs., e.g. 7 or 4.90', 'paymill');
+ $descriptions['flat_shipping_vat'] = __('Value-Added-Tax Rate in % for the flat shipping costs., e.g. 19 or 7', 'paymill');
+
+ $descriptions['products_title'] = __('Name of the product', 'paymill');
+ $descriptions['products_desc'] = __('Detailed description of the product', 'paymill');
+ $descriptions['products_price'] = __('Gross Price of the product, e.g. 40 or 6.99', 'paymill');
+ $descriptions['products_offer'] = __('If you have created a subscription in your Paymill Cockpit, can select it here. If selected, it will overwrite the following settings for this product. Important: For Performance purposes, subscription plans will be cached. Open this page to recache it.', 'paymill');
+ $descriptions['products_vat'] = __('Value-Added-Tax Rate in % for the product, e.g. 19 or 7', 'paymill');
+ $descriptions['products_delivery'] = __('Delivery Time of the product, e.g. 2 Days or 1 Week', 'paymill');
+ $descriptions['products_quantityhide'] = __('Hide quantity select field, quantity will be set to 1', 'paymill');
+ $descriptions['products_freeamount'] = __('Allow free amounts (donation feature)', 'paymill');
+
+ if(!isset($wp_settings_fields[$page][$section])){
+ return;
+ }
+
+ foreach((array)$wp_settings_fields[$page][$section] as $field){
+ if(isset($field['args']['group'])){
+ $group_titles[$field['args']['desc']] = $field['title'];
+ $group_fields[$field['args']['id']][$field['args']['desc']] = $field;
+ }else{
+ echo '
';
+ }
+ }
+ // Renders our tabs in the plugin options page, walks through the object's tabs array and prints them one by one. Provides the heading for the plugin_options_page method.
+ private function plugin_options_tabs() {
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_plugin_options_tabs'); // benchmark
$current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $this->setting_keys['paymill_general_settings'];
- screen_icon();
echo '
\ No newline at end of file
diff --git a/lib/tpl/mgm/payment/paymill/html/settings.php b/lib/tpl/mgm/payment/paymill/html/settings.php
index 8911b3d..d46674b 100644
--- a/lib/tpl/mgm/payment/paymill/html/settings.php
+++ b/lib/tpl/mgm/payment/paymill/html/settings.php
@@ -112,18 +112,7 @@
-
\ No newline at end of file
diff --git a/lib/translate/paymill-de_DE.po b/lib/translate/paymill-de_DE.po
index 63bf177..2bdd1aa 100644
--- a/lib/translate/paymill-de_DE.po
+++ b/lib/translate/paymill-de_DE.po
@@ -1,454 +1,431 @@
msgid ""
msgstr ""
"Project-Id-Version: Paymill\n"
-"POT-Creation-Date: 2013-11-12 15:21+0100\n"
-"PO-Revision-Date: 2013-11-12 15:23+0100\n"
+"POT-Creation-Date: 2014-05-05 22:28+0100\n"
+"PO-Revision-Date: 2014-05-05 22:40+0100\n"
"Last-Translator: Matthias Reuter \n"
"Language-Team: Matthias Reuter \n"
-"Language: DE\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.7\n"
-"X-Poedit-KeywordsList: esc_attr__;__;_e\n"
+"X-Generator: Poedit 1.6.5\n"
+"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"
-#: paymill.php:153
-msgid "Invalid Credit Card Number"
-msgstr "Ungültige Kreditkartennummer"
-
-#: paymill.php:154
-msgid "Invalid Expiration Date"
-msgstr "Ungültiges Ablaufdatum"
-
-#: paymill.php:155
-msgid "Invalid CVC"
-msgstr "Ungültige Prüfziffer"
-
-#: paymill.php:156
-msgid "Invalid Account Number"
-msgstr "Ungültige Kontonummer"
-
-#: paymill.php:157
-msgid "Invalid Bank Code"
-msgstr "Ungültige Bankleitzahl"
-
-#: paymill.php:166
-msgid "Must be {is} characters long!"
-msgstr "Muss genau {is} Zeichen lang sein!"
-
-#: paymill.php:167
-msgid "Must not be less than {minimum} characters long!"
-msgstr "Muss länger als {minimum} sein!"
-
-#: paymill.php:168
-msgid "Must not be more than {maximum} characters long!"
-msgstr "Müssen weniger als {maximum} Zeichen sein!"
-
-#: paymill.php:169
-msgid "Must be a number!"
-msgstr "Muss eine Nummer sein!"
-
-#: paymill.php:170
-msgid "Must be an integer!"
-msgstr "Muss ein Integer sein!"
-
-#: paymill.php:171
-msgid "Must be {is}!"
-msgstr "Muss {is} sein!"
-
-#: paymill.php:172
-msgid "Must not be less than {minimum}!"
-msgstr "Darf nicht kleiner als {minimum} sein!"
-
-#: paymill.php:173
-msgid "Must not be more than {maximum}!"
-msgstr "Darf nicht größer als {maximum} sein!"
-
-#: paymill.php:174
-msgid "Supply a value!"
-msgstr "Darf nicht leer sein!"
-
-#: lib/config.inc.php:64
+#: lib/config.inc.php:43
msgid "DAY"
msgstr "Tag"
-#: lib/config.inc.php:65
+#: lib/config.inc.php:44
msgid "WEEK"
msgstr "Woche"
-#: lib/config.inc.php:66
+#: lib/config.inc.php:45
msgid "MONTH"
msgstr "Monat"
-#: lib/config.inc.php:67
+#: lib/config.inc.php:46
msgid "YEAR"
msgstr "Jahr"
-#: lib/config.inc.php:68
+#: lib/config.inc.php:47
msgid "DAYS"
msgstr "Tage"
-#: lib/config.inc.php:69
+#: lib/config.inc.php:48
msgid "WEEKS"
msgstr "Wochen"
-#: lib/config.inc.php:70
+#: lib/config.inc.php:49
msgid "MONTHS"
msgstr "Monate"
-#: lib/config.inc.php:71
+#: lib/config.inc.php:50
msgid "YEARS"
msgstr "Jahre"
-#: lib/config.inc.php:73
+#: lib/config.inc.php:52
msgid "50501"
msgstr ""
"Die Schnittstelle zum Acquirer reagiert nicht, daher bekommen wir keine "
"Antwort ob die Transaktion erfolgreich durchgelaufen ist"
-#: lib/config.inc.php:74
+#: lib/config.inc.php:53
msgid "50001"
msgstr "Die Kreditkarte ist auf einer Schwarzen Liste"
-#: lib/config.inc.php:75
+#: lib/config.inc.php:54
msgid "50201"
msgstr "Dieser Kundenaccount ist auf einer Schwarzen Liste"
-#: lib/config.inc.php:76
+#: lib/config.inc.php:55
msgid "40103"
msgstr ""
"Das Umsatzimit der Kreditkarte wurde mit dieser Transaktion überschritten "
"oder ist bereits überschritten"
-#: lib/config.inc.php:77
+#: lib/config.inc.php:56
msgid "50102"
msgstr "Diese Karte wurde ohne weitere Gründe abgelehnt"
-#: lib/config.inc.php:78
+#: lib/config.inc.php:57
msgid "50103"
msgstr "Die Kreditkarte wurde vermutlich manipuliert oder gestohlen"
-#: lib/config.inc.php:79
+#: lib/config.inc.php:58
msgid "40105"
msgstr "Das Kreditkartenablaufdatum ist nicht korrekt"
-#: lib/config.inc.php:80
+#: lib/config.inc.php:59
msgid "40101"
msgstr "Der CVV ist nicht korrekt"
-#: lib/config.inc.php:81
+#: lib/config.inc.php:60
msgid "40100"
msgstr ""
"Es existieren Probleme mit der Kreditkarte. Nähere Details können nicht "
"übergeben werden"
-#: lib/config.inc.php:82
+#: lib/config.inc.php:61
msgid "40104"
msgstr "Die Kreditkarte ist ungültig"
-#: lib/config.inc.php:83
+#: lib/config.inc.php:62
msgid "40001"
msgstr "Es gibt ein Problem mit den Payment Daten"
-#: lib/config.inc.php:84
+#: lib/config.inc.php:63
msgid "40102"
msgstr "Die Kreditkarte ist abgelaufen oder noch gültig"
-#: lib/config.inc.php:85
+#: lib/config.inc.php:64
msgid "40106"
msgstr "Kreditkarten-Anbieter ist erforderlich"
-#: lib/config.inc.php:86
+#: lib/config.inc.php:65
msgid "40201"
msgstr "Daten stimmen nicht mit dem Bank-Account überein"
-#: lib/config.inc.php:87
+#: lib/config.inc.php:66
msgid "50300"
msgstr "Es gibt einen teschnischen Fehler mit 3-D Secure"
-#: lib/config.inc.php:88
+#: lib/config.inc.php:67
msgid "40202"
msgstr "Die Benutzer-Authentifizierung ist fehlgeschlagen"
-#: lib/config.inc.php:89
+#: lib/config.inc.php:68
msgid "50502"
msgstr "Es gibt eine Zeitüberschreitung bei der Risiko-Management Transaktion"
-#: lib/config.inc.php:90
+#: lib/config.inc.php:69
msgid "40301"
msgstr "Währung oder Betrag stimmen nicht überein"
-#: lib/config.inc.php:91
+#: lib/config.inc.php:70
msgid "40401"
msgstr "Der Betrag ist zu niedrig oder null"
-#: lib/config.inc.php:92
+#: lib/config.inc.php:71
msgid "40402"
msgstr "Der Verwendungszweck ist zu lang"
-#: lib/config.inc.php:93
+#: lib/config.inc.php:72
msgid "40403"
msgstr "Die Währung ist nicht für den Kunden konfigurierten"
-#: lib/config.inc.php:94
+#: lib/config.inc.php:73
msgid "50104"
msgstr ""
"Die Transaktion wurde vom Authorisierungs-System abgelehnt (Karte durch Bank "
"eingeschränkt)"
-#: lib/config.inc.php:95
+#: lib/config.inc.php:74
msgid "50105"
msgstr "Die Konfiguration ist ungültig"
-#: lib/config.inc.php:96
+#: lib/config.inc.php:75
msgid "50600"
msgstr "Doppelte Transaktion"
-#: lib/config.inc.php:98
+#: lib/config.inc.php:77 lib/integration/woocommerce.inc.php:666
+msgid "Token not Found"
+msgstr "Token nicht gefunden"
+
+#: lib/config.inc.php:79
msgid "shipping"
msgstr "Lieferung"
-#: lib/config.inc.php:99
+#: lib/config.inc.php:80
msgid "company_name"
msgstr "Firmenname"
-#: lib/config.inc.php:100
+#: lib/config.inc.php:81
msgid "forename"
msgstr "Vorname"
-#: lib/config.inc.php:101
+#: lib/config.inc.php:82
msgid "surname"
msgstr "Nachname"
-#: lib/config.inc.php:102
+#: lib/config.inc.php:83
msgid "street"
msgstr "Straße"
-#: lib/config.inc.php:103
+#: lib/config.inc.php:84
msgid "number"
msgstr "Nummer"
-#: lib/config.inc.php:104
+#: lib/config.inc.php:85
msgid "zip"
msgstr "PLZ"
-#: lib/config.inc.php:105
+#: lib/config.inc.php:86
msgid "city"
msgstr "Stadt"
-#: lib/config.inc.php:106
+#: lib/config.inc.php:87
msgid "email"
msgstr "Email"
-#: lib/config.inc.php:107
+#: lib/config.inc.php:88
msgid "phone"
msgstr "Telefon"
-#: lib/config.inc.php:110
+#: lib/config.inc.php:91
msgid "Token or Payment required"
msgstr ""
"Es wurde kein Bezahlschlüssel generiert oder der vorhandene wurde bereits "
"genutzt."
-#: lib/config.inc.php:111
+#: lib/config.inc.php:92
msgid "Subscription already connected"
msgstr "Abonnement bereits abgeschlossen"
-#: lib/config.inc.php:124
+#: lib/config.inc.php:106
msgid "General Plugin Settings"
msgstr "Generelle Plugin Einstellungen"
-#: lib/config.inc.php:126
+#: lib/config.inc.php:108
msgid "Paymill PRIVATE API key"
msgstr "Paymill PRIVATE API Key"
-#: lib/config.inc.php:127
+#: lib/config.inc.php:109
msgid "Paymill PUBLIC API key"
msgstr "Paymill PUBLIC API Key"
-#: lib/config.inc.php:128
-msgid "Paymill API endpoint URL"
-msgstr "Paymill API Endpoint URL"
-
-#: lib/config.inc.php:129
-msgid "Currency"
-msgstr "Währung"
-
-#: lib/config.inc.php:130
+#: lib/config.inc.php:110
msgid "Display Payment Types"
msgstr "Zeige Bezahlmöglichkeiten"
-#: lib/config.inc.php:143
+#: lib/config.inc.php:111
+msgid "Do not load default CSS"
+msgstr "Standard-CSS nicht laden"
+
+#: lib/config.inc.php:130
msgid "Number Format: Decimal Point"
msgstr "Nummern Formatierung: Dezimalpunkt"
-#: lib/config.inc.php:144
+#: lib/config.inc.php:131
msgid "Number Format: Thousands Seperator"
msgstr "Nummern Formatierung: Tausender-Trenner"
-#: lib/config.inc.php:145
+#: lib/config.inc.php:132
+msgid "Currency"
+msgstr "Währung"
+
+#: lib/config.inc.php:133
msgid "Outgoing Email"
msgstr "Ausgehende Emailadresse"
-#: lib/config.inc.php:146
+#: lib/config.inc.php:134
msgid "Incoming Email"
msgstr "Eingehende Emailadresse"
-#: lib/config.inc.php:147
+#: lib/config.inc.php:135
msgid "Thank You URL"
msgstr "Danke-Seite"
-#: lib/config.inc.php:148
-msgid "Hide Fields"
-msgstr "Verstecke Felder"
-
-#: lib/config.inc.php:149
-msgid "Do not load default CSS"
-msgstr "Standard-CSS nicht laden"
+#: lib/config.inc.php:136
+msgid "Show Fields"
+msgstr "Zeige Felder"
-#: lib/config.inc.php:163
+#: lib/config.inc.php:157
msgid "Product"
msgstr "Produkt"
-#: lib/config.inc.php:164
+#: lib/config.inc.php:158
msgid "Description"
msgstr "Beschreibung"
-#: lib/config.inc.php:165
+#: lib/config.inc.php:159
+msgid "Hide Quantity"
+msgstr "Verstecke Volumenauswahl"
+
+#: lib/config.inc.php:160
+msgid "Delivery Time"
+msgstr "Lieferzeit"
+
+#: lib/config.inc.php:161
msgid "VAT"
msgstr "Umsatzsteuer"
-#: lib/config.inc.php:167
+#: lib/config.inc.php:162
msgid "Subscription Offer"
msgstr "Abonnement Angebot"
-#: lib/config.inc.php:169
+#: lib/config.inc.php:163
msgid "Price"
msgstr "Preis"
-#: lib/config.inc.php:170
-msgid "Hide Quantity"
-msgstr "Verstecke Volumenauswahl"
-
-#: lib/config.inc.php:172
-msgid "Delivery Time"
-msgstr "Lieferzeit"
-
-#: lib/config.inc.php:187
+#: lib/config.inc.php:186
msgid "Shipping Country"
msgstr "Lieferland"
-#: lib/config.inc.php:188
+#: lib/config.inc.php:187
msgid "Shipping Costs"
msgstr "Lieferkosten"
-#: lib/config.inc.php:189
+#: lib/config.inc.php:188
msgid "Shipping VAT"
msgstr "Liefer Umsatzsteuer"
-#: lib/config.inc.php:199
+#: lib/config.inc.php:200
msgid "Please insert your API settings here."
msgstr "Bitte fügen Sie Ihre API Einstellungen hier ein."
-#: lib/config.inc.php:200
+#: lib/config.inc.php:201
+msgid ""
+"The Paymill Pay Buton is a simple, independent payment solution. As Paymill "
+"for WordPress is GPL licensed, feel free to customize that Pay Button to fit "
+"your needs."
+msgstr ""
+"Der Paymill Pay Button ist eine einfache, unabhängige Bezahllösung. Da "
+"Paymill for WordPress GPL lizensiert ist, kannst du den Pay Button ganz auf "
+"deine Bedürfnisse weiterentwickeln."
+
+#: lib/config.inc.php:201
msgid "Common Settings"
msgstr "Gemeinsame Einstellungen"
-#: lib/config.inc.php:200
-msgid "The Paymill Pay Buton is a simple, independent payment solution."
-msgstr ""
-"Der Paymill Pay Button ist eine einfache, unabhängige Bezahlmöglichkeit."
-
-#: lib/config.inc.php:200
+#: lib/config.inc.php:201
msgid "Configure common settings"
msgstr "Gemeinsame Einstellungen"
-#: lib/config.inc.php:200 lib/config.inc.php:201 lib/config.inc.php:202
+#: lib/config.inc.php:201 lib/config.inc.php:202 lib/config.inc.php:203
msgid "Toggle View"
msgstr "Ansicht umschalten"
-#: lib/config.inc.php:201
+#: lib/config.inc.php:202
msgid "Products"
msgstr "Produkte"
-#: lib/config.inc.php:201
+#: lib/config.inc.php:202
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."
+"extends for 5 extra slots when last slot's Product Title is filled and saved."
msgstr ""
-"Konfigurieren Sie die Produkte für den Pay Button. Diese Liste hat eine "
+"Konfiguriere 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."
-#: lib/config.inc.php:202
+#: lib/config.inc.php:203
msgid "Shipping"
msgstr "Lieferung"
-#: lib/config.inc.php:202
+#: lib/config.inc.php:203
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."
+"and extends for 5 extra slots when last slot's Shipping Country 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."
+"Lege die 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."
-#: lib/config.inc.php:211
-msgid ""
-"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
-msgstr ""
-"Währung, ISO 4217 z.B. \"EUR\" or \"GBP\""
-
-#: lib/config.inc.php:212
+#: lib/config.inc.php:266
msgid "Check the boxes which payment types should be announced on payment form"
msgstr ""
"Wähle hier aus, welche Bezahlmöglichkeiten im Bezahlformular angezeigt "
"werden sollen"
-#: lib/config.inc.php:213
-msgid "Insert your Paymill PRIVATE API key."
-msgstr "Fügen Sie Ihren PRIVATEN Paymill API Schlüssel ein."
+#: lib/config.inc.php:267 lib/config.inc.php:429
+msgid "Detailed description of the product"
+msgstr "Detaillierte Beschreibung des Produkts"
-#: lib/config.inc.php:214
-msgid "Insert your Paymill PUBLIC API key."
+#: lib/config.inc.php:268 lib/config.inc.php:430
+msgid "Gross Price of the product, e.g. 40 or 6.99"
+msgstr "Brutto Preis des Produkts, z.B. 40 oder 6.99"
+
+#: lib/config.inc.php:269
+msgid ""
+"If you have created a subscription in your Paymill Cockpit, you can select it here. If selected, "
+"it will overwrite the following settings for this product. Important: For "
+"Performance purposes, subscription plans will be cached. Open this page to "
+"recache it."
+msgstr ""
+"Wenn du ein Abonnement in deinem Paymill Cockpit erstellt hast, kannst du es hier auswählen. "
+"Sobald es ausgewählt ist, wird es die folgenden Einstellungen dieses "
+"Produktes überschreiben. Wichtig: Aus Performancegründen werden "
+"Abonnements gecached (zwischengespeichert). Rufe diese Seite auf, um die "
+"Abonnements zu aktualisieren."
+
+#: lib/config.inc.php:270 lib/config.inc.php:432
+#, 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"
+
+#: lib/config.inc.php:271 lib/config.inc.php:433
+msgid "Delivery Time of the product, e.g. 2 Days or 1 Week"
+msgstr "Lieferzeit des Produkts, z.B. 2 Tage oder 1 Woche"
+
+#: lib/config.inc.php:272 lib/config.inc.php:434
+msgid "Hide quantity select field, quantity will be set to 1"
msgstr ""
-"Fügen Sie Ihren ÖFFENTLICHEN Paymill API Schlüssel ein."
+"Verstecke die Auswahlliste für die Anzahl der Produkte, setzt Anzahl auf 1"
+
+#: lib/config.inc.php:273 lib/config.inc.php:435
+msgid "Allow free amounts (donation feature)"
+msgstr "Erlaube freie Beträge (Spenden-Funktion)"
-#: lib/config.inc.php:215
-msgid "Insert your Paymill endpoint URL."
-msgstr "Fügen Sie Ihre Paymill Endpoint Adresse ein."
+#: lib/config.inc.php:318
+msgid "Optional: Select Subscription Plan"
+msgstr "Optional: Wähle ein Abonnement"
-#: lib/config.inc.php:267
+#: lib/config.inc.php:340
+msgid ""
+"You may want to gather some additional information from your customers. "
+"Select them here:"
+msgstr ""
+"Du möchtest möglicherweise weitere Informationen von deinen Kunden erhalten. "
+"Wähle sie hier aus:"
+
+#: lib/config.inc.php:413
msgid "Set a symbol used for decimal point. Default: ."
msgstr "Lege ein Symbol für den Dezimalpunkt fest. Standard: ."
-#: lib/config.inc.php:268
+#: lib/config.inc.php:414
msgid "Set a symbol used for thousands seperator. Default: ,"
msgstr "Lege ein Symbol für das Tausender-Trennzeichen fest. Standard: ,"
-#: lib/config.inc.php:269
+#: lib/config.inc.php:415
msgid "Outgoing Emailaddress for customer order confirmation mail."
msgstr "Ausgehende Emailadresse für die Kundenbestellbestätigung."
-#: lib/config.inc.php:270
+#: lib/config.inc.php:416
msgid "Incoming Emailaddress for Copy of customer order confirmation mail."
msgstr "Eingehende Emailadresse für eine Kopie der Kundenbestellbestätigung."
-#: lib/config.inc.php:271
+#: lib/config.inc.php:417
msgid "Redirect URL for custom thank your page."
msgstr "Weiterleitungs-URL für eigene Dankeseiten."
-#: lib/config.inc.php:273
-msgid "You may want to hide certain fields. Select them here:"
-msgstr ""
-"Du möchtest möglicherweise manche Felder verstecken. Wähle sie hier aus:"
-
-#: lib/config.inc.php:274
+#: lib/config.inc.php:419
msgid ""
"Advanced users want to fully customize the payment button. Disabling default "
"CSS from Pay Button will make that much easier."
@@ -457,41 +434,46 @@ msgstr ""
"personalisieren. Das Deaktivieren der mit dem Plugin geladenen Standard-CSS-"
"Datei macht dies viel einfacher."
-#: lib/config.inc.php:276
-msgid "Name of the available delivery country, e.g. \"England\""
-msgstr "Name des verfügbaren Lieferlandes, z.B. \"England\""
+#: lib/config.inc.php:420
+msgid ""
+"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
+msgstr ""
+"Währung, ISO 4217 z.B. \"EUR\" or \"GBP\""
-#: lib/config.inc.php:277
-msgid "Gross fee for the flat shipping costs., e.g. \"7\" or \"4.90\""
+#: lib/config.inc.php:421
+msgid "Insert your Paymill PRIVATE API key."
+msgstr "Fügen Sie Ihren PRIVATEN Paymill API Schlüssel ein."
+
+#: lib/config.inc.php:422
+msgid "Insert your Paymill PUBLIC API key."
msgstr ""
-"Brutto Gebühr für die pauschalen Versandkosten, z.B. \"7\" oder \"4.90\""
+"Fügen Sie Ihren ÖFFENTLICHEN Paymill API Schlüssel ein."
+
+#: lib/config.inc.php:424
+msgid "Name of the available delivery country, e.g. England"
+msgstr "Name des verfügbaren Lieferlandes, z.B. England"
-#: lib/config.inc.php:278
+#: lib/config.inc.php:425
+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"
+
+#: lib/config.inc.php:426
#, 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\""
+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"
-#: lib/config.inc.php:280
+#: lib/config.inc.php:428
msgid "Name of the product"
msgstr "Name des Produkts"
-#: lib/config.inc.php:281
-msgid "Detailed description of the product"
-msgstr "Detaillierte Beschreibung des Produkts"
-
-#: lib/config.inc.php:282
-msgid "Gross Price of the product, e.g. \"40\" or \"6.99\""
-msgstr "Brutto Preis des Produkts, z.B. \"40\" oder \"6.99\""
-
-#: lib/config.inc.php:283
+#: lib/config.inc.php:431
msgid ""
"If you have created a subscription in your Paymill Cockpit, can select it "
"here. If selected, it will overwrite the following settings for this "
-"product. Important: For Performance purposes, subscription plans "
-"will be cached. Open this page to recache it."
+"product. Important: For Performance purposes, subscription plans will be "
+"cached. Open this page to recache it."
msgstr ""
"Wenn du ein Abonnement in deinem Paymill Cockpit erstellt hast, kannst du es "
"hier auswählen. Sobald es ausgewählt ist, wird es die folgenden "
@@ -499,360 +481,377 @@ msgstr ""
"Performancegründen werden Abonnements gecached (zwischengespeichert). Rufe "
"diese Seite auf, um die Abonnements zu aktualisieren."
-#: lib/config.inc.php:284
-#, 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\""
-
-#: lib/config.inc.php:285
-msgid "Delivery Time of the product, e.g. \"2 Days\" or \"1 Week\""
-msgstr "Lieferzeit des Produkts, z.B. \"2 Tage\" oder \"1 Woche\""
-
-#: lib/config.inc.php:286
-msgid "Hide quantity select field, quantity will be set to 1"
-msgstr ""
-"Verstecke die Auswahlliste für die Anzahl der Produkte, setzt Anzahl auf 1"
-
-#: lib/config.inc.php:287
-msgid "Allow free amounts (donation feature)"
-msgstr "Erlaube freie Beträge (Spenden-Funktion)"
-
-#: lib/config.inc.php:323
-msgid "Optional: Select Subscription Plan"
-msgstr "Optional: Wähle ein Abonnement"
-
-#: lib/integration/magicmembers.inc.php:64
-msgid "Paymill - Online payments made easy"
-msgstr "Paymill - Online Payments made easy"
+#: lib/integration/magicmembers.inc.php:50
+msgid "PAYMILL - Online payments made easy"
+msgstr "PAYMILL - Online Payments made easy"
-#: lib/integration/magicmembers.inc.php:188
+#: lib/integration/magicmembers.inc.php:141
#, php-format
msgid "%s logo updated"
-msgstr ""
+msgstr "%s Logo aktualisiert"
-#: lib/integration/magicmembers.inc.php:222
+#: lib/integration/magicmembers.inc.php:175
#, php-format
msgid "%s module has been %s"
-msgstr ""
+msgstr "%s Modul wurde %s"
-#: lib/integration/magicmembers.inc.php:312
+#: lib/integration/magicmembers.inc.php:237
#, php-format
msgid "%s settings updated"
+msgstr "%s Einstellungen aktualisiert"
+
+#: lib/integration/magicmembers.inc.php:880
+#: lib/integration/shopplugin.inc.php:167
+#: lib/integration/woocommerce.inc.php:605
+msgid "Order #"
+msgstr "Bestellung #"
+
+#: lib/integration/magicmembers.inc.php:948
+#: lib/integration/pay_button.inc.php:240
+#: lib/integration/shopplugin.inc.php:232
+#: lib/integration/woocommerce.inc.php:658
+msgid "There was an issue with adding you as client for the payment process."
msgstr ""
+"Es gab ein Problem dabei, Sie als neuen Kunden im Bezahlprozess hinzuzufügen."
-#: lib/integration/magicmembers.inc.php:584
+#: lib/integration/magicmembers.inc.php:1034
msgid "Error while cancelling subscription"
-msgstr ""
+msgstr "Fehler bei Beendigung des Abonnements"
-#: lib/integration/magicmembers.inc.php:610
-#: lib/integration/magicmembers.inc.php:894
+#: lib/integration/magicmembers.inc.php:1058
+#: lib/integration/magicmembers.inc.php:1337
msgid "Transaction Id invalid"
-msgstr ""
+msgstr "Transaktions-ID ungültig"
-#: lib/integration/magicmembers.inc.php:620
-#: lib/integration/magicmembers.inc.php:904
+#: lib/integration/magicmembers.inc.php:1068
+#: lib/integration/magicmembers.inc.php:1347
msgid "Transaction invalid"
-msgstr ""
+msgstr "Transaktion ungültig"
-#: lib/integration/magicmembers.inc.php:632
-#: lib/integration/magicmembers.inc.php:914
+#: lib/integration/magicmembers.inc.php:1080
+#: lib/integration/magicmembers.inc.php:1357
msgid "Transaction invalid . User id field is empty"
-msgstr ""
+msgstr "Transaktion ungültig. Benutzer ID Feld ist leer."
-#: lib/integration/magicmembers.inc.php:985
-#: lib/integration/pay_button.inc.php:217
+#: lib/integration/magicmembers.inc.php:1430
+#: lib/integration/pay_button.inc.php:324
msgid "Pay now"
msgstr "Jetzt bezahlen"
-#: lib/integration/magicmembers.inc.php:1019
-#: lib/integration/magicmembers.inc.php:1050
+#: lib/integration/magicmembers.inc.php:1461
+#: lib/integration/magicmembers.inc.php:1489
msgid "You can pay with:"
msgstr "Bezahle mit:"
-#: lib/integration/magicmembers.inc.php:1086
+#: lib/integration/magicmembers.inc.php:1521
#, php-format
msgid ""
"You have subscribed to %s via %s, if you wish to unsubscribe, "
"please click the following link. "
msgstr ""
+"Du hast %s via %s abonniert, wenn du kündigen möchtest, klicke "
+"auf den folgenden Link. "
-#: lib/integration/magicmembers.inc.php:1092
-#: lib/integration/magicmembers.inc.php:1104
+#: lib/integration/magicmembers.inc.php:1527
+#: lib/integration/magicmembers.inc.php:1539
msgid "Unsubscribe"
-msgstr ""
+msgstr "Kündigen"
-#: lib/integration/magicmembers.inc.php:1138
-msgid "SimpleXML PHP extension must be loaded for Paymill ARB"
-msgstr ""
-
-#: lib/integration/magicmembers.inc.php:1144
-msgid ""
-"Transaction Details API in Paymill must be enabled for Rebill Status Query"
-msgstr ""
-
-#: lib/integration/magicmembers.inc.php:1170
+#: lib/integration/magicmembers.inc.php:1563
msgid "N/A"
-msgstr ""
+msgstr "N/A"
-#: lib/integration/magicmembers.inc.php:1182
-msgid "AUTHORIZE.NET INFO"
-msgstr ""
+#: lib/integration/magicmembers.inc.php:1575
+msgid "Paymill INFO"
+msgstr "Paymill INFO"
-#: lib/integration/magicmembers.inc.php:1182
+#: lib/integration/magicmembers.inc.php:1575
msgid "SUBSCRIPTION ID"
-msgstr ""
+msgstr "Abonnement ID"
-#: lib/integration/magicmembers.inc.php:1184
+#: lib/integration/magicmembers.inc.php:1577
msgid "TRANSACTION ID"
-msgstr ""
+msgstr "Transaktions-ID"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Subscription ID"
msgstr "Abonnement ID"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Transaction ID"
-msgstr ""
+msgstr "Transaktions-ID"
-#: lib/integration/magicmembers.inc.php:1500
-#: lib/integration/magicmembers.inc.php:1964
+#: lib/integration/magicmembers.inc.php:1873
+#: lib/integration/magicmembers.inc.php:2403
msgid "Last payment was successful"
-msgstr ""
+msgstr "Letzte Zahlung war erfolgreich"
-#: lib/integration/magicmembers.inc.php:1548
-#: lib/integration/magicmembers.inc.php:2188
+#: lib/integration/magicmembers.inc.php:1921
msgid "Last payment was refunded or denied"
-msgstr ""
+msgstr "Letzte Zahlung wurde erstattet oder abgelehnt"
-#: lib/integration/magicmembers.inc.php:1570
-#: lib/integration/magicmembers.inc.php:2206
+#: lib/integration/magicmembers.inc.php:1943
#, php-format
msgid "Last payment is pending. Reason: %s"
-msgstr ""
+msgstr "Letzte Zahlung ist schwebend. Grund: %s"
-#: lib/integration/magicmembers.inc.php:1590
-#: lib/integration/magicmembers.inc.php:2220
+#: lib/integration/magicmembers.inc.php:1963
#, php-format
msgid "Last payment status: %s"
-msgstr ""
+msgstr "Letzter Zahlungsstatus: %s"
-#: lib/integration/magicmembers.inc.php:1618
+#: lib/integration/magicmembers.inc.php:1991
msgid "Failed join"
-msgstr ""
+msgstr "Fehlerhafter Beitritt"
-#: lib/integration/magicmembers.inc.php:1668
+#: lib/integration/magicmembers.inc.php:2041
msgid "The post was purchased successfully"
-msgstr ""
+msgstr "Der Beitrag wurde erfolgreich gekauft"
-#: lib/integration/magicmembers.inc.php:2516
+#: lib/integration/magicmembers.inc.php:2961
msgid "Subscription cancelled"
msgstr "Abonnement abgebrochen"
-#: lib/integration/magicmembers.inc.php:2542
-#: lib/integration/magicmembers.inc.php:3028
+#: lib/integration/magicmembers.inc.php:2987
+#: lib/integration/magicmembers.inc.php:3401
#, php-format
msgid "Subscription awaiting cancellation on %s"
-msgstr ""
+msgstr "Abonnement wartet auf Kündigung am %s"
-#: lib/integration/magicmembers.inc.php:2622
+#: lib/integration/magicmembers.inc.php:3067
#, php-format
msgid ""
"You have successfully unsubscribed. Your account has been marked for "
"cancellation on %s"
msgstr ""
+"Du hast erfolgreich gekündigt. Dein Account wurde markiert für Kündigung am "
+"%s"
-#: lib/integration/magicmembers.inc.php:2918
+#: lib/integration/magicmembers.inc.php:3291
msgid "Last payment cycle processed successfully"
-msgstr ""
+msgstr "Letzter Zahlungszyklus wurde erfolgreich durchgeführt"
-#: lib/integration/magicmembers.inc.php:3048
+#: lib/integration/magicmembers.inc.php:3421
msgid "Last payment cycle cancelled"
-msgstr ""
+msgstr "Letzter Zahlungszyklus abgebrochen"
-#: lib/integration/magicmembers.inc.php:3082
+#: lib/integration/magicmembers.inc.php:3455
msgid "Last payment cycle expired"
-msgstr ""
+msgstr "Letzter Zahlungszyklus ausgelaufen"
-#: lib/integration/magicmembers.inc.php:3771
-msgid "Error occured"
-msgstr ""
+#: lib/integration/pay_button.inc.php:5
+msgid "Error:"
+msgstr "Fehler:"
-#: lib/integration/pay_button.inc.php:63
-#: lib/integration/shopplugin.inc.php:126
+#: lib/integration/pay_button.inc.php:30
msgid "Order"
msgstr "Bestellung"
-#: lib/integration/pay_button.inc.php:94
-msgid "There was an issue with adding you as client for the payment process."
-msgstr ""
-"Es gab ein Problem dabei, Sie als neuen Kunden im Bezahlprozess hinzuzufügen."
-
-#: lib/integration/pay_button.inc.php:107 lib/tpl/pay_button.php:114
+#: lib/integration/pay_button.inc.php:163 lib/tpl/pay_button.php:113
msgid "Company Name"
msgstr "Firmenname"
-#: lib/integration/pay_button.inc.php:108
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:120
+#: lib/integration/pay_button.inc.php:164 lib/tpl/pay_button.php:117
msgid "Forename"
msgstr "Vorname"
-#: lib/integration/pay_button.inc.php:109
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:126
+#: lib/integration/pay_button.inc.php:165 lib/tpl/pay_button.php:121
msgid "Surname"
msgstr "Nachname"
-#: lib/integration/pay_button.inc.php:110 lib/tpl/pay_button.php:132
+#: lib/integration/pay_button.inc.php:166 lib/tpl/pay_button.php:125
msgid "Street"
msgstr "Straße"
-#: lib/integration/pay_button.inc.php:111 lib/tpl/pay_button.php:138
+#: lib/integration/pay_button.inc.php:167 lib/tpl/pay_button.php:129
msgid "Number"
msgstr "Nummer"
-#: lib/integration/pay_button.inc.php:112 lib/tpl/pay_button.php:144
+#: lib/integration/pay_button.inc.php:168 lib/tpl/pay_button.php:133
msgid "ZIP"
msgstr "PLZ"
-#: lib/integration/pay_button.inc.php:113 lib/tpl/pay_button.php:150
+#: lib/integration/pay_button.inc.php:169 lib/tpl/pay_button.php:137
msgid "City"
msgstr "Ort"
-#: lib/integration/pay_button.inc.php:114
+#: lib/integration/pay_button.inc.php:170
msgid "Country"
msgstr "Land"
-#: lib/integration/pay_button.inc.php:115 lib/tpl/pay_button.php:156
+#: lib/integration/pay_button.inc.php:171 lib/tpl/pay_button.php:145
msgid "Email"
msgstr "Email"
-#: lib/integration/pay_button.inc.php:116 lib/tpl/pay_button.php:162
+#: lib/integration/pay_button.inc.php:172 lib/tpl/pay_button.php:141
msgid "Phone"
msgstr "Telefon"
-#: lib/integration/pay_button.inc.php:133
+#: lib/integration/pay_button.inc.php:190
msgid "Confirmation of your Order"
msgstr "Bestellbestätigung"
-#: lib/integration/pay_button.inc.php:139
+#: lib/integration/pay_button.inc.php:196
msgid "New Order received"
msgstr "Neue Bestellung erhalten"
-#: lib/integration/pay_button.inc.php:162
+#: lib/integration/pay_button.inc.php:258
msgid "Shows a Paymill Payment Button."
msgstr "Zeigt einen Paymill Payment Button."
-#: lib/integration/pay_button.inc.php:180
+#: lib/integration/pay_button.inc.php:281
msgid "Thank you for your order."
msgstr "Vielen Dank für Ihre Bestellung."
-#: lib/integration/pay_button.inc.php:215
+#: lib/integration/pay_button.inc.php:319
msgid "Payment"
msgstr "Bezahlung"
-#: lib/integration/pay_button.inc.php:240
+#: lib/integration/pay_button.inc.php:349
msgid "Title:"
msgstr "Titel:"
-#: lib/integration/pay_button.inc.php:247
+#: lib/integration/pay_button.inc.php:356
msgid "Show these products only:"
msgstr "Zeige nur diese Produkte:"
-#: lib/integration/pay_button.inc.php:250
+#: lib/integration/pay_button.inc.php:359
msgid "All Products"
msgstr "Alle Produkte"
-#: lib/integration/woocommerce.inc.php:113
+#: lib/integration/woocommerce.inc.php:410
msgid "Enable/Disable"
msgstr "Aktivieren/Deaktivieren"
-#: lib/integration/woocommerce.inc.php:115
+#: lib/integration/woocommerce.inc.php:412
msgid "Enable PAYMILL Payment"
msgstr "Aktiviere Paymill Bezahlung"
-#: lib/integration/woocommerce.inc.php:119
+#: lib/integration/woocommerce.inc.php:416
msgid "Title"
msgstr "Titel"
-#: lib/integration/woocommerce.inc.php:121
+#: lib/integration/woocommerce.inc.php:418
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."
-#: lib/integration/woocommerce.inc.php:122
+#: lib/integration/woocommerce.inc.php:419
msgid "PAYMILL Payment"
msgstr "Bezahlung"
-#: lib/integration/woocommerce.inc.php:126
+#: lib/integration/woocommerce.inc.php:423
msgid "Customer Message"
msgstr "Kundennachricht"
-#: lib/integration/woocommerce.inc.php:272
-msgid "Subscription already ordered and cannot be purchased twice."
-msgstr ""
-"Das Abonnement wurde bereits bestellt und kann nicht ein zweites mal gekauft "
-"werden."
+#: lib/integration/woocommerce.inc.php:536
+msgid "Subscription already subscribed."
+msgstr "Abonnement bereits abgeschlossen."
+
+#: lib/integration/woocommerce.inc.php:632
+msgid "Awaiting payment confirmation from Paymill."
+msgstr "Warten auf Zahlungsbestätigung von Paymill."
-#: lib/tpl/checkout_form.php:26
+#: lib/tpl/checkout_form.php:24
msgid "Credit Card"
msgstr "Kreditkarte"
-#: lib/tpl/checkout_form.php:27
-msgid "Debit Payment"
+#: lib/tpl/checkout_form.php:31
+msgid "SEPA"
+msgstr "SEPA"
+
+#: lib/tpl/checkout_form.php:38
+msgid "ELV"
msgstr "ELV"
-#: lib/tpl/checkout_form.php:32
-msgid "Name"
-msgstr "Name"
+#: lib/tpl/checkout_form.php:42
+msgid "Holder Name"
+msgstr "Karteninhaber"
-#: lib/tpl/checkout_form.php:37
-msgid "Credit Card Number"
+#: lib/tpl/checkout_form.php:46
+msgid "Card Number"
msgstr "Kreditkarten Nummer"
-#: lib/tpl/checkout_form.php:41
-msgid "Expire Date (MM/YYYY)"
+#: lib/tpl/checkout_form.php:49
+msgid "Expire Date: "
msgstr "Gültigkeitsdatum"
-#: lib/tpl/checkout_form.php:45
+#: lib/tpl/checkout_form.php:50
+msgid "MM"
+msgstr "MM"
+
+#: lib/tpl/checkout_form.php:51
+msgid "YYYY"
+msgstr "YYYY"
+
+#: lib/tpl/checkout_form.php:52
msgid "CVC"
msgstr "CVC"
-#: lib/tpl/checkout_form.php:50
-msgid "Account #"
+#: lib/tpl/checkout_form.php:57
+msgid "IBAN"
+msgstr "IBAN"
+
+#: lib/tpl/checkout_form.php:60
+msgid "BIC"
+msgstr "BIC"
+
+#: lib/tpl/checkout_form.php:65
+msgid "Account Number"
msgstr "Kontonummer"
-#: lib/tpl/checkout_form.php:54
-msgid "Bank code"
+#: lib/tpl/checkout_form.php:68
+msgid "Bank Code"
msgstr "Bankleitzahl"
-#: lib/tpl/pay_button.php:35
+#: lib/tpl/mgm/payment/paymill/html/settings.php:74
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:5
+#, php-format
+msgid "%s Logo"
+msgstr "%s Logo"
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "Yes"
+msgstr "ja"
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "No"
+msgstr "nein"
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+msgid "Enabled"
+msgstr "aktiviert"
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+msgid "Disabled"
+msgstr "deaktiviert"
+
+#: lib/tpl/pay_button.php:41
msgid "S"
-msgstr ""
+msgstr "S"
-#: lib/tpl/pay_button.php:38 lib/tpl/pay_button.php:63
+#: lib/tpl/pay_button.php:44 lib/tpl/pay_button.php:77
msgid "% VAT included."
msgstr "% USt. inbegriffen."
-#: lib/tpl/pay_button.php:39 lib/tpl/pay_button.php:64
+#: lib/tpl/pay_button.php:45 lib/tpl/pay_button.php:78
msgid "Delivery Time: "
msgstr "Lieferzeit:"
-#: lib/tpl/pay_button.php:81
+#: lib/tpl/pay_button.php:62
+msgid "á "
+msgstr "á"
+
+#: lib/tpl/pay_button.php:93
msgid "Choose Country"
msgstr "Wähle ein Land"
-#: lib/tpl/pay_button.php:93
+#: lib/tpl/pay_button.php:105
msgid "Total Price:"
msgstr "Gesamtsumme:"
-#: lib/tpl/pay_button.php:111
+#: lib/tpl/pay_button.php:110
msgid "Address"
msgstr "Adresse"
-
-#~ msgid "Free Amount"
-#~ msgstr "Freier Betrag"
-
-#~ msgid "Paymill Payment"
-#~ msgstr "Paymill Payment"
-
-#~ msgid "%s DAY"
-#~ msgstr "%s Tage"
diff --git a/lib/translate/paymill-en_US.po b/lib/translate/paymill-en_US.po
index a6a5244..eb4d17a 100644
--- a/lib/translate/paymill-en_US.po
+++ b/lib/translate/paymill-en_US.po
@@ -1,312 +1,272 @@
msgid ""
msgstr ""
"Project-Id-Version: Paymill\n"
-"POT-Creation-Date: 2013-11-08 01:38+0100\n"
-"PO-Revision-Date: 2013-11-08 01:39+0100\n"
+"POT-Creation-Date: 2014-05-05 22:28+0100\n"
+"PO-Revision-Date: 2014-05-05 22:28+0100\n"
"Last-Translator: Matthias Reuter \n"
"Language-Team: Matthias Reuter \n"
-"Language: EN\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.7\n"
-"X-Poedit-KeywordsList: esc_attr__;__;_e\n"
+"X-Generator: Poedit 1.6.5\n"
+"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"
-#: paymill.php:153
-msgid "Invalid Credit Card Number"
-msgstr "Invalid Credit Card Number"
-
-#: paymill.php:154
-msgid "Invalid Expiration Date"
-msgstr "Invalid Expiration Date"
-
-#: paymill.php:155
-msgid "Invalid CVC"
-msgstr "Invalid CVC"
-
-#: paymill.php:156
-msgid "Invalid Account Number"
-msgstr "Invalid Account Number"
-
-#: paymill.php:157
-msgid "Invalid Bank Code"
-msgstr "Invalid Bank Code"
-
-#: paymill.php:166
-msgid "Must be {is} characters long!"
-msgstr "Must be {is} characters long!"
-
-#: paymill.php:167
-msgid "Must not be less than {minimum} characters long!"
-msgstr "Must not be less than {minimum} characters long!"
-
-#: paymill.php:168
-msgid "Must not be more than {maximum} characters long!"
-msgstr "Must not be more than {maximum} characters long!"
-
-#: paymill.php:169
-msgid "Must be a number!"
-msgstr "Must be a number!"
-
-#: paymill.php:170
-msgid "Must be an integer!"
-msgstr "Must be an integer!"
-
-#: paymill.php:171
-msgid "Must be {is}!"
-msgstr "Must be {is}!"
-
-#: paymill.php:172
-msgid "Must not be less than {minimum}!"
-msgstr "Must not be less than {minimum}!"
-
-#: paymill.php:173
-msgid "Must not be more than {maximum}!"
-msgstr "Must not be more than {maximum}!"
-
-#: paymill.php:174
-msgid "Supply a value!"
-msgstr "Supply a value!"
-
-#: lib/config.inc.php:64
+#: lib/config.inc.php:43
msgid "DAY"
msgstr "Day"
-#: lib/config.inc.php:65
+#: lib/config.inc.php:44
msgid "WEEK"
msgstr "Week"
-#: lib/config.inc.php:66
+#: lib/config.inc.php:45
msgid "MONTH"
msgstr "Month"
-#: lib/config.inc.php:67
+#: lib/config.inc.php:46
msgid "YEAR"
msgstr "Year"
-#: lib/config.inc.php:68
+#: lib/config.inc.php:47
msgid "DAYS"
msgstr "Days"
-#: lib/config.inc.php:69
+#: lib/config.inc.php:48
msgid "WEEKS"
msgstr "Weeks"
-#: lib/config.inc.php:70
+#: lib/config.inc.php:49
msgid "MONTHS"
msgstr "Months"
-#: lib/config.inc.php:71
+#: lib/config.inc.php:50
msgid "YEARS"
msgstr "Years"
-#: lib/config.inc.php:73
+#: lib/config.inc.php:52
msgid "50501"
msgstr ""
"The interface to the acquirer does not respond, so we get no response if the "
"transaction was completed successfully"
-#: lib/config.inc.php:74
+#: lib/config.inc.php:53
msgid "50001"
msgstr "The credit card is on a blacklist"
-#: lib/config.inc.php:75
+#: lib/config.inc.php:54
msgid "50201"
msgstr "This customer account is on a black list"
-#: lib/config.inc.php:76
+#: lib/config.inc.php:55
msgid "40103"
msgstr ""
"The credit card limit was exceeded with this transaction, or has already "
"exceeded"
-#: lib/config.inc.php:77
+#: lib/config.inc.php:56
msgid "50102"
msgstr "This card was rejected without reasons"
-#: lib/config.inc.php:78
+#: lib/config.inc.php:57
msgid "50103"
msgstr "The credit card might be manipulated or stolen"
-#: lib/config.inc.php:79
+#: lib/config.inc.php:58
msgid "40105"
msgstr "The credit card expiration date is incorrect"
-#: lib/config.inc.php:80
+#: lib/config.inc.php:59
msgid "40101"
msgstr "The CVV is incorrect"
-#: lib/config.inc.php:81
+#: lib/config.inc.php:60
msgid "40100"
msgstr ""
"There are problems with the credit card. Further details can not be passed"
-#: lib/config.inc.php:82
+#: lib/config.inc.php:61
msgid "40104"
msgstr "The credit card is invalid"
-#: lib/config.inc.php:83
+#: lib/config.inc.php:62
msgid "40001"
msgstr "There is a general problem with the payment data"
-#: lib/config.inc.php:84
+#: lib/config.inc.php:63
msgid "40102"
msgstr "The credit card expired or is not yet valid"
-#: lib/config.inc.php:85
+#: lib/config.inc.php:64
msgid "40106"
msgstr "Credit card brand is required"
-#: lib/config.inc.php:86
+#: lib/config.inc.php:65
msgid "40201"
msgstr "Mismatch with the bank account data combination"
-#: lib/config.inc.php:87
+#: lib/config.inc.php:66
msgid "50300"
msgstr "There is a technical error with 3-D Secure"
-#: lib/config.inc.php:88
+#: lib/config.inc.php:67
msgid "40202"
msgstr "The user authentication failed"
-#: lib/config.inc.php:89
+#: lib/config.inc.php:68
msgid "50502"
msgstr "There is a risk management transaction timeout"
-#: lib/config.inc.php:90
+#: lib/config.inc.php:69
msgid "40301"
msgstr "Currency or amount mismatch"
-#: lib/config.inc.php:91
+#: lib/config.inc.php:70
msgid "40401"
msgstr "The amount is too low or zero"
-#: lib/config.inc.php:92
+#: lib/config.inc.php:71
msgid "40402"
msgstr "The usage field is too long"
-#: lib/config.inc.php:93
+#: lib/config.inc.php:72
msgid "40403"
msgstr "The currency is not configured for the customer"
-#: lib/config.inc.php:94
+#: lib/config.inc.php:73
msgid "50104"
msgstr ""
"The transaction is declined by the authorization system (card restricted by "
"bank)"
-#: lib/config.inc.php:95
+#: lib/config.inc.php:74
msgid "50105"
msgstr "The configuration data is invalid"
-#: lib/config.inc.php:96
+#: lib/config.inc.php:75
msgid "50600"
msgstr "Duplicate transaction"
-#: lib/config.inc.php:98
+#: lib/config.inc.php:77 lib/integration/woocommerce.inc.php:666
+msgid "Token not Found"
+msgstr "Token not Found"
+
+#: lib/config.inc.php:79
msgid "shipping"
msgstr "Shipping"
-#: lib/config.inc.php:99
+#: lib/config.inc.php:80
msgid "company_name"
msgstr "Company Name"
-#: lib/config.inc.php:100
+#: lib/config.inc.php:81
msgid "forename"
msgstr "Forename"
-#: lib/config.inc.php:101
+#: lib/config.inc.php:82
msgid "surname"
msgstr "Surname"
-#: lib/config.inc.php:102
+#: lib/config.inc.php:83
msgid "street"
msgstr "Street"
-#: lib/config.inc.php:103
+#: lib/config.inc.php:84
msgid "number"
msgstr "Number"
-#: lib/config.inc.php:104
+#: lib/config.inc.php:85
msgid "zip"
msgstr "ZIP"
-#: lib/config.inc.php:105
+#: lib/config.inc.php:86
msgid "city"
msgstr "City"
-#: lib/config.inc.php:106
+#: lib/config.inc.php:87
msgid "email"
msgstr "Email"
-#: lib/config.inc.php:107
+#: lib/config.inc.php:88
msgid "phone"
msgstr "Phone"
-#: lib/config.inc.php:119
+#: lib/config.inc.php:91
+msgid "Token or Payment required"
+msgstr "Token or Payment required"
+
+#: lib/config.inc.php:92
+msgid "Subscription already connected"
+msgstr "Subscription already connected"
+
+#: lib/config.inc.php:106
msgid "General Plugin Settings"
msgstr "General Plugin Settings"
-#: lib/config.inc.php:121
+#: lib/config.inc.php:108
msgid "Paymill PRIVATE API key"
msgstr "Paymill PRIVATE API key"
-#: lib/config.inc.php:122
+#: lib/config.inc.php:109
msgid "Paymill PUBLIC API key"
msgstr "Paymill PUBLIC API key"
-#: lib/config.inc.php:123
-msgid "Paymill API endpoint URL"
-msgstr "Paymill API endpoint URL"
-
-#: lib/config.inc.php:124
-msgid "Currency"
-msgstr "Currency"
-
-#: lib/config.inc.php:125
+#: lib/config.inc.php:110
msgid "Display Payment Types"
msgstr "Display Payment Types"
-#: lib/config.inc.php:138
+#: lib/config.inc.php:111
+msgid "Do not load default CSS"
+msgstr "Do not load default CSS"
+
+#: lib/config.inc.php:130
msgid "Number Format: Decimal Point"
msgstr "Number Format: Decimal Point"
-#: lib/config.inc.php:139
+#: lib/config.inc.php:131
msgid "Number Format: Thousands Seperator"
msgstr "Number Format: Thousands Seperator"
-#: lib/config.inc.php:140
+#: lib/config.inc.php:132
+msgid "Currency"
+msgstr "Currency"
+
+#: lib/config.inc.php:133
msgid "Outgoing Email"
msgstr "Outgoing Email"
-#: lib/config.inc.php:141
+#: lib/config.inc.php:134
msgid "Incoming Email"
msgstr "Incoming Email"
-#: lib/config.inc.php:142
+#: lib/config.inc.php:135
msgid "Thank You URL"
-msgstr ""
+msgstr "Thank You URL"
-#: lib/config.inc.php:143
-msgid "Hide Fields"
-msgstr "Hide Fields"
-
-#: lib/config.inc.php:144
-msgid "Do not load default CSS"
-msgstr ""
+#: lib/config.inc.php:136
+msgid "Show Fields"
+msgstr "Show Fields"
-#: lib/config.inc.php:158
+#: lib/config.inc.php:157
msgid "Product"
msgstr "Product"
-#: lib/config.inc.php:159
+#: lib/config.inc.php:158
msgid "Description"
msgstr "Description"
+#: lib/config.inc.php:159
+msgid "Hide Quantity"
+msgstr "Hide Quantity"
+
#: lib/config.inc.php:160
+msgid "Delivery Time"
+msgstr "Delivery Time"
+
+#: lib/config.inc.php:161
msgid "VAT"
msgstr "VAT"
@@ -314,518 +274,572 @@ msgstr "VAT"
msgid "Subscription Offer"
msgstr "Subscription Offer"
-#: lib/config.inc.php:164
+#: lib/config.inc.php:163
msgid "Price"
msgstr "Price"
-#: lib/config.inc.php:165
-msgid "Hide Quantity"
-msgstr "Hide Quantity"
-
-#: lib/config.inc.php:167
-msgid "Delivery Time"
-msgstr "Delivery Time"
-
-#: lib/config.inc.php:182
+#: lib/config.inc.php:186
msgid "Shipping Country"
msgstr "Shipping Country"
-#: lib/config.inc.php:183
+#: lib/config.inc.php:187
msgid "Shipping Costs"
msgstr "Shipping Costs"
-#: lib/config.inc.php:184
+#: lib/config.inc.php:188
msgid "Shipping VAT"
msgstr "Shipping VAT"
-#: lib/config.inc.php:194
+#: lib/config.inc.php:200
msgid "Please insert your API settings here."
msgstr "Please insert your API settings here."
-#: lib/config.inc.php:195
+#: lib/config.inc.php:201
+msgid ""
+"The Paymill Pay Buton is a simple, independent payment solution. As Paymill "
+"for WordPress is GPL licensed, feel free to customize that Pay Button to fit "
+"your needs."
+msgstr ""
+"The Paymill Pay Buton is a simple, independent payment solution. As Paymill "
+"for WordPress is GPL licensed, feel free to customize that Pay Button to fit "
+"your needs."
+
+#: lib/config.inc.php:201
msgid "Common Settings"
msgstr "Common Settings"
-#: lib/config.inc.php:195
-msgid "The Paymill Pay Buton is a simple, independent payment solution."
-msgstr "The Paymill Pay Buton is a simple, independent payment solution."
-
-#: lib/config.inc.php:195
+#: lib/config.inc.php:201
msgid "Configure common settings"
msgstr "Configure common settings"
-#: lib/config.inc.php:195 lib/config.inc.php:196 lib/config.inc.php:197
+#: lib/config.inc.php:201 lib/config.inc.php:202 lib/config.inc.php:203
msgid "Toggle View"
msgstr "Toggle View"
-#: lib/config.inc.php:196
+#: lib/config.inc.php:202
msgid "Products"
msgstr "Products"
-#: lib/config.inc.php:196
+#: lib/config.inc.php:202
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."
+"extends for 5 extra slots when last slot's Product Title 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."
+"extends for 5 extra slots when last slot's Product Title is filled and saved."
-#: lib/config.inc.php:197
+#: lib/config.inc.php:203
msgid "Shipping"
msgstr "Shipping"
-#: lib/config.inc.php:197
+#: lib/config.inc.php:203
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."
+"and extends for 5 extra slots when last slot's Shipping Country 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."
-
-#: lib/config.inc.php:206
-msgid ""
-"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
-msgstr ""
-"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
+"and extends for 5 extra slots when last slot's Shipping Country is filled "
+"and saved."
-#: lib/config.inc.php:207
+#: lib/config.inc.php:266
msgid "Check the boxes which payment types should be announced on payment form"
msgstr ""
"Check the boxes which payment types should be announced on payment form"
-#: lib/config.inc.php:208
-msgid "Insert your Paymill PRIVATE API key."
-msgstr "Insert your Paymill PRIVATE API key."
+#: lib/config.inc.php:267 lib/config.inc.php:429
+msgid "Detailed description of the product"
+msgstr "Detailed description of the product"
-#: lib/config.inc.php:209
-msgid "Insert your Paymill PUBLIC API key."
-msgstr "Insert your Paymill PUBLIC API key."
+#: lib/config.inc.php:268 lib/config.inc.php:430
+msgid "Gross Price of the product, e.g. 40 or 6.99"
+msgstr "Gross Price of the product, e.g. 40 or 6.99"
-#: lib/config.inc.php:210
-msgid "Insert your Paymill endpoint URL."
-msgstr "Insert your Paymill endpoint URL."
+#: lib/config.inc.php:269
+msgid ""
+"If you have created a subscription in your Paymill Cockpit, you can select it here. If selected, "
+"it will overwrite the following settings for this product. Important: For "
+"Performance purposes, subscription plans will be cached. Open this page to "
+"recache it."
+msgstr ""
+"If you have created a subscription in your Paymill Cockpit, you can select it here. If selected, "
+"it will overwrite the following settings for this product. Important: For "
+"Performance purposes, subscription plans will be cached. Open this page to "
+"recache it."
+
+#: lib/config.inc.php:270 lib/config.inc.php:432
+#, 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"
+
+#: lib/config.inc.php:271 lib/config.inc.php:433
+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"
+
+#: lib/config.inc.php:272 lib/config.inc.php:434
+msgid "Hide quantity select field, quantity will be set to 1"
+msgstr "Hide quantity select field, quantity will be set to 1"
-#: lib/config.inc.php:262
+#: lib/config.inc.php:273 lib/config.inc.php:435
+msgid "Allow free amounts (donation feature)"
+msgstr "Allow free amounts (donation feature)"
+
+#: lib/config.inc.php:318
+msgid "Optional: Select Subscription Plan"
+msgstr "Optional: Select Subscription Plan"
+
+#: lib/config.inc.php:340
+msgid ""
+"You may want to gather some additional information from your customers. "
+"Select them here:"
+msgstr ""
+"You may want to gather some additional information from your customers. "
+"Select them here:"
+
+#: lib/config.inc.php:413
msgid "Set a symbol used for decimal point. Default: ."
msgstr "Set a symbol used for decimal point. Default: ."
-#: lib/config.inc.php:263
+#: lib/config.inc.php:414
msgid "Set a symbol used for thousands seperator. Default: ,"
msgstr "Set a symbol used for thousands seperator. Default: ,"
-#: lib/config.inc.php:264
+#: lib/config.inc.php:415
msgid "Outgoing Emailaddress for customer order confirmation mail."
msgstr "Outgoing Emailaddress for customer order confirmation mail."
-#: lib/config.inc.php:265
+#: lib/config.inc.php:416
msgid "Incoming Emailaddress for Copy of customer order confirmation mail."
msgstr "Incoming Emailaddress for Copy of customer order confirmation mail."
-#: lib/config.inc.php:266
+#: lib/config.inc.php:417
msgid "Redirect URL for custom thank your page."
-msgstr ""
-
-#: lib/config.inc.php:268
-msgid "You may want to hide certain fields. Select them here:"
-msgstr "You may want to hide certain fields. Select them here:"
+msgstr "Redirect URL for custom thank your page."
-#: lib/config.inc.php:269
+#: lib/config.inc.php:419
msgid ""
"Advanced users want to fully customize the payment button. Disabling default "
"CSS from Pay Button will make that much easier."
msgstr ""
+"Advanced users want to fully customize the payment button. Disabling default "
+"CSS from Pay Button will make that much easier."
-#: lib/config.inc.php:271
-msgid "Name of the available delivery country, e.g. \"England\""
-msgstr "Name of the available delivery country, e.g. \"England\""
+#: lib/config.inc.php:420
+msgid ""
+"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
+msgstr ""
+"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
-#: lib/config.inc.php:272
-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\""
+#: lib/config.inc.php:421
+msgid "Insert your Paymill PRIVATE API key."
+msgstr "Insert your Paymill PRIVATE API key."
+
+#: lib/config.inc.php:422
+msgid "Insert your Paymill PUBLIC API key."
+msgstr "Insert your Paymill PUBLIC API key."
-#: lib/config.inc.php:273
+#: lib/config.inc.php:424
+msgid "Name of the available delivery country, e.g. England"
+msgstr "Name of the available delivery country, e.g. England"
+
+#: lib/config.inc.php:425
+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"
+
+#: lib/config.inc.php:426
#, 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\""
+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"
-#: lib/config.inc.php:275
+#: lib/config.inc.php:428
msgid "Name of the product"
msgstr "Name of the product"
-#: lib/config.inc.php:276
-msgid "Detailed description of the product"
-msgstr "Detailed description of the product"
-
-#: lib/config.inc.php:277
-msgid "Gross Price of the product, e.g. \"40\" or \"6.99\""
-msgstr "Gross Price of the product, e.g. \"40\" or \"6.99\""
-
-#: lib/config.inc.php:278
+#: lib/config.inc.php:431
msgid ""
"If you have created a subscription in your Paymill Cockpit, can select it "
"here. If selected, it will overwrite the following settings for this "
-"product. Important: For Performance purposes, subscription plans "
-"will be cached. Open this page to recache it."
+"product. Important: For Performance purposes, subscription plans will be "
+"cached. Open this page to recache it."
msgstr ""
"If you have created a subscription in your Paymill Cockpit, can select it "
"here. If selected, it will overwrite the following settings for this "
-"product. Important: For Performance purposes, subscription plans "
-"will be cached. Open this page to recache it."
-
-#: lib/config.inc.php:279
-#, 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\""
+"product. Important: For Performance purposes, subscription plans will be "
+"cached. Open this page to recache it."
-#: lib/config.inc.php:280
-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\""
+#: lib/integration/magicmembers.inc.php:50
+msgid "PAYMILL - Online payments made easy"
+msgstr "PAYMILL - Online payments made easy"
-#: lib/config.inc.php:281
-msgid "Hide quantity select field, quantity will be set to 1"
-msgstr "Hide quantity select field, quantity will be set to 1"
-
-#: lib/config.inc.php:282
-msgid "Allow free amounts (donation feature)"
-msgstr "Allow free amounts (donation feature)"
-
-#: lib/config.inc.php:318
-msgid "Optional: Select Subscription Plan"
-msgstr "Optional: Select Subscription Plan"
-
-#: lib/integration/magicmembers.inc.php:64
-msgid "Paymill - Online payments made easy"
-msgstr "Paymill - Online payments made easy"
-
-#: lib/integration/magicmembers.inc.php:188
+#: lib/integration/magicmembers.inc.php:141
#, php-format
msgid "%s logo updated"
-msgstr ""
+msgstr "%s logo updated"
-#: lib/integration/magicmembers.inc.php:222
+#: lib/integration/magicmembers.inc.php:175
#, php-format
msgid "%s module has been %s"
-msgstr ""
+msgstr "%s module has been %s"
-#: lib/integration/magicmembers.inc.php:312
+#: lib/integration/magicmembers.inc.php:237
#, php-format
msgid "%s settings updated"
-msgstr ""
+msgstr "%s settings updated"
+
+#: lib/integration/magicmembers.inc.php:880
+#: lib/integration/shopplugin.inc.php:167
+#: lib/integration/woocommerce.inc.php:605
+msgid "Order #"
+msgstr "Order #"
+
+#: lib/integration/magicmembers.inc.php:948
+#: lib/integration/pay_button.inc.php:240
+#: lib/integration/shopplugin.inc.php:232
+#: lib/integration/woocommerce.inc.php:658
+msgid "There was an issue with adding you as client for the payment process."
+msgstr "There was an issue with adding you as client for the payment process."
-#: lib/integration/magicmembers.inc.php:584
+#: lib/integration/magicmembers.inc.php:1034
msgid "Error while cancelling subscription"
-msgstr ""
+msgstr "Error while cancelling subscription"
-#: lib/integration/magicmembers.inc.php:610
-#: lib/integration/magicmembers.inc.php:894
+#: lib/integration/magicmembers.inc.php:1058
+#: lib/integration/magicmembers.inc.php:1337
msgid "Transaction Id invalid"
-msgstr ""
+msgstr "Transaction Id invalid"
-#: lib/integration/magicmembers.inc.php:620
-#: lib/integration/magicmembers.inc.php:904
+#: lib/integration/magicmembers.inc.php:1068
+#: lib/integration/magicmembers.inc.php:1347
msgid "Transaction invalid"
-msgstr ""
+msgstr "Transaction invalid"
-#: lib/integration/magicmembers.inc.php:632
-#: lib/integration/magicmembers.inc.php:914
+#: lib/integration/magicmembers.inc.php:1080
+#: lib/integration/magicmembers.inc.php:1357
msgid "Transaction invalid . User id field is empty"
-msgstr ""
+msgstr "Transaction invalid . User id field is empty"
-#: lib/integration/magicmembers.inc.php:985
-#: lib/integration/pay_button.inc.php:184
+#: lib/integration/magicmembers.inc.php:1430
+#: lib/integration/pay_button.inc.php:324
msgid "Pay now"
msgstr "Pay now"
-#: lib/integration/magicmembers.inc.php:1019
-#: lib/integration/magicmembers.inc.php:1050
+#: lib/integration/magicmembers.inc.php:1461
+#: lib/integration/magicmembers.inc.php:1489
msgid "You can pay with:"
msgstr "You can pay with:"
-#: lib/integration/magicmembers.inc.php:1086
+#: lib/integration/magicmembers.inc.php:1521
#, php-format
msgid ""
"You have subscribed to %s via %s, if you wish to unsubscribe, "
"please click the following link. "
msgstr ""
+"You have subscribed to %s via %s, if you wish to unsubscribe, "
+"please click the following link. "
-#: lib/integration/magicmembers.inc.php:1092
-#: lib/integration/magicmembers.inc.php:1104
+#: lib/integration/magicmembers.inc.php:1527
+#: lib/integration/magicmembers.inc.php:1539
msgid "Unsubscribe"
-msgstr ""
+msgstr "Unsubscribe"
-#: lib/integration/magicmembers.inc.php:1138
-msgid "SimpleXML PHP extension must be loaded for Paymill ARB"
-msgstr ""
-
-#: lib/integration/magicmembers.inc.php:1144
-msgid ""
-"Transaction Details API in Paymill must be enabled for Rebill Status Query"
-msgstr ""
-
-#: lib/integration/magicmembers.inc.php:1170
+#: lib/integration/magicmembers.inc.php:1563
msgid "N/A"
-msgstr ""
+msgstr "N/A"
-#: lib/integration/magicmembers.inc.php:1182
-msgid "AUTHORIZE.NET INFO"
-msgstr ""
+#: lib/integration/magicmembers.inc.php:1575
+msgid "Paymill INFO"
+msgstr "Paymill Info"
-#: lib/integration/magicmembers.inc.php:1182
+#: lib/integration/magicmembers.inc.php:1575
msgid "SUBSCRIPTION ID"
-msgstr ""
+msgstr "SUBSCRIPTION ID"
-#: lib/integration/magicmembers.inc.php:1184
+#: lib/integration/magicmembers.inc.php:1577
msgid "TRANSACTION ID"
-msgstr ""
+msgstr "TRANSACTION ID"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Subscription ID"
msgstr "Subscription ID"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Transaction ID"
-msgstr ""
+msgstr "Transaction ID"
-#: lib/integration/magicmembers.inc.php:1500
-#: lib/integration/magicmembers.inc.php:1964
+#: lib/integration/magicmembers.inc.php:1873
+#: lib/integration/magicmembers.inc.php:2403
msgid "Last payment was successful"
-msgstr ""
+msgstr "Last payment was successful"
-#: lib/integration/magicmembers.inc.php:1548
-#: lib/integration/magicmembers.inc.php:2188
+#: lib/integration/magicmembers.inc.php:1921
msgid "Last payment was refunded or denied"
-msgstr ""
+msgstr "Last payment was refunded or denied"
-#: lib/integration/magicmembers.inc.php:1570
-#: lib/integration/magicmembers.inc.php:2206
+#: lib/integration/magicmembers.inc.php:1943
#, php-format
msgid "Last payment is pending. Reason: %s"
-msgstr ""
+msgstr "Last payment is pending. Reason: %s"
-#: lib/integration/magicmembers.inc.php:1590
-#: lib/integration/magicmembers.inc.php:2220
+#: lib/integration/magicmembers.inc.php:1963
#, php-format
msgid "Last payment status: %s"
-msgstr ""
+msgstr "Last payment status: %s"
-#: lib/integration/magicmembers.inc.php:1618
+#: lib/integration/magicmembers.inc.php:1991
msgid "Failed join"
-msgstr ""
+msgstr "Failed join"
-#: lib/integration/magicmembers.inc.php:1668
+#: lib/integration/magicmembers.inc.php:2041
msgid "The post was purchased successfully"
-msgstr ""
+msgstr "The post was purchased successfully"
-#: lib/integration/magicmembers.inc.php:2516
+#: lib/integration/magicmembers.inc.php:2961
msgid "Subscription cancelled"
msgstr "Subscription cancelled"
-#: lib/integration/magicmembers.inc.php:2542
-#: lib/integration/magicmembers.inc.php:3028
+#: lib/integration/magicmembers.inc.php:2987
+#: lib/integration/magicmembers.inc.php:3401
#, php-format
msgid "Subscription awaiting cancellation on %s"
-msgstr ""
+msgstr "Subscription awaiting cancellation on %s"
-#: lib/integration/magicmembers.inc.php:2622
+#: lib/integration/magicmembers.inc.php:3067
#, php-format
msgid ""
"You have successfully unsubscribed. Your account has been marked for "
"cancellation on %s"
msgstr ""
+"You have successfully unsubscribed. Your account has been marked for "
+"cancellation on %s"
-#: lib/integration/magicmembers.inc.php:2918
+#: lib/integration/magicmembers.inc.php:3291
msgid "Last payment cycle processed successfully"
-msgstr ""
+msgstr "Last payment cycle processed successfully"
-#: lib/integration/magicmembers.inc.php:3048
+#: lib/integration/magicmembers.inc.php:3421
msgid "Last payment cycle cancelled"
-msgstr ""
+msgstr "Last payment cycle cancelled"
-#: lib/integration/magicmembers.inc.php:3082
+#: lib/integration/magicmembers.inc.php:3455
msgid "Last payment cycle expired"
-msgstr ""
+msgstr "Last payment cycle expired"
-#: lib/integration/magicmembers.inc.php:3771
-msgid "Error occured"
-msgstr ""
+#: lib/integration/pay_button.inc.php:5
+msgid "Error:"
+msgstr "Error:"
-#: lib/integration/pay_button.inc.php:40
-msgid "Subscription already connected"
-msgstr "Subscription already connected"
-
-#: lib/integration/pay_button.inc.php:68 lib/integration/pay_button.inc.php:71
-#: lib/integration/shopplugin.inc.php:126
+#: lib/integration/pay_button.inc.php:30
msgid "Order"
msgstr "Order"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:114
+#: lib/integration/pay_button.inc.php:163 lib/tpl/pay_button.php:113
msgid "Company Name"
msgstr "Company Name"
-#: lib/integration/pay_button.inc.php:68
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:120
+#: lib/integration/pay_button.inc.php:164 lib/tpl/pay_button.php:117
msgid "Forename"
msgstr "Forename"
-#: lib/integration/pay_button.inc.php:68
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:126
+#: lib/integration/pay_button.inc.php:165 lib/tpl/pay_button.php:121
msgid "Surname"
msgstr "Surname"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:132
+#: lib/integration/pay_button.inc.php:166 lib/tpl/pay_button.php:125
msgid "Street"
msgstr "Street"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:138
+#: lib/integration/pay_button.inc.php:167 lib/tpl/pay_button.php:129
msgid "Number"
msgstr "Number"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:144
+#: lib/integration/pay_button.inc.php:168 lib/tpl/pay_button.php:133
msgid "ZIP"
msgstr "ZIP"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:150
+#: lib/integration/pay_button.inc.php:169 lib/tpl/pay_button.php:137
msgid "City"
msgstr "City"
-#: lib/integration/pay_button.inc.php:68
+#: lib/integration/pay_button.inc.php:170
msgid "Country"
msgstr "Country"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:156
+#: lib/integration/pay_button.inc.php:171 lib/tpl/pay_button.php:145
msgid "Email"
msgstr "Email"
-#: lib/integration/pay_button.inc.php:68 lib/tpl/pay_button.php:162
+#: lib/integration/pay_button.inc.php:172 lib/tpl/pay_button.php:141
msgid "Phone"
msgstr "Phone"
-#: lib/integration/pay_button.inc.php:103
-msgid "There was an issue with adding you as client for the payment process."
-msgstr ""
-
-#: lib/integration/pay_button.inc.php:111
+#: lib/integration/pay_button.inc.php:190
msgid "Confirmation of your Order"
msgstr "Confirmation of your Order"
-#: lib/integration/pay_button.inc.php:112
+#: lib/integration/pay_button.inc.php:196
msgid "New Order received"
msgstr "New Order received"
-#: lib/integration/pay_button.inc.php:129
+#: lib/integration/pay_button.inc.php:258
msgid "Shows a Paymill Payment Button."
msgstr "Shows a Paymill Payment Button."
-#: lib/integration/pay_button.inc.php:147
+#: lib/integration/pay_button.inc.php:281
msgid "Thank you for your order."
msgstr "Thank you for your order."
-#: lib/integration/pay_button.inc.php:182
+#: lib/integration/pay_button.inc.php:319
msgid "Payment"
msgstr "Payment"
-#: lib/integration/pay_button.inc.php:207
+#: lib/integration/pay_button.inc.php:349
msgid "Title:"
msgstr "Title:"
-#: lib/integration/pay_button.inc.php:214
+#: lib/integration/pay_button.inc.php:356
msgid "Show these products only:"
msgstr "Show these products only:"
-#: lib/integration/pay_button.inc.php:217
+#: lib/integration/pay_button.inc.php:359
msgid "All Products"
msgstr "All Products"
-#: lib/integration/woocommerce.inc.php:113
+#: lib/integration/woocommerce.inc.php:410
msgid "Enable/Disable"
msgstr "Enable/Disable"
-#: lib/integration/woocommerce.inc.php:115
+#: lib/integration/woocommerce.inc.php:412
msgid "Enable PAYMILL Payment"
msgstr "Enable PAYMILL Payment"
-#: lib/integration/woocommerce.inc.php:119
+#: lib/integration/woocommerce.inc.php:416
msgid "Title"
msgstr "Title"
-#: lib/integration/woocommerce.inc.php:121
+#: lib/integration/woocommerce.inc.php:418
msgid "This controls the title which the user sees during checkout."
msgstr "This controls the title which the user sees during checkout."
-#: lib/integration/woocommerce.inc.php:122
+#: lib/integration/woocommerce.inc.php:419
msgid "PAYMILL Payment"
msgstr "PAYMILL Payment"
-#: lib/integration/woocommerce.inc.php:126
+#: lib/integration/woocommerce.inc.php:423
msgid "Customer Message"
msgstr "Customer Message"
-#: lib/integration/woocommerce.inc.php:272
-msgid "Subscription already ordered and cannot be purchased twice."
-msgstr "Subscription already ordered and cannot be purchased twice."
+#: lib/integration/woocommerce.inc.php:536
+msgid "Subscription already subscribed."
+msgstr "Subscription already subscribed."
+
+#: lib/integration/woocommerce.inc.php:632
+msgid "Awaiting payment confirmation from Paymill."
+msgstr "Awaiting payment confirmation from Paymill."
-#: lib/tpl/checkout_form.php:26
+#: lib/tpl/checkout_form.php:24
msgid "Credit Card"
msgstr "Credit Card"
-#: lib/tpl/checkout_form.php:27
-msgid "Debit Payment"
-msgstr "Debit Payment"
+#: lib/tpl/checkout_form.php:31
+msgid "SEPA"
+msgstr "SEPA"
-#: lib/tpl/checkout_form.php:32
-msgid "Name"
-msgstr "Name"
+#: lib/tpl/checkout_form.php:38
+msgid "ELV"
+msgstr "ELV"
-#: lib/tpl/checkout_form.php:37
-msgid "Credit Card Number"
-msgstr "Credit Card Number"
+#: lib/tpl/checkout_form.php:42
+msgid "Holder Name"
+msgstr "Holder Name"
-#: lib/tpl/checkout_form.php:41
-msgid "Expire Date (MM/YYYY)"
-msgstr "Expire Date"
+#: lib/tpl/checkout_form.php:46
+msgid "Card Number"
+msgstr "Card Number"
-#: lib/tpl/checkout_form.php:45
+#: lib/tpl/checkout_form.php:49
+msgid "Expire Date: "
+msgstr "Expire Date: "
+
+#: lib/tpl/checkout_form.php:50
+msgid "MM"
+msgstr "MM"
+
+#: lib/tpl/checkout_form.php:51
+msgid "YYYY"
+msgstr "YYYY"
+
+#: lib/tpl/checkout_form.php:52
msgid "CVC"
msgstr "CVC"
-#: lib/tpl/checkout_form.php:50
-msgid "Account #"
-msgstr "Account #"
+#: lib/tpl/checkout_form.php:57
+msgid "IBAN"
+msgstr "IBAN"
-#: lib/tpl/checkout_form.php:54
-msgid "Bank code"
-msgstr "Bank code"
+#: lib/tpl/checkout_form.php:60
+msgid "BIC"
+msgstr "BIC"
-#: lib/tpl/pay_button.php:35
+#: lib/tpl/checkout_form.php:65
+msgid "Account Number"
+msgstr "Account Number"
+
+#: lib/tpl/checkout_form.php:68
+msgid "Bank Code"
+msgstr "Bank Code"
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:74
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:5
+#, php-format
+msgid "%s Logo"
+msgstr "%s Logo"
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "Yes"
+msgstr "Yes"
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "No"
+msgstr "No"
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+msgid "Enabled"
+msgstr "Enabled"
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+msgid "Disabled"
+msgstr "Disabled"
+
+#: lib/tpl/pay_button.php:41
msgid "S"
-msgstr ""
+msgstr "S"
-#: lib/tpl/pay_button.php:38 lib/tpl/pay_button.php:63
+#: lib/tpl/pay_button.php:44 lib/tpl/pay_button.php:77
msgid "% VAT included."
msgstr "% VAT included."
-#: lib/tpl/pay_button.php:39 lib/tpl/pay_button.php:64
+#: lib/tpl/pay_button.php:45 lib/tpl/pay_button.php:78
msgid "Delivery Time: "
msgstr "Delivery Time: "
-#: lib/tpl/pay_button.php:81
+#: lib/tpl/pay_button.php:62
+msgid "á "
+msgstr "á "
+
+#: lib/tpl/pay_button.php:93
msgid "Choose Country"
msgstr "Choose Country"
-#: lib/tpl/pay_button.php:93
+#: lib/tpl/pay_button.php:105
msgid "Total Price:"
msgstr "Total Price:"
-#: lib/tpl/pay_button.php:111
+#: lib/tpl/pay_button.php:110
msgid "Address"
msgstr "Address"
-
-#~ msgid "Free Amount"
-#~ msgstr "Free Amount"
-
-#~ msgid "Paymill Payment"
-#~ msgstr "Paymill Payment"
diff --git a/lib/translate/paymill-sr_RS.po b/lib/translate/paymill-sr_RS.po
index dc5822d..ea4f8b4 100644
--- a/lib/translate/paymill-sr_RS.po
+++ b/lib/translate/paymill-sr_RS.po
@@ -1,286 +1,248 @@
msgid ""
msgstr ""
"Project-Id-Version: Paymill\n"
-"POT-Creation-Date: 2013-10-08 04:54+0100\n"
-"PO-Revision-Date: 2013-11-12 15:22+0100\n"
+"POT-Creation-Date: 2014-05-05 22:29+0100\n"
+"PO-Revision-Date: 2014-05-05 22:29+0100\n"
"Last-Translator: Borisa Djuraskovic \n"
"Language-Team: Matthias Reuter \n"
-"Language: DE\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.7\n"
-"X-Poedit-KeywordsList: esc_attr__;__;_e\n"
+"X-Generator: Poedit 1.6.5\n"
+"X-Poedit-KeywordsList: __\n"
"X-Poedit-Basepath: ../../\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"
-#: paymill.php:154
-msgid "Invalid Credit Card Number"
-msgstr "Nepostojeći broj kreditne kartice"
-
-#: paymill.php:155
-msgid "Invalid Expiration Date"
-msgstr "Nepostojeći rok isteka"
-
-#: paymill.php:156
-msgid "Invalid CVC"
-msgstr "Nepostojeći CVC"
-
-#: paymill.php:157
-msgid "Invalid Account Number"
-msgstr "Nepostojeći broj računa"
-
-#: paymill.php:158
-msgid "Invalid Bank Code"
-msgstr "Nepostojeći kod banke"
-
-#: paymill.php:167
-msgid "Must be {is} characters long!"
-msgstr "Mora imati {is} characters long! karaktera!"
-
-#: paymill.php:168
-msgid "Must not be less than {minimum} characters long!"
-msgstr "Ne sme imati manje od {minimum} karaktera!"
-
-#: paymill.php:169
-msgid "Must not be more than {maximum} characters long!"
-msgstr "Ne sme imati više od {maksimum} karaktera"
-
-#: paymill.php:170
-msgid "Must be a number!"
-msgstr "Mora biti broj!"
-
-#: paymill.php:171
-msgid "Must be an integer!"
-msgstr "Mora biti integer!"
-
-#: paymill.php:172
-msgid "Must be {is}!"
-msgstr "Mora biti {is}!"
-
-#: paymill.php:173
-msgid "Must not be less than {minimum}!"
-msgstr "Ne sme biti manje od {minimum}!"
-
-#: paymill.php:174
-msgid "Must not be more than {maximum}!"
-msgstr "Ne sme biti više od {maksimum}!"
-
-#: paymill.php:175
-msgid "Supply a value!"
-msgstr "Omogući vrednost!"
-
-#: lib/config.inc.php:64
+#: lib/config.inc.php:43
msgid "DAY"
msgstr "DAN"
-#: lib/config.inc.php:65
+#: lib/config.inc.php:44
msgid "WEEK"
msgstr "NEDELJA"
-#: lib/config.inc.php:66
+#: lib/config.inc.php:45
msgid "MONTH"
msgstr "MESEC"
-#: lib/config.inc.php:67
+#: lib/config.inc.php:46
msgid "YEAR"
msgstr "GODINA"
-#: lib/config.inc.php:68
+#: lib/config.inc.php:47
msgid "DAYS"
msgstr "DANI"
-#: lib/config.inc.php:69
+#: lib/config.inc.php:48
msgid "WEEKS"
msgstr "NEDELJE"
-#: lib/config.inc.php:70
+#: lib/config.inc.php:49
msgid "MONTHS"
msgstr "MESECI"
-#: lib/config.inc.php:71
+#: lib/config.inc.php:50
msgid "YEARS"
msgstr "GODINE"
-#: lib/config.inc.php:73
+#: lib/config.inc.php:52
msgid "50501"
msgstr "50501"
-#: lib/config.inc.php:74
+#: lib/config.inc.php:53
msgid "50001"
msgstr "50001"
-#: lib/config.inc.php:75
+#: lib/config.inc.php:54
msgid "50201"
msgstr "50201"
-#: lib/config.inc.php:76
+#: lib/config.inc.php:55
msgid "40103"
msgstr "40103"
-#: lib/config.inc.php:77
+#: lib/config.inc.php:56
msgid "50102"
msgstr "50102"
-#: lib/config.inc.php:78
+#: lib/config.inc.php:57
msgid "50103"
msgstr "50103"
-#: lib/config.inc.php:79
+#: lib/config.inc.php:58
msgid "40105"
msgstr "40105"
-#: lib/config.inc.php:80
+#: lib/config.inc.php:59
msgid "40101"
msgstr "40101"
-#: lib/config.inc.php:81
+#: lib/config.inc.php:60
msgid "40100"
msgstr "40100"
-#: lib/config.inc.php:82
+#: lib/config.inc.php:61
msgid "40104"
msgstr "40104"
-#: lib/config.inc.php:83
+#: lib/config.inc.php:62
msgid "40001"
msgstr "40001"
-#: lib/config.inc.php:84
+#: lib/config.inc.php:63
msgid "40102"
msgstr "40102"
-#: lib/config.inc.php:85
+#: lib/config.inc.php:64
msgid "40106"
msgstr "40106"
-#: lib/config.inc.php:86
+#: lib/config.inc.php:65
msgid "40201"
msgstr "40201"
-#: lib/config.inc.php:87
+#: lib/config.inc.php:66
msgid "50300"
msgstr "50300"
-#: lib/config.inc.php:88
+#: lib/config.inc.php:67
msgid "40202"
msgstr "40202"
-#: lib/config.inc.php:89
+#: lib/config.inc.php:68
msgid "50502"
msgstr "50502"
-#: lib/config.inc.php:90
+#: lib/config.inc.php:69
msgid "40301"
msgstr "40301"
-#: lib/config.inc.php:91
+#: lib/config.inc.php:70
msgid "40401"
msgstr "40401"
-#: lib/config.inc.php:92
+#: lib/config.inc.php:71
msgid "40402"
msgstr "40402"
-#: lib/config.inc.php:93
+#: lib/config.inc.php:72
msgid "40403"
msgstr "40403"
-#: lib/config.inc.php:94
+#: lib/config.inc.php:73
msgid "50104"
msgstr "50104"
-#: lib/config.inc.php:95
+#: lib/config.inc.php:74
msgid "50105"
msgstr "50105"
-#: lib/config.inc.php:96
+#: lib/config.inc.php:75
msgid "50600"
msgstr "50600"
-#: lib/config.inc.php:98
+#: lib/config.inc.php:77 lib/integration/woocommerce.inc.php:666
+msgid "Token not Found"
+msgstr ""
+
+#: lib/config.inc.php:79
msgid "shipping"
msgstr "slanje"
-#: lib/config.inc.php:99
+#: lib/config.inc.php:80
msgid "company_name"
msgstr "ime_kompanije"
-#: lib/config.inc.php:100
+#: lib/config.inc.php:81
msgid "forename"
msgstr "ime"
-#: lib/config.inc.php:101
+#: lib/config.inc.php:82
msgid "surname"
msgstr "prezime"
-#: lib/config.inc.php:102
+#: lib/config.inc.php:83
msgid "street"
msgstr "ulica"
-#: lib/config.inc.php:103
+#: lib/config.inc.php:84
msgid "number"
msgstr "broj"
-#: lib/config.inc.php:104
+#: lib/config.inc.php:85
msgid "zip"
msgstr "poštanski broj"
-#: lib/config.inc.php:105
+#: lib/config.inc.php:86
msgid "city"
msgstr "grad"
-#: lib/config.inc.php:106
+#: lib/config.inc.php:87
msgid "email"
msgstr "email"
-#: lib/config.inc.php:107
+#: lib/config.inc.php:88
msgid "phone"
msgstr "telefon"
-#: lib/config.inc.php:119
+#: lib/config.inc.php:91
+msgid "Token or Payment required"
+msgstr ""
+
+#: lib/config.inc.php:92
+#, fuzzy
+msgid "Subscription already connected"
+msgstr "Pretplata ukinuta"
+
+#: lib/config.inc.php:106
msgid "General Plugin Settings"
msgstr "Opšte postavke plugina"
-#: lib/config.inc.php:121
+#: lib/config.inc.php:108
msgid "Paymill PRIVATE API key"
msgstr "Paymill PRIVATNI API ključ"
-#: lib/config.inc.php:122
+#: lib/config.inc.php:109
msgid "Paymill PUBLIC API key"
msgstr "Paymill JAVNI API ključ"
-#: lib/config.inc.php:123
-msgid "Paymill API endpoint URL"
-msgstr "Paymill URL API krajnja tačka"
-
-#: lib/config.inc.php:124
-msgid "Currency"
-msgstr "Valuta"
-
-#: lib/config.inc.php:125
+#: lib/config.inc.php:110
msgid "Display Payment Types"
msgstr "Prikazati tipove plaćanja"
-#: lib/config.inc.php:138
+#: lib/config.inc.php:111
+msgid "Do not load default CSS"
+msgstr ""
+
+#: lib/config.inc.php:130
msgid "Number Format: Decimal Point"
msgstr "Broj formata:decimalni"
-#: lib/config.inc.php:139
+#: lib/config.inc.php:131
msgid "Number Format: Thousands Seperator"
msgstr "Broj formata: odvajanje hiljada"
-#: lib/config.inc.php:140
+#: lib/config.inc.php:132
+msgid "Currency"
+msgstr "Valuta"
+
+#: lib/config.inc.php:133
msgid "Outgoing Email"
msgstr "Odlazeći email"
-#: lib/config.inc.php:141
+#: lib/config.inc.php:134
msgid "Incoming Email"
msgstr "Dolazeći emai"
-#: lib/config.inc.php:142
-msgid "Hide Fields"
+#: lib/config.inc.php:135
+msgid "Thank You URL"
+msgstr ""
+
+#: lib/config.inc.php:136
+#, fuzzy
+msgid "Show Fields"
msgstr "Sakriti polja"
#: lib/config.inc.php:157
@@ -292,10 +254,18 @@ msgid "Description"
msgstr "Opis"
#: lib/config.inc.php:159
+msgid "Hide Quantity"
+msgstr "Sakriti kvantitet"
+
+#: lib/config.inc.php:160
+msgid "Delivery Time"
+msgstr "Vreme dostave"
+
+#: lib/config.inc.php:161
msgid "VAT"
msgstr "VAT"
-#: lib/config.inc.php:161
+#: lib/config.inc.php:162
msgid "Subscription Offer"
msgstr "Ponuda za pretplatu"
@@ -303,229 +273,265 @@ msgstr "Ponuda za pretplatu"
msgid "Price"
msgstr "Cena"
-#: lib/config.inc.php:164
-msgid "Hide Quantity"
-msgstr "Sakriti kvantitet"
-
-#: lib/config.inc.php:165
-msgid "Free Amount"
-msgstr "Besplatna količina"
-
-#: lib/config.inc.php:166
-msgid "Delivery Time"
-msgstr "Vreme dostave"
-
-#: lib/config.inc.php:181
+#: lib/config.inc.php:186
msgid "Shipping Country"
msgstr "Zemlja za slanje"
-#: lib/config.inc.php:182
+#: lib/config.inc.php:187
msgid "Shipping Costs"
msgstr "Cena slanja"
-#: lib/config.inc.php:183
+#: lib/config.inc.php:188
msgid "Shipping VAT"
msgstr "VAT slanja"
-#: lib/config.inc.php:193
+#: lib/config.inc.php:200
msgid "Please insert your API settings here."
msgstr "Unesite vaše API postavke ovde."
-#: lib/config.inc.php:194
+#: lib/config.inc.php:201
+msgid ""
+"The Paymill Pay Buton is a simple, independent payment solution. As Paymill "
+"for WordPress is GPL licensed, feel free to customize that Pay Button to fit "
+"your needs."
+msgstr ""
+
+#: lib/config.inc.php:201
msgid "Common Settings"
msgstr "Uobičajne postavke"
-#: lib/config.inc.php:194
-msgid "The Paymill Pay Buton is a simple, independent payment solution."
-msgstr "Paymill Pay Buton je jednostavno nezavisno rešenje za plaćanje."
-
-#: lib/config.inc.php:194
+#: lib/config.inc.php:201
msgid "Configure common settings"
msgstr "Konfigurisati uobičajne postavke"
-#: lib/config.inc.php:194 lib/config.inc.php:195 lib/config.inc.php:196
+#: lib/config.inc.php:201 lib/config.inc.php:202 lib/config.inc.php:203
msgid "Toggle View"
msgstr "Toggle pregled"
-#: lib/config.inc.php:195
+#: lib/config.inc.php:202
msgid "Products"
msgstr "Proizvodi"
-#: lib/config.inc.php:195
+#: lib/config.inc.php:202
+#, fuzzy
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."
+"extends for 5 extra slots when last slot's Product Title is filled and saved."
msgstr ""
"Konfigurisati proizvode za Pay Button. Ova lista ima dinamičnu dužinu i "
"proširenje za 5 dodatnih slotova kada je poslednji popunjen i sačuvan."
-#: lib/config.inc.php:196
+#: lib/config.inc.php:203
msgid "Shipping"
msgstr "Slanje"
-#: lib/config.inc.php:196
+#: lib/config.inc.php:203
+#, fuzzy
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."
+"and extends for 5 extra slots when last slot's Shipping Country is filled "
+"and saved."
msgstr ""
"Podesiti šemlje za slanje i cenu slanja. Ova lista ima dinamičnu dužinu i "
"proširenje za 5 dodatnih slotova kada je poslednji popunjen i sačuvan."
-#: lib/config.inc.php:205
-msgid ""
-"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
-msgstr ""
-"ValutaISO 4217 e.g. \"EUR\" or \"GBP\""
-
-#: lib/config.inc.php:206
+#: lib/config.inc.php:266
msgid "Check the boxes which payment types should be announced on payment form"
msgstr ""
"Čekirati kvadrate koji tipovi plaćanja bi trebali da budu objavljeni u formi "
"plaćanja"
-#: lib/config.inc.php:207
-msgid "Insert your Paymill PRIVATE API key."
-msgstr "Unsite vaš Paymill PRIVATNI API ključ."
+#: lib/config.inc.php:267 lib/config.inc.php:429
+msgid "Detailed description of the product"
+msgstr "Detaljni opis proizvoda"
-#: lib/config.inc.php:208
-msgid "Insert your Paymill PUBLIC API key."
-msgstr "Unsite vaš Paymill JAVNI API ključ."
+#: lib/config.inc.php:268 lib/config.inc.php:430
+#, fuzzy
+msgid "Gross Price of the product, e.g. 40 or 6.99"
+msgstr "Bruto naknada proizvoda e.g. \"40\" or \"6.99\""
+
+#: lib/config.inc.php:269
+#, fuzzy
+msgid ""
+"If you have created a subscription in your Paymill Cockpit, you can select it here. If selected, "
+"it will overwrite the following settings for this product. Important: For "
+"Performance purposes, subscription plans will be cached. Open this page to "
+"recache it."
+msgstr ""
+"Ako ste napravili pretplatu u vašem Paymill Cockpit, selektujte ga ovde. Ako "
+"je selektovanno, pisaće preko sledećih postavki ovog proizvoda."
+"Important: Za potrebe performansi, plan pretplate će biti cache-"
+"iran. Otvorite ovu stranicu i recache-irajte ga."
+
+#: lib/config.inc.php:270 lib/config.inc.php:432
+#, fuzzy, 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\""
+
+#: lib/config.inc.php:271 lib/config.inc.php:433
+#, fuzzy
+msgid "Delivery Time of the product, e.g. 2 Days or 1 Week"
+msgstr "Vreme dostave proizvoda e.g. \"2 Days\" or \"1 Week\""
+
+#: lib/config.inc.php:272 lib/config.inc.php:434
+msgid "Hide quantity select field, quantity will be set to 1"
+msgstr "Sakriti kvanititet izabranog polja, kvantitet će biti namešten na 1"
+
+#: lib/config.inc.php:273 lib/config.inc.php:435
+msgid "Allow free amounts (donation feature)"
+msgstr "Dozvoliti bespatne količine (karakteristika donacije)"
-#: lib/config.inc.php:209
-msgid "Insert your Paymill endpoint URL."
-msgstr "Unesite vaš Paymill URL krajnje tačke."
+#: lib/config.inc.php:318
+msgid "Optional: Select Subscription Plan"
+msgstr "Opcionalno: Izabrati plan pretplate"
-#: lib/config.inc.php:261
+#: lib/config.inc.php:340
+#, fuzzy
+msgid ""
+"You may want to gather some additional information from your customers. "
+"Select them here:"
+msgstr "Možda ćete želeti da sakrijete odredjena polja. Selektujte ih ovde:"
+
+#: lib/config.inc.php:413
msgid "Set a symbol used for decimal point. Default: ."
msgstr "Podesite simbol za decimalu. Default:"
-#: lib/config.inc.php:262
+#: lib/config.inc.php:414
msgid "Set a symbol used for thousands seperator. Default: ,"
msgstr "Podesite simbol za razdvajanje hiljada. Defaut:"
-#: lib/config.inc.php:263
+#: lib/config.inc.php:415
msgid "Outgoing Emailaddress for customer order confirmation mail."
msgstr "Odlazeća email adresa za potvrdni mail kupca."
-#: lib/config.inc.php:264
+#: lib/config.inc.php:416
msgid "Incoming Emailaddress for Copy of customer order confirmation mail."
msgstr "Dolazeća email adresa za kopiju potvrdnog maila kupca."
-#: lib/config.inc.php:266
-msgid "You may want to hide certain fields. Select them here:"
-msgstr "Možda ćete želeti da sakrijete odredjena polja. Selektujte ih ovde:"
+#: lib/config.inc.php:417
+msgid "Redirect URL for custom thank your page."
+msgstr ""
+
+#: lib/config.inc.php:419
+msgid ""
+"Advanced users want to fully customize the payment button. Disabling default "
+"CSS from Pay Button will make that much easier."
+msgstr ""
+
+#: lib/config.inc.php:420
+msgid ""
+"Currency, ISO 4217 e.g. \"EUR\" or \"GBP\""
+msgstr ""
+"ValutaISO 4217 e.g. \"EUR\" or \"GBP\""
+
+#: lib/config.inc.php:421
+msgid "Insert your Paymill PRIVATE API key."
+msgstr "Unsite vaš Paymill PRIVATNI API ključ."
-#: lib/config.inc.php:268
-msgid "Name of the available delivery country, e.g. \"England\""
+#: lib/config.inc.php:422
+msgid "Insert your Paymill PUBLIC API key."
+msgstr "Unsite vaš Paymill JAVNI API ključ."
+
+#: lib/config.inc.php:424
+#, fuzzy
+msgid "Name of the available delivery country, e.g. England"
msgstr "Ime zemlje zadostavu, npr: \"Engleska\""
-#: lib/config.inc.php:269
-msgid "Gross fee for the flat shipping costs., e.g. \"7\" or \"4.90\""
+#: lib/config.inc.php:425
+#, fuzzy
+msgid "Gross fee for the flat shipping costs., e.g. 7 or 4.90"
msgstr "Bruto naknada za troškove slanja e.g. \"7\" or \"4.90\""
-#: lib/config.inc.php:270
-#, php-format
-msgid ""
-"Value-Added-Tax Rate in % for the flat shipping costs., e.g. \"19\" or \"7\""
+#: lib/config.inc.php:426
+#, fuzzy, 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\""
-#: lib/config.inc.php:272
+#: lib/config.inc.php:428
msgid "Name of the product"
msgstr "Ime proizvoda"
-#: lib/config.inc.php:273
-msgid "Detailed description of the product"
-msgstr "Detaljni opis proizvoda"
-
-#: lib/config.inc.php:274
-msgid "Gross Price of the product, e.g. \"40\" or \"6.99\""
-msgstr "Bruto naknada proizvoda e.g. \"40\" or \"6.99\""
-
-#: lib/config.inc.php:275
+#: lib/config.inc.php:431
+#, fuzzy
msgid ""
"If you have created a subscription in your Paymill Cockpit, can select it "
"here. If selected, it will overwrite the following settings for this "
-"product. Important: For Performance purposes, subscription plans "
-"will be cached. Open this page to recache it."
+"product. Important: For Performance purposes, subscription plans will be "
+"cached. Open this page to recache it."
msgstr ""
"Ako ste napravili pretplatu u vašem Paymill Cockpit, selektujte ga ovde. Ako "
"je selektovanno, pisaće preko sledećih postavki ovog proizvoda."
"Important: Za potrebe performansi, plan pretplate će biti cache-"
"iran. Otvorite ovu stranicu i recache-irajte ga."
-#: lib/config.inc.php:276
-#, 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\""
-
-#: lib/config.inc.php:277
-msgid "Delivery Time of the product, e.g. \"2 Days\" or \"1 Week\""
-msgstr "Vreme dostave proizvoda e.g. \"2 Days\" or \"1 Week\""
-
-#: lib/config.inc.php:278
-msgid "Hide quantity select field, quantity will be set to 1"
-msgstr "Sakriti kvanititet izabranog polja, kvantitet će biti namešten na 1"
-
-#: lib/config.inc.php:279
-msgid "Allow free amounts (donation feature)"
-msgstr "Dozvoliti bespatne količine (karakteristika donacije)"
-
-#: lib/config.inc.php:315
-msgid "Optional: Select Subscription Plan"
-msgstr "Opcionalno: Izabrati plan pretplate"
-
-#: lib/integration/magicmembers.inc.php:64
-msgid "Paymill - Online payments made easy"
+#: lib/integration/magicmembers.inc.php:50
+#, fuzzy
+msgid "PAYMILL - Online payments made easy"
msgstr "Paymill - Lako online plaćanje"
-#: lib/integration/magicmembers.inc.php:188
+#: lib/integration/magicmembers.inc.php:141
#, php-format
msgid "%s logo updated"
msgstr "%s logo updated-ovan"
-#: lib/integration/magicmembers.inc.php:222
+#: lib/integration/magicmembers.inc.php:175
#, php-format
msgid "%s module has been %s"
msgstr "%s module je %s"
-#: lib/integration/magicmembers.inc.php:312
+#: lib/integration/magicmembers.inc.php:237
#, php-format
msgid "%s settings updated"
msgstr "%s postavke update-ovane"
-#: lib/integration/magicmembers.inc.php:584
+#: lib/integration/magicmembers.inc.php:880
+#: lib/integration/shopplugin.inc.php:167
+#: lib/integration/woocommerce.inc.php:605
+#, fuzzy
+msgid "Order #"
+msgstr "Naručiti"
+
+#: lib/integration/magicmembers.inc.php:948
+#: lib/integration/pay_button.inc.php:240
+#: lib/integration/shopplugin.inc.php:232
+#: lib/integration/woocommerce.inc.php:658
+msgid "There was an issue with adding you as client for the payment process."
+msgstr ""
+
+#: lib/integration/magicmembers.inc.php:1034
msgid "Error while cancelling subscription"
msgstr "Greška prilikom ukidanja pretlate"
-#: lib/integration/magicmembers.inc.php:610
-#: lib/integration/magicmembers.inc.php:894
+#: lib/integration/magicmembers.inc.php:1058
+#: lib/integration/magicmembers.inc.php:1337
msgid "Transaction Id invalid"
msgstr "Transakcija id-a nepostojeća"
-#: lib/integration/magicmembers.inc.php:620
-#: lib/integration/magicmembers.inc.php:904
+#: lib/integration/magicmembers.inc.php:1068
+#: lib/integration/magicmembers.inc.php:1347
msgid "Transaction invalid"
msgstr "Transakcija nepostojeća"
-#: lib/integration/magicmembers.inc.php:632
-#: lib/integration/magicmembers.inc.php:914
+#: lib/integration/magicmembers.inc.php:1080
+#: lib/integration/magicmembers.inc.php:1357
msgid "Transaction invalid . User id field is empty"
msgstr "Transakcija nepostojeća. Polje id korisnika je prazno"
-#: lib/integration/magicmembers.inc.php:985
-#: lib/integration/pay_button.inc.php:169
+#: lib/integration/magicmembers.inc.php:1430
+#: lib/integration/pay_button.inc.php:324
msgid "Pay now"
msgstr "Platiti sada"
-#: lib/integration/magicmembers.inc.php:1019
-#: lib/integration/magicmembers.inc.php:1050
+#: lib/integration/magicmembers.inc.php:1461
+#: lib/integration/magicmembers.inc.php:1489
msgid "You can pay with:"
msgstr "Možete platiti sa:"
-#: lib/integration/magicmembers.inc.php:1086
+#: lib/integration/magicmembers.inc.php:1521
#, php-format
msgid ""
"You have subscribed to %s via %s, if you wish to unsubscribe, "
@@ -534,87 +540,73 @@ msgstr ""
"Pretplatili ste se na %s via %s, ako ne želite pretplatu "
"kliknite na ovaj link. "
-#: lib/integration/magicmembers.inc.php:1092
-#: lib/integration/magicmembers.inc.php:1104
+#: lib/integration/magicmembers.inc.php:1527
+#: lib/integration/magicmembers.inc.php:1539
msgid "Unsubscribe"
msgstr "Ukinuti pretplatu"
-#: lib/integration/magicmembers.inc.php:1138
-msgid "SimpleXML PHP extension must be loaded for Paymill ARB"
-msgstr "SimpleXML PHP ekstenzima mora biti učitana za Paymill ARB"
-
-#: lib/integration/magicmembers.inc.php:1144
-msgid ""
-"Transaction Details API in Paymill must be enabled for Rebill Status Query"
-msgstr ""
-"Detalji API transakcije u Paymill moraju biti omogućeni za Rebill Status "
-"Query"
-
-#: lib/integration/magicmembers.inc.php:1170
+#: lib/integration/magicmembers.inc.php:1563
msgid "N/A"
msgstr "N/A"
-#: lib/integration/magicmembers.inc.php:1182
-msgid "AUTHORIZE.NET INFO"
-msgstr "AUTHORIZE.NET INFO"
+#: lib/integration/magicmembers.inc.php:1575
+msgid "Paymill INFO"
+msgstr ""
-#: lib/integration/magicmembers.inc.php:1182
+#: lib/integration/magicmembers.inc.php:1575
msgid "SUBSCRIPTION ID"
msgstr "ID PRETPLATE "
-#: lib/integration/magicmembers.inc.php:1184
+#: lib/integration/magicmembers.inc.php:1577
msgid "TRANSACTION ID"
msgstr "ID TRANSAKCIJE"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Subscription ID"
msgstr "ID pretplate"
-#: lib/integration/magicmembers.inc.php:1218
+#: lib/integration/magicmembers.inc.php:1607
msgid "Transaction ID"
msgstr "ID transakcije"
-#: lib/integration/magicmembers.inc.php:1500
-#: lib/integration/magicmembers.inc.php:1964
+#: lib/integration/magicmembers.inc.php:1873
+#: lib/integration/magicmembers.inc.php:2403
msgid "Last payment was successful"
msgstr "Poslednja uplata je bila uspešna"
-#: lib/integration/magicmembers.inc.php:1548
-#: lib/integration/magicmembers.inc.php:2188
+#: lib/integration/magicmembers.inc.php:1921
msgid "Last payment was refunded or denied"
msgstr "Poslednja uplata je refundirana ili odbijena"
-#: lib/integration/magicmembers.inc.php:1570
-#: lib/integration/magicmembers.inc.php:2206
+#: lib/integration/magicmembers.inc.php:1943
#, php-format
msgid "Last payment is pending. Reason: %s"
msgstr "Čeka se poslednja uplata. Razlog: %s"
-#: lib/integration/magicmembers.inc.php:1590
-#: lib/integration/magicmembers.inc.php:2220
+#: lib/integration/magicmembers.inc.php:1963
#, php-format
msgid "Last payment status: %s"
msgstr "Status poslednje uplate: %s"
-#: lib/integration/magicmembers.inc.php:1618
+#: lib/integration/magicmembers.inc.php:1991
msgid "Failed join"
msgstr "Nije uspelo pridruživanje"
-#: lib/integration/magicmembers.inc.php:1668
+#: lib/integration/magicmembers.inc.php:2041
msgid "The post was purchased successfully"
msgstr "Post je kupljen uspešno"
-#: lib/integration/magicmembers.inc.php:2516
+#: lib/integration/magicmembers.inc.php:2961
msgid "Subscription cancelled"
msgstr "Pretplata ukinuta"
-#: lib/integration/magicmembers.inc.php:2542
-#: lib/integration/magicmembers.inc.php:3028
+#: lib/integration/magicmembers.inc.php:2987
+#: lib/integration/magicmembers.inc.php:3401
#, php-format
msgid "Subscription awaiting cancellation on %s"
msgstr "Preplagta čeka ukisanje na %s"
-#: lib/integration/magicmembers.inc.php:2622
+#: lib/integration/magicmembers.inc.php:3067
#, php-format
msgid ""
"You have successfully unsubscribed. Your account has been marked for "
@@ -622,187 +614,236 @@ msgid ""
msgstr ""
"Uspešno ste ukinuli pretplatu. Vaš nalog je markiran za ukisnaje na %s"
-#: lib/integration/magicmembers.inc.php:2918
+#: lib/integration/magicmembers.inc.php:3291
msgid "Last payment cycle processed successfully"
msgstr "Poslednja uplata je bila uspešna"
-#: lib/integration/magicmembers.inc.php:3048
+#: lib/integration/magicmembers.inc.php:3421
msgid "Last payment cycle cancelled"
msgstr "Poslednja uplata je ukinuta"
-#: lib/integration/magicmembers.inc.php:3082
+#: lib/integration/magicmembers.inc.php:3455
msgid "Last payment cycle expired"
msgstr "Poslednja uplata je istekla"
-#: lib/integration/magicmembers.inc.php:3771
-msgid "Error occured"
-msgstr "Greška se pojavila"
+#: lib/integration/pay_button.inc.php:5
+msgid "Error:"
+msgstr ""
-#: lib/integration/pay_button.inc.php:62 lib/integration/pay_button.inc.php:65
-#: lib/integration/shopplugin.inc.php:126
+#: lib/integration/pay_button.inc.php:30
msgid "Order"
msgstr "Naručiti"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:89
+#: lib/integration/pay_button.inc.php:163 lib/tpl/pay_button.php:113
msgid "Company Name"
msgstr "ime kompanije"
-#: lib/integration/pay_button.inc.php:62
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:93
+#: lib/integration/pay_button.inc.php:164 lib/tpl/pay_button.php:117
msgid "Forename"
msgstr "ime"
-#: lib/integration/pay_button.inc.php:62
-#: lib/integration/shopplugin.inc.php:126 lib/tpl/pay_button.php:97
+#: lib/integration/pay_button.inc.php:165 lib/tpl/pay_button.php:121
msgid "Surname"
msgstr "prezime"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:101
+#: lib/integration/pay_button.inc.php:166 lib/tpl/pay_button.php:125
msgid "Street"
msgstr "ulica"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:105
+#: lib/integration/pay_button.inc.php:167 lib/tpl/pay_button.php:129
msgid "Number"
msgstr "broj"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:109
+#: lib/integration/pay_button.inc.php:168 lib/tpl/pay_button.php:133
msgid "ZIP"
msgstr "poštanski broj"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:113
+#: lib/integration/pay_button.inc.php:169 lib/tpl/pay_button.php:137
msgid "City"
msgstr "grad"
-#: lib/integration/pay_button.inc.php:62
+#: lib/integration/pay_button.inc.php:170
msgid "Country"
msgstr "zemlja"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:117
+#: lib/integration/pay_button.inc.php:171 lib/tpl/pay_button.php:145
msgid "Email"
msgstr "Email"
-#: lib/integration/pay_button.inc.php:62 lib/tpl/pay_button.php:121
+#: lib/integration/pay_button.inc.php:172 lib/tpl/pay_button.php:141
msgid "Phone"
msgstr "telefon"
-#: lib/integration/pay_button.inc.php:102
+#: lib/integration/pay_button.inc.php:190
msgid "Confirmation of your Order"
msgstr "Potvrda vaše porudžbine"
-#: lib/integration/pay_button.inc.php:103
+#: lib/integration/pay_button.inc.php:196
msgid "New Order received"
msgstr "Primljena je nova porudžbina"
-#: lib/integration/pay_button.inc.php:114
+#: lib/integration/pay_button.inc.php:258
msgid "Shows a Paymill Payment Button."
msgstr "Prikazati Paymill Payment Button."
-#: lib/integration/pay_button.inc.php:132
+#: lib/integration/pay_button.inc.php:281
msgid "Thank you for your order."
msgstr "Hvala na porudžbini"
-#: lib/integration/pay_button.inc.php:167
+#: lib/integration/pay_button.inc.php:319
msgid "Payment"
msgstr "Plaćanje"
-#: lib/integration/pay_button.inc.php:192
+#: lib/integration/pay_button.inc.php:349
msgid "Title:"
msgstr "Naslov:"
-#: lib/integration/pay_button.inc.php:199
+#: lib/integration/pay_button.inc.php:356
msgid "Show these products only:"
msgstr "Prikazati samo ove proizvode:"
-#: lib/integration/pay_button.inc.php:202
+#: lib/integration/pay_button.inc.php:359
msgid "All Products"
msgstr "Svi proizvodi"
-#: lib/integration/woocommerce.inc.php:113
+#: lib/integration/woocommerce.inc.php:410
msgid "Enable/Disable"
msgstr "Omogući/Onemogući"
-#: lib/integration/woocommerce.inc.php:115
+#: lib/integration/woocommerce.inc.php:412
msgid "Enable PAYMILL Payment"
msgstr "Omogući PAYMILL plaćanjeNaslov"
-#: lib/integration/woocommerce.inc.php:119
+#: lib/integration/woocommerce.inc.php:416
msgid "Title"
msgstr "Naslov"
-#: lib/integration/woocommerce.inc.php:121
+#: lib/integration/woocommerce.inc.php:418
msgid "This controls the title which the user sees during checkout."
msgstr "Ovo kontroliše naslov koji korisnik vidi prilikom izlogovanja."
-#: lib/integration/woocommerce.inc.php:122
+#: lib/integration/woocommerce.inc.php:419
msgid "PAYMILL Payment"
msgstr "PAYMILL plaćanje"
-#: lib/integration/woocommerce.inc.php:126
+#: lib/integration/woocommerce.inc.php:423
msgid "Customer Message"
msgstr "Poruka mušterije"
-#: lib/integration/woocommerce.inc.php:270
-msgid "Subscription already ordered and cannot be purchased twice."
-msgstr "Pretplata je već naručena i ne može se kupiti dva puta."
+#: lib/integration/woocommerce.inc.php:536
+#, fuzzy
+msgid "Subscription already subscribed."
+msgstr "Pretplata ukinuta"
+
+#: lib/integration/woocommerce.inc.php:632
+msgid "Awaiting payment confirmation from Paymill."
+msgstr ""
#: lib/tpl/checkout_form.php:24
msgid "Credit Card"
msgstr "Kreditna kartica"
-#: lib/tpl/checkout_form.php:25
-msgid "Debit Payment"
-msgstr "Debitno plaćanje"
+#: lib/tpl/checkout_form.php:31
+msgid "SEPA"
+msgstr ""
-#: lib/tpl/checkout_form.php:30
-msgid "Name"
-msgstr "Ime"
+#: lib/tpl/checkout_form.php:38
+msgid "ELV"
+msgstr ""
-#: lib/tpl/checkout_form.php:35
-msgid "Credit Card Number"
+#: lib/tpl/checkout_form.php:42
+msgid "Holder Name"
+msgstr ""
+
+#: lib/tpl/checkout_form.php:46
+#, fuzzy
+msgid "Card Number"
msgstr "Broj kreditne kartice"
-#: lib/tpl/checkout_form.php:39
-msgid "Expire Date (MM/YYYY)"
+#: lib/tpl/checkout_form.php:49
+#, fuzzy
+msgid "Expire Date: "
msgstr "Datum isteka (M-GOD)"
-#: lib/tpl/checkout_form.php:43
+#: lib/tpl/checkout_form.php:50
+msgid "MM"
+msgstr ""
+
+#: lib/tpl/checkout_form.php:51
+msgid "YYYY"
+msgstr ""
+
+#: lib/tpl/checkout_form.php:52
msgid "CVC"
msgstr "CVC"
-#: lib/tpl/checkout_form.php:48
-msgid "Account #"
-msgstr "Nalog #"
+#: lib/tpl/checkout_form.php:57
+msgid "IBAN"
+msgstr ""
+
+#: lib/tpl/checkout_form.php:60
+msgid "BIC"
+msgstr ""
-#: lib/tpl/checkout_form.php:52
-msgid "Bank code"
+#: lib/tpl/checkout_form.php:65
+#, fuzzy
+msgid "Account Number"
+msgstr "Nepostojeći broj računa"
+
+#: lib/tpl/checkout_form.php:68
+#, fuzzy
+msgid "Bank Code"
msgstr "Kod banke"
-#: lib/tpl/pay_button.php:33
+#: lib/tpl/mgm/payment/paymill/html/settings.php:74
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:5
+#, php-format
+msgid "%s Logo"
+msgstr ""
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "Yes"
+msgstr ""
+
+#: lib/tpl/mgm/payment/paymill/html/settings.php:135
+#: lib/tpl/mgm/payment/paymill/html/settings.php:146
+msgid "No"
+msgstr ""
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+msgid "Enabled"
+msgstr ""
+
+#: lib/tpl/mgm/payment/paymill/html/settings_box.php:14
+#, fuzzy
+msgid "Disabled"
+msgstr "Omogući/Onemogući"
+
+#: lib/tpl/pay_button.php:41
msgid "S"
msgstr "S"
-#: lib/tpl/pay_button.php:36 lib/tpl/pay_button.php:55
+#: lib/tpl/pay_button.php:44 lib/tpl/pay_button.php:77
msgid "% VAT included."
msgstr "% VAT uključeno."
-#: lib/tpl/pay_button.php:37 lib/tpl/pay_button.php:56
+#: lib/tpl/pay_button.php:45 lib/tpl/pay_button.php:78
msgid "Delivery Time: "
msgstr "Vreme dostave"
-#: lib/tpl/pay_button.php:66
+#: lib/tpl/pay_button.php:62
+msgid "á "
+msgstr ""
+
+#: lib/tpl/pay_button.php:93
msgid "Choose Country"
msgstr "Izaberite zemlju"
-#: lib/tpl/pay_button.php:78
+#: lib/tpl/pay_button.php:105
msgid "Total Price:"
msgstr "Ukupna cena:"
-#: lib/tpl/pay_button.php:87
+#: lib/tpl/pay_button.php:110
msgid "Address"
msgstr "Adresa"
-
-#~ msgid "Paymill Payment"
-#~ msgstr "Paymill Payment"
-
-#~ msgid "%s DAY"
-#~ msgstr "%s Tage"
diff --git a/manual_de.pdf b/manual_de.pdf
index ccf1d4a..64500a9 100644
Binary files a/manual_de.pdf and b/manual_de.pdf differ
diff --git a/manual_en.pdf b/manual_en.pdf
index de0d877..12b0ae2 100644
Binary files a/manual_en.pdf and b/manual_en.pdf differ
diff --git a/paymill.php b/paymill.php
index 32f761a..538954e 100644
--- a/paymill.php
+++ b/paymill.php
@@ -2,148 +2,97 @@
/*
Plugin Name: Paymill
Plugin URI: https://www.paymill.com
-Description: Payments made eady
+Description: Payments made easy
+<<<<<<< HEAD
+Version: 1.6.0
+Author: Matthias Reuter info@straightvisions.com
+=======
Version: 1.5.2
Author: Matthias Reuter / Elbnetz
+>>>>>>> ff593a5371bcaa3080ee669f96c8ceeeff9df6e4
Author URI: http://elbnetz.com
*/
-/*
-add_action( 'plugins_loaded', 'paymill_test' );
-function paymill_test(){
-WC_Subscriptions_Manager::cancel_subscription('1', '144_91');
-}*/
- /*
- common information
- */
- define('PAYMILL_VERSION',1514);
+
+ // common information
+ define('PAYMILL_VERSION',1600);
define('PAYMILL_DIR',WP_PLUGIN_DIR.'/'.dirname(plugin_basename(__FILE__)).'/');
- $GLOBALS['paymill_active'] = false;
+ define('PAYMILL_PLUGIN_URL',plugins_url( '' , __FILE__ ).'/');
+ $GLOBALS['paymill_active'] = false; // eCommerce channels will set Paymill as active later to prevent showing payment form twice on same page.
- /*
- service mode
- */
+ // service mode
if(file_exists(PAYMILL_DIR.'lib/debug/PHP_errors.log')){
+ // error logging
error_reporting(E_ALL ^ E_NOTICE);
ini_set('log_errors',1);
ini_set('display_errors',0);
ini_set('error_log',PAYMILL_DIR.'lib/debug/PHP_errors.log');
- }
-
- /*
- load translation
- */
- function paymill_init() {
- load_plugin_textdomain( 'paymill', false, dirname( plugin_basename( __FILE__ ) ). '/lib/translate/' );
- }
- add_action('plugins_loaded', 'paymill_init');
-
- register_activation_hook(__FILE__,'paymill_install');
-
- /*
- load Paymill API
- */
- require_once(PAYMILL_DIR.'lib/api/Transactions.php');
- require_once(PAYMILL_DIR.'lib/api/Webhooks.php');
- require_once(PAYMILL_DIR.'lib/integration/subscriptions.inc.php');
-
- /*
- load config
- */
- require_once('lib/config.inc.php');
-
- /* gather source info for security purposes and optimization */
- $GLOBALS['paymill_source'] = array(
- 'wordpress_version' => get_bloginfo('version'),
- 'paymill_version' => PAYMILL_VERSION
- );
-
- /*
- install the tables
- */
- function paymill_install() {
- global $wpdb;
- require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
-
-$sql = 'CREATE TABLE '.$wpdb->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 longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- wp_member_id int(11) NOT NULL,
- UNIQUE KEY paymill_client_id (paymill_client_id));';
-
-$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 longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- woocommerce_order_id int(11) NOT NULL,
- pay_button_order_id int(11) NOT NULL,
- shopplugin_order_id int(11) NOT NULL,
- UNIQUE KEY paymill_transaction_id(paymill_transaction_id));';
-
-$sql .= 'CREATE TABLE '.$wpdb->prefix.'paymill_cache (
- cache_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- cache_content longtext CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- UNIQUE KEY cache_id (cache_id));';
-
-$sql .= 'CREATE TABLE '.$wpdb->prefix.'paymill_subscriptions (
- paymill_sub_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- woo_user_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- woo_offer_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- mgm_user_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- mgm_offer_id varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
- UNIQUE KEY paymill_sub_id (paymill_sub_id));';
-
- dbDelta($sql);
+ // query logging
+ define('SAVEQUERIES', true);
- // paymill webhooks
-
- // get webhooks list
- $srv = new Services_Paymill_Webhooks($GLOBALS['paymill_settings']->paymill_general_settings['api_key_private'],$GLOBALS['paymill_settings']->paymill_general_settings['api_endpoint']);
-
- $webhook = $srv->getOne(get_option('paymill_webhook_id'));
-
- if(!$webhook){
- $webhook = $srv->create(array(
- 'url' => get_site_url().'/?paymill_webhook=1',
- 'event_types' => array('subscription.deleted')
- ));
-
- add_option('paymill_webhook_id', $webhook['id']);
- }
-
- 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);
- }
+ // benchmarking
+ define('paymill_BENCHMARK', true);
+ require_once(PAYMILL_DIR.'lib/benchmark.inc.php');
+ paymill_doBenchmark(false,'init'); // start benchmark
+ }else{
+ define('paymill_BENCHMARK', false);
}
- if(!get_option('paymill_db_version')){
- paymill_install();
- }elseif(get_option('paymill_db_version') != PAYMILL_VERSION){
- paymill_install();
+ // load translation
+ add_action('plugins_loaded', 'paymill_init');
+ function paymill_init(){
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_translation'); // benchmark
+ load_plugin_textdomain('paymill', false, dirname(plugin_basename(__FILE__)). '/lib/translate/');
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_translation'); // benchmark
}
- /*
- load admin scripts
- */
- function pw_load_scripts($hook) {
- if(isset($_GET['tab']) && !in_array($_GET['tab'],$GLOBALS['paymill_settings']->setting_keys)){
- return;
+ // load config
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_config'); // benchmark
+ require_once(PAYMILL_DIR.'lib/config.inc.php');
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_config'); // benchmark
+
+ // load the Paymill API
+ require_once(PAYMILL_DIR.'lib/loader.inc.php');
+ function load_paymill(){
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_API'); // benchmark
+ if(!isset($GLOBALS['paymill_loader']) || get_class($GLOBALS['paymill_loader']) != 'paymill_loader'){
+ $GLOBALS['paymill_loader'] = new paymill_loader();
}
-
- wp_enqueue_script( 'paymill_admin_js', plugins_url('/lib/js/paymill_admin.js',__FILE__ ), array('jquery'), PAYMILL_VERSION);
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_API'); // benchmark
}
- add_action('admin_enqueue_scripts', 'pw_load_scripts');
- /*
- load payment forms
- */
+ // this function-call can and should be used whenever working with Paymill API:
+ // load_paymill();
+
+ // Example call when working with Paymill API directly:
+ //var_dump($GLOBALS['paymill_loader']->request->getAll($GLOBALS['paymill_loader']->request_client));
+
+ // Load Wrapper Classes - you may use them or not, but they make my life easier
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_subscription_wrapper'); // benchmark
+ require_once(PAYMILL_DIR.'lib/integration/subscriptions.inc.php');
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_subscription_wrapper'); // benchmark
+
+ // load setup routines
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_setup'); // benchmark
+ require_once(PAYMILL_DIR.'lib/setup.inc.php');
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_setup'); // benchmark
+
+ // load scripts
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_scripts'); // benchmark
+ require_once(PAYMILL_DIR.'lib/scripts.inc.php');
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_scripts'); // benchmark
+
+ // load integration classes
+ if(paymill_BENCHMARK)paymill_doBenchmark(true,'paymill_load_integration_classes'); // benchmark
require_once(PAYMILL_DIR.'lib/integration/pay_button.inc.php'); // pay button
require_once(PAYMILL_DIR.'lib/integration/woocommerce.inc.php'); // WooCommerce
+<<<<<<< HEAD
+ if(paymill_BENCHMARK)paymill_doBenchmark(false,'paymill_load_integration_classes'); // benchmark
+
+ // shutdown
+ if(paymill_BENCHMARK) add_action('shutdown', 'paymill_shutdownBenchmark'); // finish benchmark
+?>
+=======
function paymill_scripts(){
wp_deregister_script(array('paymill_bridge','paymill_bridge_custom'));
@@ -180,4 +129,5 @@ function paymill_scripts(){
}
add_action('wp_enqueue_scripts', 'paymill_scripts');
-?>
\ No newline at end of file
+?>
+>>>>>>> ff593a5371bcaa3080ee669f96c8ceeeff9df6e4
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 0000000..c77860f
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,310 @@
+=== PAYMILL for WordPress ===
+Contributors: Matthias Reuter
+Donate link:
+Tags: paymill, creditcard, elv, payment, woocommerce, paybutton, ecommerce, debitcard, subscriptions
+Requires at least: 3.9
+Tested up to: 3.9
+Stable tag: 1.6
+License: GPLv3 or later
+License URI: http://www.gnu.org/licenses/gpl-3.0.html
+
+With PAYMILL you are able to provide credit card based payments for your customers. German users can use ELV payment, too.
+
+== Description ==
+
+This plugin currently allows:
+
+* Payment Gateway for WooCommerce - incl. subscription support
+* Payment Gateway for ShopPlugin
+* Payment Gateway for Magic Members - incl. subscription support
+* Pay Button - incl. subscription support
+
+PAYMILL offers the fastest and easiest way to accept payments online. The innovative payment solution enables online businesses and services to integrate payments into their websites within a very short time. The developer-friendly REST API is flexibly integrable. Customize the check-out process the way you want or use the PAYMILL PayButton which allows an even easier integration. Super-fast account activation within a few days only. Top-notch customer support. Subscriptions supported and Mobile SDKs for iOS and Android available. Accept payments in up to 100 currencies. All major card brands like MasterCard, VISA, American Express, Diner's Club, Maestro etc. supported. Available in 40 countries across Europe so far.
+
+== Installation ==
+
+There is a manual included in English and German as PDF. But in short:
+
+1. Upload `paymill`-directory to the `/wp-content/plugins/` directory
+2. Activate the plugin through the 'Plugins' menu in WordPress
+3. Register a free account on https://www.paymill.com/
+4. Insert TEST Api Keys for testing purposes in plugin settings
+5. Integrate the widget somewhere in your wordpress. Without one of the supported shops, the easiest method is the pay button, available in the admin interface at _Design » Widgets_, or as a shortcode (see FAQ) for individual pages.
+6. Play around in test mode.
+7. If you are happy how the plugin works, enable your live account on https://www.paymill.com/ - this could take a couple of days.
+8. After your paymill account has been activated for LIVE mode, switch your account to live and replace your TEST API Keys with your LIVE API Keys in plugin settings.
+
+== Frequently asked questions ==
+
+= Is this plugin for free? =
+
+This plugin is for free and licensed to GPL.
+It's open source following the GPL policy.
+
+= How can I revert all changes or reset the plugin? =
+Paymill for WordPress brings an uninstall routine which allows completely removing all data generated by the plugin from WordPress. This is a great feature for a plugin reset, too which helps if there were upgrade or go live issues. You just have to go to your WordPress Admin Dashboard -> Plugins Overview and deactivate Paymill for WordPress. After that, a "delete" Link will appear which allows completely removing Paymill for WordPress.
+
+= Does this plugin calls to another server? =
+
+Yes. As Pamill is a payment service provider, it is absolutely required to call home to make sure that the payments are valid.
+We are talking about three different reasons for calling home:
+
+1. PAYMILL Javascript Bridge makes sure that payment data is correct and creates a payment token delivered to your server after checkout. This avoids delivering payment data to your server, what is -in most cases- absolutely prohibited by all common credit card providers.
+2. PAYMILL PHP Bridge finishes the order and delivers the generated token to the PAYMILL server.
+3. For security purposes there is a feature which delivers WordPress version number and PAYMILL Plugin version number upon payment process. This will give us the ability to warn paymill merchants who are using a very outdated WordPress version or about known security holes in specific version when still using them.
+
+= Are there any fees for payments? =
+
+Merchants must create an account on https://www.paymill.com/ to use the payment service.
+The TEST mode is for free, but there are "per payment" fees in LIVE mode, see https://www.paymill.com/en-gb/pricing/
+
+= Do customers need to create an account for payment? =
+
+No. PAYMILL allows payments without annoying your customers creating an account.
+They'll just fill out the payment fields on your checkout-page - that's all.
+
+= Does this plugin redirects the users to PAYMILL for payment? =
+
+No. PAYMILL allows payment directly through your website without any extra redirects etc.
+
+= Does this plugin supports 3D secure? =
+
+Yes. Please note that you can test 3D secure feature on LIVE mode only.
+The TEST mode always gives a positive feedback on 3D secure.
+
+= Which Credit Cards are supported? =
+
+Depending on your country and account status, the following credit card provider are currently supported: VISA, MasterCard, American Express, Diners Club, UnionPay and JCB
+
+= What is ELV and why it's supported? =
+
+ELV is a German banking service and stands for "Elektronisches Lastschriftverfahren".
+This is a very convenience payment solution for German users, as credit cards are not very common in Germany compared to e.g. USA.
+
+= What is SEPA and why it's supported? =
+
+SEPA is a European banking service and stands for "Single Euro Payments Area".
+This is a very convenience payment solution for European users, as credit cards are not very common in Europe compared to e.g. USA.
+
+= Can I use shortcodes to display the Pay Button? =
+
+Yes, here's an example shortcode with all currently available parameters: '[paymill_pb title="test title" products_list="1,2"]'
+
+= Are there actions/filters/hooks in the Pay Button? =
+
+Yes, all of them have 1 parameter as array with several vars.
+You may use var_dump to get their content and structure.
+
+= actions =
+
+* paymill_paybutton_client_created
+* paymill_paybutton_client_updated
+* paymill_paybutton_subscription_created
+* paymill_paybutton_order_complete
+
+= filters =
+
+* paymill_paybutton_order_desc
+* paymill_paybutton_client_desc
+* paymill_paybutton_email_text
+
+= How can I customize the Pay Button? =
+
+The Pay Button is made for customizing and you should make intensive use of CSS to cutomize it.
+
+Additionally, you may want to replace the default order form with your own. Create a
+custom theme file on 'THEME_DIR/paymill/pay_button.php' (it will replace '/paymill/lib/tpl/pay_button.php')
+
+== Screenshots ==
+
+1. Common Settings
+2. Payment Form
+3. Pay Button
+4. Pay Button Common Settings
+5. Pay Button Products Settings
+6. Pay Button Shipping Settings
+
+== Changelog ==
+
+= 1.6 =
+
+* Major Update!
+* Common: payment channel SEPA added
+* Common: update to new API PHP Wrapper
+* Common: better theme support
+* MagicMembers: released as final
+* WooCommerce: many bugs fixed, support for webhooks added
+* PayButton: completely rewritten
+
+= 1.5.2 =
+
+* Common: "Fatal error: Call to a member function payment_complete() on a non-object" fixed
+
+= 1.5.1 =
+
+* Common: Installation Manual updated
+* Common: "Error Multiple Primary Key Defined" on Update fixed
+* WooCommerce: Checkout form background color fixed
+* WooCommerce: Error "notDigits: '-16045' must contain only digits" fixed
+* Pay Button: Submit Button will be hidden on submit (and shown again by error) to avoid double orders.
+* Magic Members: Beta available. The B in beta stands for bugs, so please don't use magic members in live environments.
+
+= 1.5.0 =
+
+* Common: Payment processing totally rewritten making it more robust
+* Common: Clicking on another area than submit button could submit form - fixed
+* Common: Serbo-Croatic Translation added (thanks to Borisa Djuraskovic )
+* WooCommerce: minor bugfixes
+* WooCommerce: More control about visibility of payment icons in checkout form
+* Shopplugin: Critical error fixed
+* Shopplugin: reworked payment form
+* Pay Button: New feature allows redirect to custom thank your URL
+* Pay Button: New actions and hooks added for triggering custom functions or customizing order confirmation mail
+
+= 1.4.4 =
+
+* WooCommerce: Rounding issue fixed
+
+= 1.4.3 =
+
+* Common: Minor Fix
+
+= 1.4.2 =
+
+* Common: Critical Fix when using 1.4.1, please update immediately to 1.4.2.
+
+= 1.4.1 =
+
+* Common: Javascript-Handling on Checkout-Process optimized making it more robust
+* Common: MASSIVELY improved Error Handling
+* Common: Payment Form Design optimized
+* Common: Changed Language Pack from en_GB to en_US as this is WordPress' default language
+* Pay Button: Subscriptions-Select-Field can be hidden now, too
+* Pay Button: Subscriptions Translation Issue fixed on payment form
+* Pay Button: Action added: paymill_paybutton_order_complete, args: $order_id, $transaction, $_POST
+* Pay Button: Now supports custom theme file on THEME_DIR/paymill/pay_button.php (replaces /paymill/lib/tpl/pay_button.php)
+* Pay Button: Now allows hiding certain fields
+* Pay Button: Now allows to prevent loading the default styles
+* Magic Members: Pre Alpha version included (don't use it except you know what you do!)
+
+= 1.4.0 =
+
+* Subscription support added for WooCommerce Subscriptions addon
+* Allows hiding quantity field in pay button widget
+
+= 1.3.2 =
+
+* Creditcard / ELV Switch Display issue fixed
+* Translating issues fixed
+* WooCommerce Bug on checkout page fixed
+* Pay Button show/hide blocks links fixed
+
+= 1.3.1 =
+
+* MasterCard Logo and Payment Bug fixed
+* error reporting fixed (thanks to Jan R.)
+* notifies with wrong payment data in Pay Button fixed
+* credit card button visibility fixed
+
+= 1.3 =
+
+* several PHP notices fixed
+* WooCommerce issue fixed (selection of other payment gateway didn't work on checkout page)
+* Subscription Support for Pay Button
+
+= 1.2.1 =
+
+* several PHP notices fixed
+* incompatibility with Yootheme Cloud Theme (and maybe other themes) fixed
+* unsaved Settings for Payment Gateway in WooCommerce fixed
+* Payment Type Logo Selection added
+
+= 1.2 =
+Shopplugin support added
+
+= 1.1 =
+Pay Button added
+
+= 1.0 =
+WooCommerce support added
+
+== Upgrade Notice ==
+
+= 1.6 =
+
+* Major Update!
+* Common: payment channel SEPA added
+* Common: update to new API PHP Wrapper
+* Common: better theme support
+* MagicMembers: released as final
+* WooCommerce: many bugs fixed, support for webhooks added
+* PayButton: completely rewritten
+
+= 1.5.2 =
+
+* Common: "Fatal error: Call to a member function payment_complete() on a non-object" fixed
+
+= 1.5.1 =
+
+* Common: Installation Manual updated
+* Common: "Error Multiple Primary Key Defined" on Update fixed
+* WooCommerce: Checkout form background color fixed
+* WooCommerce: Error "notDigits: '-16045' must contain only digits" fixed
+* Pay Button: Submit Button will be hidden on submit (and shown again by error) to avoid double orders.
+* Magic Members: Beta available. The B in beta stands for bugs, so please don't use magic members in live environments.
+
+= 1.5.0 =
+
+* Common: Payment processing totally rewritten making it more robust
+* Common: Clicking on another area than submit button could submit form - fixed
+* Common: Serbo-Croatic Translation added (thanks to Borisa Djuraskovic )
+* WooCommerce: minor bugfixes
+* WooCommerce: More control about visibility of payment icons in checkout form
+* Shopplugin: Critical error fixed
+* Shopplugin: reworked payment form
+* Pay Button: New feature allows redirect to custom thank your URL
+* Pay Button: New actions and hooks added for triggering custom functions or customizing order confirmation mail
+
+= 1.4.4 =
+
+* WooCommerce: Rounding issue fixed
+
+= 1.4.3 =
+
+* Common: Minor Fix
+
+= 1.4.2 =
+
+* Common: Critical Fix when using 1.4.1, please update immediately to 1.4.2.
+
+= 1.4.1 =
+Maintenance Update with a hugh load of minor improvements and bugfixes
+
+= 1.4.0 =
+WooCommerce Subscription Support (beta!), minor improvements
+
+= 1.3.2 =
+Several bugs fixed, shortcode support for Pay Button
+
+= 1.3.1 =
+Several bugs fixed
+
+= 1.3 =
+Several bugs fixed, subscription support added
+
+= 1.2.1 =
+Several Bugs fixed and Payment Type Logo Selection added
+
+= 1.2 =
+Shopplugin support added
+
+== Missing a feature? ==
+
+Please use the plugin support forum here on WordPress.org. We will add your wished - if realizable - on our todo list. Please note that we can not give any time estimate for that list or any feature request.
+
+= Paid Services =
+Nevertheless, feel free to hire the plugin author Matthias Reuter if you need to:
+
+* get a customization
+* get a feature rapidly / on time
+* get a custom WordPress plugin developed to exactly fit your needs.
\ No newline at end of file
diff --git a/uninstall.php b/uninstall.php
new file mode 100644
index 0000000..f5c695e
--- /dev/null
+++ b/uninstall.php
@@ -0,0 +1,14 @@
+query('DROP TABLE IF EXISTS '.$wpdb->prefix.'paymill_clients');
+ $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'paymill_transactions');
+ $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'paymill_cache');
+ $wpdb->query('DROP TABLE IF EXISTS '.$wpdb->prefix.'paymill_subscriptions');
+ $wpdb->query('DELETE FROM '.$wpdb->options.' WHERE option_name LIKE "paymill_%"');
+
+?>
\ No newline at end of file