diff --git a/CHANGELOG.md b/CHANGELOG.md
index da6cc24..585e7cf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Release Notes - heidelpay Payment Gateway for WooCommerce
+## [1.7.0][1.7.0]
+
+### Added:
+- Use context to generate a dedicated heidelpay logfile
+- WooCommerce Subscriptions
+ - Enable / Disable payment for subscription orders
+ - Support for configuration
+ - Change amount of subscription
+ - Change date of subscription
+ - Direct debit:
+ - Add creditorId payment information
+ - Payment info text for subscription renewal orders.
+
+###Fixed:
+- Push notifications were not processed
+- IFrame not working if lazyloading is active
+
## [1.6.0][1.6.0]
### Added:
@@ -83,4 +100,5 @@
[1.3.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.2.0..1.3.0
[1.4.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.3.0..1.4.0
[1.5.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.4.0..1.5.0
-[1.6.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.5.0..1.6.0
\ No newline at end of file
+[1.6.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.5.0..1.6.0
+[1.7.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.6.0..1.7.0
\ No newline at end of file
diff --git a/assets/js/creditCardFrame.js b/assets/js/creditCardFrame.js
index 5311922..e51764e 100644
--- a/assets/js/creditCardFrame.js
+++ b/assets/js/creditCardFrame.js
@@ -49,10 +49,7 @@ function sendMessage(e) {
* Get the iFrame element
*/
var paymentFrameIframe = document.getElementById('paymentFrameIframe');
- /**
- * Get hostname and protocol from paymentIframe
- */
- var targetOrigin = getDomainFromUrl(paymentFrameIframe.src);
+ var targetOrigin = getUrlFromIframe(paymentFrameIframe);
/**
* Send html postmessage to payment frame
@@ -60,11 +57,17 @@ function sendMessage(e) {
paymentFrameIframe.contentWindow.postMessage(JSON.stringify(data), targetOrigin);
}
-
/**
* Function to get the domain from a given url
*/
-function getDomainFromUrl(url) {
+function getUrlFromIframe(paymentIframe) {
+ /**
+ * Get hostname and protocol from paymentIframe
+ */
+ var url = paymentIframe.getAttribute("src");
+ if (url === null) {
+ url = paymentIframe.getAttribute("data-src");
+ }
var arr = url.split("/");
return arr[0] + "//" + arr[2];
}
@@ -79,15 +82,10 @@ function receiveMessage(e) {
* Get the iFrame element
*/
var paymentFrameIframe = document.getElementById('paymentFrameIframe');
- /**
- * Get hostname and protocol from paymentIframe
- */
-
- var targetOrigin = getDomainFromUrl(paymentFrameIframe.src);
+ var targetOrigin = getUrlFromIframe(paymentFrameIframe);
if (e.origin !== targetOrigin) {
return;
}
var antwort = JSON.parse(e.data);
- //console.log(antwort);
}
\ No newline at end of file
diff --git a/composer.json b/composer.json
index a44d2b6..0f57e3d 100644
--- a/composer.json
+++ b/composer.json
@@ -10,14 +10,18 @@
"authors": [
{
"name": "Daniel Kraut",
- "email": "github@bnoob.eu"
+ "role": "Developer"
},
{
"name": "Florian Evertz",
- "email": "florian.evertz@googlemail.com"
+ "role": "Developer"
},
{
- "name": "David Owusu"
+ "name": "David Owusu",
+ "role": "Developer"
}
- ]
+ ],
+ "support": {
+ "email": "development@heidelpay.com"
+ }
}
diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php
index ca6223a..323ce02 100644
--- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php
+++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php
@@ -143,7 +143,7 @@ protected function getIFrame(WC_Order $order)
$bookingAction = $this->getBookingAction();
if (method_exists($this->payMethod, $bookingAction)) {
- if (class_exists('WC_Subscriptions_Order') && wcs_order_contains_subscription($order)) {
+ if (class_exists('WC_Subscriptions') && wcs_order_contains_subscription($order)) {
$bookingAction = 'registration';
}
$this->payMethod->$bookingAction(
@@ -174,8 +174,7 @@ protected function getIFrame(WC_Order $order)
$this->addPaymentError($this->getErrorMessage());
wc_print_notices();
- wc_get_logger()->log(
- WC_Log_Levels::ERROR,
+ wc_get_logger()->error(
htmlspecialchars(
print_r(
$this->plugin_id . ' - ' . $this->id . __(
@@ -184,20 +183,12 @@ protected function getIFrame(WC_Order $order)
) . $bookingAction,
1
)
- )
+ ),
+ array('source' => 'heidelpay')
);
return null;
}
- /**
- * @param $order
- * @param $uid
- */
- public function performNoGuiRequest($order, $uid)
- {
- parent::performAfterRegistrationRequest($order, $uid);
- }
-
/**
* @return mixed|string
*/
diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php
index e82cb2f..f9b3a0e 100644
--- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php
+++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php
@@ -27,6 +27,7 @@
abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway
{
+ protected $templateTextKey = '';
/**
* @var \Heidelpay\PhpPaymentApi\PaymentMethods\BasicPaymentMethodTrait $payMethod
*/
@@ -37,9 +38,10 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway
*/
public $bookingAction;
- /**
- * @var string $name
- */
+ /** @var WC_Logger $wcLogger */
+ public $wcLogger;
+
+ /** @var string $name */
protected $name;
/**
@@ -49,6 +51,7 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway
public function __construct()
{
+ $this->wcLogger = wc_get_logger();
$this->has_fields = false;
$this->bookingAction = 'debit';
$this->messageMapper = new MessageCodeMapper(get_locale());
@@ -177,9 +180,13 @@ public function init_form_fields()
*/
public function pushHandler()
{
- if (array_key_exists('wcLogger->debug('received push', ['source' => 'heidelpay']);
+ $rawPayload = file_get_contents('php://input');
+ if (!empty($rawPayload)) {
$push = new WC_Heidelpay_Push();
- $push->init(file_get_contents('php://input'), $this->get_option('secret'));
+ $push->init($rawPayload, $this->get_option('secret'));
+ } else {
+ $this->wcLogger->warning('Push was empty or did not process', ['source' => 'heidelpay']);
}
exit;
}
@@ -235,11 +242,10 @@ public function process_payment($order_id)
/**
* @param $order WC_Order
- * @throws Exception
*/
public function prepareRequest(WC_Order $order)
{
- $this->setAuthentification($order);
+ $this->setAuthentication($order);
$this->setAsync();
$this->setCustomer($order);
$this->setBasket($order->get_id());
@@ -248,21 +254,16 @@ public function prepareRequest(WC_Order $order)
}
/**
- * Set up your authentification data for Heidepay api
+ * Set up your authentication data for heidelpay api
* @param WC_order $order
*/
- protected function setAuthentification(WC_order $order = null)
+ protected function setAuthentication(WC_order $order = null)
{
$isSandbox = false;
$channel = $this->get_option('transaction_channel');
if ($this->get_option('sandbox') === 'yes') {
$isSandbox = true;
}
- if (class_exists('WC_Subscriptions_Order')) {
- if ($order !== null && (wcs_order_contains_renewal($order) || wcs_order_contains_subscription($order))) {
- $channel = $this->get_option('transaction_channel_subscription');
- }
- }
$this->payMethod->getRequest()->authentification(
$this->get_option('security_sender'),
$this->get_option('user_login'),
@@ -279,7 +280,7 @@ protected function setAsync()
{
$this->payMethod->getRequest()->async(
$this->getLanguage(), // Language code for the Frame
- $this->getResponeUrl()
+ $this->getResponseUrl()
);
}
@@ -317,7 +318,6 @@ protected function setCustomer(WC_Order $order)
/**
* @param $order_id
- * @throws Exception
*/
protected function setBasket($order_id)
{
@@ -331,7 +331,7 @@ protected function setBasket($order_id)
}
/**
- * @global string $wp_version
+ * @param null|string $orderID
*/
protected function setCriterions($orderID = null)
{
@@ -360,13 +360,16 @@ public function performRequest($order, $uid = null)
try {
$this->handleFormPost($_POST);
} catch (\Exception $e) {
- wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1)));
+ $this->wcLogger->debug(
+ htmlspecialchars(print_r($e->getMessage(), 1)),
+ array('source' => 'heidelpay')
+ );
return null;
}
}
if (!empty($this->bookingAction) && method_exists($this->payMethod, $this->bookingAction)) {
- if (class_exists('WC_Subscriptions_Order') &&
+ if (class_exists('WC_Subscriptions') &&
wcs_order_contains_subscription($order) &&
empty($order->get_meta('heidelpay-Registration'))) {
$action = 'registration';
@@ -376,7 +379,10 @@ public function performRequest($order, $uid = null)
try {
$this->payMethod->$action($uid);
} catch (Exception $e) {
- wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1)));
+ $this->wcLogger->debug(
+ htmlspecialchars(print_r($e->getMessage(), 1)),
+ array('source' => 'heidelpay')
+ );
$this->addPaymentError($this->getErrorMessage());
@@ -398,17 +404,17 @@ public function performRequest($order, $uid = null)
} else {
$this->addPaymentError($this->getErrorMessage());
- wc_get_logger()->log(
- WC_Log_Levels::ERROR,
+ $this->wcLogger->error(
htmlspecialchars(
print_r(
$this->plugin_id . ' - ' . $this->id . __(
- ' Error: Paymentmethod was not found: ',
+ ' Error: Payment method was not found: ',
'woocommerce-heidelpay'
) . $this->bookingAction,
1
)
- )
+ ),
+ array('source' => 'heidelpay')
);
return null;
@@ -442,7 +448,7 @@ public function addPaymentError($message)
}
/**
- * Get the mapped Errormessage from Respone wich is html escaped.
+ * Get the mapped Errormessage from response which is html escaped.
* If a response is given as a parameter that will determine the message. Otherwise the Response from the payMethod
* is used. If none of them is given return the default message
* @param Response|null $response
@@ -465,49 +471,56 @@ protected function getErrorMessage(Response $response = null)
}
/**
- * Funktion to log Events as a notice. It has a prefix to identify that the log entry is from heidelpay and which
+ * Function to log Events as a notice. It adds a context to identify that the log entry is from heidelpay and which
* function has created it.
* @param string|array $logData
*/
protected function paymentLog($logData)
{
$callers = debug_backtrace();
- wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r('heidelpay - ' .
- $callers [1] ['function'] . ': ' . print_r($logData, 1), 1));
+ $this->wcLogger->notice(
+ print_r($callers[1]['function'] . ': ' . print_r($logData, 1), 1),
+ array('source' => 'heidelpay')
+ );
}
/**
* @param $order
* @param $uid
- * @throws WC_Data_Exception
+ * @return Response
*/
public function performNoGuiRequest($order, $uid)
{
- $this->performAfterRegistrationRequest($order, $uid);
+ return $this->performAfterRegistrationRequest($order, $uid);
}
/**
* @param WC_Order $order
* @param $uid
- * @throws WC_Data_Exception
+ * @return Response
*/
public function performAfterRegistrationRequest($order, $uid)
{
if (!empty($_POST)) {
- $this->handleFormPost($_POST);
+ $this->handleFormPost();
}
if ($order->get_meta('heidelpay-Registration') !== '') {
try {
$this->payMethod->debitOnRegistration($uid);
} catch (Exception $e) {
- wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1)));
+ $this->wcLogger->debug(
+ htmlspecialchars(print_r($e->getMessage(), 1)),
+ array('source' => 'heidelpay')
+ );
$this->addPaymentError($this->getErrorMessage());
}
if ($this->payMethod->getResponse()->isError()) {
$order->set_status('on-hold');
}
+ return $this->payMethod->getResponse();
}
+ return null;
}
/**
@@ -535,10 +548,12 @@ public function callback_handler()
} else {
// Add Error Msg, debug log and redirect to cart.
$this->addPaymentError($this->getErrorMessage());
- wc_get_logger()->log(WC_Log_Levels::DEBUG,
+ wc_get_logger()->log(
+ WC_Log_Levels::DEBUG,
'heidelpay - Response: There has been an error fetching the RedirectURL by the payment. '
- . 'Please make sure the ResponseURL (' . $this->getResponeUrl() .')is accessible from the internet.',
- array('source' => 'heidelpay'));
+ . 'Please make sure the ResponseURL (' . $this->getResponseUrl() .')is accessible from the internet.',
+ array('source' => 'heidelpay')
+ );
wp_redirect(wc_get_cart_url());
}
exit();
@@ -546,7 +561,7 @@ public function callback_handler()
/**
* Filter function for the hook: woocommerce_available_payment_gateways
- * Can be used to set conditions vor availability of a paymethod.
+ * Can be used to set conditions vor availability of a payment method.
* @param $available_gateways
* @return mixed
*/
@@ -556,7 +571,7 @@ public function setAvailability($available_gateways)
}
/**
- * "woocommerce_thankyou_order_received_text" hook to display heidelpay-paymentInfo text on the successpage after
+ * "woocommerce_thankyou_order_received_text" hook to display heidelpay-paymentInfo text on the success page after
* payment.
* @param $orderReceivedText
* @return string
@@ -627,6 +642,46 @@ public function emailInstructions(WC_Order $order)
}
}
+ /**
+ * Add payment information to the order if available.
+ * Information usually are set for invoice, direct debit and prepayment.
+ * @param WC_Order $order
+ * @param Response $response
+ * @return null
+ */
+ public function setPaymentInfo(WC_Order $order, Response $response)
+ {
+ // Load template text for Payment information
+ $paymentInfoTemplate = $this->getPaymentInfoTemplate();
+ if (empty($paymentInfoTemplate)) {
+ return;
+ }
+
+ $connector = $response->getConnector();
+ $presentation = $response->getPresentation();
+ $presentationAmount = number_format(
+ $presentation->getAmount(),
+ wc_get_price_decimals(),
+ wc_get_price_decimal_separator(),
+ wc_get_price_thousand_separator()
+ );
+
+ $paymentData = [
+ '{AMOUNT}' => $presentationAmount,
+ '{CURRENCY}' => $presentation->getCurrency(),
+ '{CONNECTOR_ACCOUNT_HOLDER}' => $connector->getAccountHolder(),
+ '{CONNECTOR_ACCOUNT_IBAN}' => $connector->getAccountIBan(),
+ '{CONNECTOR_ACCOUNT_BIC}' => $connector->getAccountBic(),
+ '{IDENTIFICATION_SHORTID}' => $response->getIdentification()->getShortId(),
+ '{Iban}' => $response->getAccount()->getIban(),
+ '{Ident}' => $response->getAccount()->getIdentification(),
+ '{CreditorId}' => $response->getIdentification()->getCreditorId(),
+ ];
+
+ $paymentText = strtr($paymentInfoTemplate, $paymentData);
+ $order->add_meta_data('heidelpay-paymentInfo', $paymentText);
+ }
+
/**
* @return array Containing the option field to select booking mode in the admin menu.
*/
@@ -648,8 +703,18 @@ protected function getBookingSelection()
/**
* @return string
*/
- protected function getResponeUrl()
+ protected function getResponseUrl()
+ {
+ return get_home_url(null, '/wc-api/' . strtolower(get_class($this)));
+ }
+
+ /** Default Payment info template is empty.
+ * Override this method in order to assign an individual Template text translation.
+ *
+ * @return string|void
+ */
+ public function getPaymentInfoTemplate()
{
- return get_home_url() . '/wc-api/' . strtolower(get_class($this));
+ return __('', 'woocommerce-heidelpay');
}
}
diff --git a/includes/class-wc-heidelpay-push.php b/includes/class-wc-heidelpay-push.php
index 9629d16..bc69ebc 100644
--- a/includes/class-wc-heidelpay-push.php
+++ b/includes/class-wc-heidelpay-push.php
@@ -45,9 +45,11 @@ public function init($rawPayload, $secret)
$response->verifySecurityHash($secret, $response->getIdentification()->getTransactionId());
} catch (\Exception $e) {
$callers = debug_backtrace();
- wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r('Heidelpay - ' .
- $callers [0] ['function'] . ': Invalid push hash from ' .
- $_SERVER ['REMOTE_ADDR'] . ', suspecting manipulation', 1));
+ wc_get_logger()->notice(
+ print_r($callers [0] ['function'] . ': Invalid push hash from ' .
+ $_SERVER ['REMOTE_ADDR'] . ', suspecting manipulation', 1),
+ array('source' => 'heidelpay')
+ );
exit(); //error
}
$this->handlePush($response);
@@ -62,41 +64,38 @@ public function handlePush($response)
$order = wc_get_order($orderID);
$payCode = explode('.', strtoupper($response->getPayment()->getCode()));
- wc_get_logger()->log(WC_Log_Levels::DEBUG, $order->get_status());
+ wc_get_logger()->debug('Processsing Order' . $orderID, ['source' => 'heidelpay']);
+ wc_get_logger()->debug('Order has status: '. $order->get_status(), ['source' => 'heidelpay']);
- if ($payCode[0] === 'IV') {
- if ($response->isSuccess()) {
- switch ($payCode[1]) {
- case 'FI':
- $order->update_status(
- 'on-hold',
- 'Order has been finalized'
- );
- break;
- case 'PA':
- $order->update_status(
- 'processing',
- 'Reservation done'
- );
- break;
- }
+ // Do not process pending transactions.
+ if ($response->isPending()) {
+ return;
+ }
+
+ list($transactionMethod, $transactionType) = $payCode;
+ if ($transactionMethod === 'IV' && $response->isSuccess()) {
+ switch ($transactionType) {
+ case 'FI':
+ $order->update_status(
+ 'processing',
+ 'Order has been finalized'
+ );
+ break;
+ case 'PA':
+ $order->update_status(
+ 'on-hold',
+ 'Reservation done'
+ );
+ break;
}
}
- if ($payCode[1] === 'CP' || $payCode[1] === 'RC' || $payCode[1] === 'DB') {
- if ($response->isSuccess()) {
+ $paidTransactionTypes = ['CP', 'RC', 'DB'];
+
+ if (in_array($transactionType, $paidTransactionTypes, true)) {
+ if ($response->isSuccess() && !$order->is_paid()) {
if ($order->get_total() === $response->getPresentation()->getAmount()) {
- if ($payCode[0] === 'IV') {
- $order->update_status(
- 'completed',
- $this->getNote($response)
- );
- } else {
- $order->update_status(
- 'processing',
- $this->getNote($response)
- );
- }
+ $order->payment_complete($response->getIdentification()->getShortId());
} else {
$order->add_order_note(
$this->getNote($response),
diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php
index 2e6210b..91000b5 100644
--- a/includes/class-wc-heidelpay-response.php
+++ b/includes/class-wc-heidelpay-response.php
@@ -48,9 +48,12 @@ public function init(array $post_data, $secret)
self::$response->verifySecurityHash($secret, $identificationTransactionId);
} catch (\Exception $exception) {
$callers = debug_backtrace();
- wc_get_logger()->log(WC_Log_Levels::NOTICE, print_r("Heidelpay - " .
- $callers [0] ['function'] . ": Invalid response hash from " .
- $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1));
+ wc_get_logger()->notice(
+ print_r("Heidelpay - " .
+ $callers [0] ['function'] . ": Invalid response hash from " .
+ $_SERVER ['REMOTE_ADDR'] . ", suspecting manipulation", 1),
+ ['source' => 'heidelpay']
+ );
exit(); //error
}
@@ -58,41 +61,65 @@ public function init(array $post_data, $secret)
$order = wc_get_order($orderId);
- $this->handleResult($post_data, $order);
+ $this->handleResult(self::$response, $order);
}
/**
* handle result post
*
- * @param $post_data
+ * @param Response $response
* @param WC_Order $order
*/
- public function handleResult($post_data, WC_Order $order)
+ public function handleResult($response, WC_Order $order)
{
- $uid = self::$response->getIdentification()->getUniqueId();
- $sid = self::$response->getIdentification()->getShortId();
+ $uid = $response->getIdentification()->getUniqueId();
+ $sid = $response->getIdentification()->getShortId();
+ $payCode = explode('.', strtoupper($response->getPayment()->getCode()));
+ list($transactionMethod, $transactionType) = $payCode;
+
+ // Get Payment Method.
+ $paymentGatewayList = WC_Payment_Gateways::instance()->payment_gateways();
+ $paymentMethodId = $order->get_payment_method();
+ /** @var WC_Heidelpay_Payment_Gateway $paymentMethod */
+ $paymentMethod = !empty($paymentGatewayList[$paymentMethodId]) ? $paymentGatewayList[$paymentMethodId] : null;
+ if (!$paymentMethod || !($paymentMethod instanceof WC_Heidelpay_Payment_Gateway)) {
+ wc_get_logger()->notice(
+ sprintf("Payment method is not valid or was not found: %s", htmlspecialchars($paymentMethodId)),
+ ['source' => 'heidelpay']
+ );
+ return;
+ }
+
+ // If registration, do a debit on registration afterwards
+ if (($transactionType === 'RG' || $transactionType === 'CF') && $response->isSuccess()) {
+ $order->add_meta_data('heidelpay-Registration', $uid);
+ $order->save_meta_data();
+ /** @var WC_Heidelpay_Payment_Gateway $paymethod */
+ $paymentMethod->prepareRequest($order);
+ //$paymentMethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE');
+ $paymentMethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid);
+ // Use the Response of the debitOnRegistration in order to set the correct paymentInfo
+ $debitOnRegistrationResponse = $paymentMethod->performNoGuiRequest($order, $uid);
+ if ($debitOnRegistrationResponse !== null) {
+ $redirectUrl = $debitOnRegistrationResponse->getFrontend()->getRedirectUrl();
+ if (!empty($redirectUrl)) {
+ echo $redirectUrl;
+ return;
+ }
+ $response = $debitOnRegistrationResponse;
+ }
+ }
- if (self::$response->isSuccess()) {
- $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE']));
+ if ($response->isSuccess() && !$response->isPending()) {
$note = '';
- $this->setPaymentInfo($order);
-
- // If registration, do a debit on registration afterwards
- if ($payCode[1] === 'RG' || $payCode[1] === 'CF') {
- $order->add_meta_data('heidelpay-Registration', $uid);
- $paymethod = 'WC_Gateway_HP_' . $payCode[0];
- $paymethod = new $paymethod;
- $paymethod->prepareRequest($order);
- $paymethod->payMethod->getRequest()->getFrontend()->setEnabled('FALSE');
- $paymethod->payMethod->getRequest()->getIdentification()->setReferenceid($uid);
- $paymethod->performNoGuiRequest($order, $uid);
- }
+ $paymentMethod->setPaymentInfo($order, $response);
+ $order->add_meta_data('heidelpay-UniqueID', $uid);
+ $order->add_meta_data('heidelpay-ShortID', $sid);
// If no money has been payed yet.
- if ($payCode[0] !== 'IV' && $payCode[1] === 'PA') {
- // If not Prepayment and Invoice payment can be captured manually
- if ($payCode [0] !== 'PP') {
+ if ($transactionType === 'PA') {
+ if ($transactionMethod !== 'PP') {
$note = __(
'Payment reservation successful. Please use the hiP to check the payment.',
'woocommerce-heidelpay'
@@ -104,25 +131,22 @@ public function handleResult($post_data, WC_Order $order)
__('Awaiting payment.', 'woocommerce-heidelpay') . ' ' . $note
);
} else {
- $order->add_meta_data('heidelpay-UniqueID', $uid);
- $order->add_meta_data('heidelpay-ShortID', $sid);
$order->payment_complete($sid);
}
- echo $order->get_checkout_order_received_url();
-
/* redirect customer to success page */
- } elseif (self::$response->isError()) {
- $error = self::$response->getError();
+ echo $order->get_checkout_order_received_url();
+ } elseif ($response->isError()) {
+ $error = $response->getError();
$order->update_status('failed');
- echo apply_filters('woocommerce_get_cancel_order_url_raw', add_query_arg(array(
+ echo apply_filters('woocommerce_get_cancel_order_url_raw', add_query_arg([
'cancel_order' => 'true',
'order' => $order->get_order_key(),
'order_id' => $order->get_id(),
'_wpnonce' => wp_create_nonce('woocommerce-cancel_order'),
'errorCode' => $error['code'],
- ), $order->get_cancel_endpoint()));
- } elseif (self::$response->isPending()) {
+ ], $order->get_cancel_endpoint()));
+ } elseif ($response->isPending()) {
//empty cart
wc()->cart->empty_cart();
@@ -130,61 +154,4 @@ public function handleResult($post_data, WC_Order $order)
echo $order->get_checkout_order_received_url();
}
}
-
- /**
- * Add payment information to the order if available.
- * Information usually are set for invoice, direct debit and prepayment.
- * @param WC_Order $order
- * @return null
- */
- public function setPaymentInfo(WC_Order $order)
- {
- // Load template text for Payment information
- $payInfoTemplate = $this->getInfoTemplate();
- if ($payInfoTemplate === null) {
- return null;
- }
-
- $response = self::$response;
- $payInfo = $response->getConnector();
- $presentation = $response->getPresentation();
-
- $paymentData = array(
- '{AMOUNT}' => $presentation->getAmount(),
- '{CURRENCY}' => $presentation->getCurrency(),
- '{CONNECTOR_ACCOUNT_HOLDER}' => $payInfo->getAccountHolder(),
- '{CONNECTOR_ACCOUNT_IBAN}' => $payInfo->getAccountIBan(),
- '{CONNECTOR_ACCOUNT_BIC}' => $payInfo->getAccountBic(),
- '{IDENTIFICATION_SHORTID}' => self::$response->getIdentification()->getShortId(),
- '{Iban}' => $response->getAccount()->getIban(),
- '{Ident}' => $response->getAccount()->getIdentification(),
- '{CreditorId}' => $response->getIdentification()->getCreditorId(),
- );
-
- $paymentText = strtr($payInfoTemplate, $paymentData);
-
- $order->add_meta_data('heidelpay-paymentInfo', $paymentText);
- }
-
- /**
- * Provide the template text for payment information.
- * @return null|string
- */
- public function getInfoTemplate()
- {
- $payCode = explode('.', self::$response->getPayment()->getCode());
- switch (strtoupper($payCode[0])) {
- case 'IV':
- return __('invoice_info', 'woocommerce-heidelpay');
- break;
- case 'PP':
- return __('prepayment_info', 'woocommerce-heidelpay');
- break;
- case 'DD':
- return __('direct_debit_info', 'woocommerce-heidelpay');
- break;
- default:
- return null;
- }
- }
}
diff --git a/includes/gateways/class-wc-heidelpay-gateway-cc.php b/includes/gateways/class-wc-heidelpay-gateway-cc.php
index d0ce2eb..e876ccb 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-cc.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-cc.php
@@ -50,7 +50,6 @@ public function init_form_fields()
*/
public function setPayMethod()
{
- /** @var \Heidelpay\PhpPaymentApi\PaymentMethods\CreditCardPaymentMethod payMethod */
$this->payMethod = new CreditCardPaymentMethod();
$this->id = 'hp_cc';
$this->name = __('Credit Card', 'woocommerce-heidelpay');
diff --git a/includes/gateways/class-wc-heidelpay-gateway-dd.php b/includes/gateways/class-wc-heidelpay-gateway-dd.php
index df58ea2..3495ea4 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-dd.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-dd.php
@@ -74,8 +74,6 @@ public function init_form_fields()
{
parent::init_form_fields();
- $this->initFormFieldsAddon();
-
$this->form_fields['title']['default'] = sprintf(__('%s', 'woocommerce-heidelpay'), $this->name);
$this->form_fields['description']['default'] = sprintf(__('Insert payment data for %s', 'woocommerce-heidelpay'), $this->name);
$this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name);
@@ -93,6 +91,8 @@ public function init_form_fields()
'default' => 'yes',
'desc_tip' => true,
);
+
+ $this->initFormFieldsAddon();
}
/**
@@ -106,6 +106,7 @@ public function payment_fields()
$accountHolder = wc()->customer->get_billing_first_name() . ' ' . wc()->customer->get_billing_last_name();
echo '
';
+ parent::payment_fields();
echo '' . $accountHolderLabel . ': ';
echo ' ';
@@ -117,8 +118,6 @@ public function payment_fields()
echo '
';
}
- //payment form
-
/**
* Set the id and PaymenMethod
*/
@@ -142,4 +141,9 @@ protected function handleFormPost()
$this->payMethod->getRequest()->getAccount()->setIban(htmlspecialchars($_POST['accountiban']));
}
}
+
+ public function getPaymentInfoTemplate()
+ {
+ return __('direct_debit_info', 'woocommerce-heidelpay');
+ }
}
\ No newline at end of file
diff --git a/includes/gateways/class-wc-heidelpay-gateway-idl.php b/includes/gateways/class-wc-heidelpay-gateway-idl.php
index 8ca3600..50a2562 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-idl.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-idl.php
@@ -61,7 +61,7 @@ public function payment_fields()
$bankNameLabel = __('Bank', 'woocommerce-heidelpay');
// Performe Authorize request to get paymethod config
- $this->setAuthentification();
+ $this->setAuthentication();
$this->setAsync();
$this->setCriterions();
diff --git a/includes/gateways/class-wc-heidelpay-gateway-iv.php b/includes/gateways/class-wc-heidelpay-gateway-iv.php
index a6ab632..690cdcc 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-iv.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-iv.php
@@ -35,10 +35,6 @@ public function init_form_fields()
__('Insert payment data for %s', 'woocommerce-heidelpay'),
$this->name
);
- $this->form_fields['instructions']['default'] = __(
- 'please send the money to IBAN BIC ',
- 'woocommerce-heidelpay'
- );
$this->form_fields['transaction_channel']['default'] = '31HA07BC8142C5A171749A60D979B6E4';
$this->form_fields['send_payment_info'] = array(
@@ -53,6 +49,11 @@ public function init_form_fields()
);
}
+ public function getPaymentInfoTemplate()
+ {
+ return __('invoice_info', 'woocommerce-heidelpay');
+ }
+
/**
* Set the id and PaymentMethod
*/
diff --git a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php
index 48742b9..d164c68 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-ivpg.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-ivpg.php
@@ -57,6 +57,11 @@ public function checkoutValidation()
}
}
+ public function getPaymentInfoTemplate()
+ {
+ return __('invoice_info', 'woocommerce-heidelpay');
+ }
+
private function is18($given)
{
$given = strtotime($given);
@@ -79,10 +84,6 @@ public function init_form_fields()
__('Insert payment data for %s', 'woocommerce-heidelpay'),
$this->name
);
- $this->form_fields['instructions']['default'] = __(
- 'please send the money to IBAN BIC ',
- 'woocommerce-heidelpay'
- );
$this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name);
$this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182';
$this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3';
@@ -235,6 +236,7 @@ public function payment_fields()
echo '';
+ parent::payment_fields();
echo
'
' . $salutationText . ': ' .
diff --git a/includes/gateways/class-wc-heidelpay-gateway-pp.php b/includes/gateways/class-wc-heidelpay-gateway-pp.php
index 0701896..ba36476 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-pp.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-pp.php
@@ -49,10 +49,6 @@ public function init_form_fields()
__('Insert payment data for %s', 'woocommerce-heidelpay'),
$this->name
);
- $this->form_fields['instructions']['default'] = __(
- 'please send the money to IBAN BIC ',
- 'woocommerce-heidelpay'
- );
$this->form_fields['enabled']['label'] = sprintf(__('Enable %s', 'woocommerce-heidelpay'), $this->name);
$this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182';
$this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3';
@@ -83,4 +79,9 @@ protected function setPayMethod()
$this->has_fields = false;
$this->bookingAction = 'authorize';
}
+
+ public function getPaymentInfoTemplate()
+ {
+ return __('prepayment_info', 'woocommerce-heidelpay');
+ }
}
diff --git a/includes/gateways/class-wc-heidelpay-gateway-va.php b/includes/gateways/class-wc-heidelpay-gateway-va.php
index 11fc8ca..7a0e315 100644
--- a/includes/gateways/class-wc-heidelpay-gateway-va.php
+++ b/includes/gateways/class-wc-heidelpay-gateway-va.php
@@ -64,7 +64,6 @@ public function setPayMethod()
public function init_form_fields()
{
parent::init_form_fields();
- $this->initFormFieldsAddon();
$this->form_fields['security_sender']['default'] = '31HA07BC8142C5A171745D00AD63D182';
$this->form_fields['user_login']['default'] = '31ha07bc8142c5a171744e5aef11ffd3';
@@ -72,6 +71,8 @@ public function init_form_fields()
$this->form_fields['transaction_channel']['default'] = '31HA07BC8124365CA41D4BDA79CCCD22';
$this->form_fields['bookingmode'] = $this->getBookingSelection();
+
+ $this->initFormFieldsAddon();
}
/**
diff --git a/includes/traits/trait-wc-heidelpay-subscription-gateway.php b/includes/traits/trait-wc-heidelpay-subscription-gateway.php
index 9a55a92..2b9cc09 100644
--- a/includes/traits/trait-wc-heidelpay-subscription-gateway.php
+++ b/includes/traits/trait-wc-heidelpay-subscription-gateway.php
@@ -15,16 +15,27 @@
* @category WooCommerce
*/
+use Heidelpay\PhpPaymentApi\Response;
+
+/**
+ * Trait WC_Heidelpay_Subscription_Gateway
+ * @property \Heidelpay\PhpPaymentApi\TransactionTypes\DebitOnRegistrationTransactionType payMethod
+ */
trait WC_Heidelpay_Subscription_Gateway
{
+ /**
+ * constructor for subscription support
+ */
public function constructorAddon()
{
- if (class_exists('WC_Subscriptions_Order')) {
+ if (class_exists('WC_Subscriptions')) {
$this->supports = array(
'subscriptions',
'subscription_cancellation',
'subscription_suspension',
'subscription_reactivation',
+ 'subscription_amount_changes',
+ 'subscription_date_changes'
);
add_action(
@@ -36,15 +47,52 @@ public function constructorAddon()
}
}
+ /**
+ * @inheritDoc
+ */
+ public function setAvailability($available_gateways)
+ {
+ if (class_exists('WC_Subscriptions') &&
+ WC_Subscriptions_Cart::cart_contains_subscription() &&
+ !$this->isSubscriptionEnabled()) {
+ unset($available_gateways[$this->id]);
+ }
+ return $available_gateways;
+ }
+
+ /**
+ * Checks if Payment is enabled for Subsciptions
+ *
+ * @return bool
+ */
+ public function isSubscriptionEnabled()
+ {
+ $enabled = false;
+ if ($this->get_option('activate_for_subscriptions') === 'yes') {
+ $enabled = true;
+ }
+ return $enabled;
+ }
+
+ /**
+ * additional formfields for admin backend
+ */
public function initFormFieldsAddon()
{
- if (class_exists('WC_Subscriptions_Order')) {
+ if (class_exists('WC_Subscriptions')) {
+ $this->form_fields['activate_for_subscriptions'] = array(
+ 'title' => __('Enable/Disable Sub', 'woocommerce-heidelpay'),
+ 'type' => 'checkbox',
+ 'label' => __('Enable for Subscriptions', 'woocommerce-heidelpay'),
+ 'default' => 'yes'
+ );
$this->form_fields['transaction_channel_subscription'] = array(
'title' => __('Transaction Channel for Subscriptions', 'woocommerce-heidelpay'),
'type' => 'text',
'id' => $this->id . '_transaction_channel_subscriptions',
'description' => 'Transaction Channel for Subscriptions',
- 'default' => '');
+ 'default' => ''
+ );
}
}
@@ -52,32 +100,57 @@ public function initFormFieldsAddon()
* @param $amount float
* @param $renewalOrder WC_Order
* @return array|null
- * @throws \Heidelpay\PhpPaymentApi\Exceptions\PaymentFormUrlException
+ * @throws Exception
*/
public function scheduledSubscriptionPayment($amount, $renewalOrder)
{
/** @var WC_Order $order */
//$order = wcs_get_order
$order = WC_Subscriptions_Renewal_Order::get_parent_order($renewalOrder->get_id());
- parent::prepareRequest($renewalOrder);
+ $this->prepareSubscriptionPayment($renewalOrder);
$this->payMethod->getRequest()->getFrontend()->setEnabled('FALSE');
try {
$this->payMethod->debitOnRegistration($order->get_meta('heidelpay-Registration'));
} catch (Exception $e) {
- wc_get_logger()->log(WC_Log_Levels::DEBUG, $e);
+ wc_get_logger()->error($e, array('source' => 'heidelpay'));
return null;
}
- /** @var \Heidelpay\PhpPaymentApi\Response $response */
+ /** @var Response $response */
$response = $this->payMethod->getResponse();
- if ($this->payMethod->getResponse()->isSuccess()) {
+ if ($response->isSuccess() && !$response->isPending()) {
+ parent::setPaymentInfo($renewalOrder, $response);
$renewalOrder->payment_complete($response->getIdentification()->getShortId());
}
- if ($this->payMethod->getResponse()->isError()) {
- wc_get_logger()->log(WC_Log_Levels::DEBUG, print_r($this->payMethod->getResponse()->getError(), 1));
+ if ($response->isError()) {
+ wc_get_logger()->error(
+ print_r($this->payMethod->getResponse()->getError(), 1),
+ array('source' => 'heidelpay')
+ );
}
return null;
}
+
+ public function prepareSubscriptionPayment($order)
+ {
+ $isSandbox = false;
+ $channel = $this->get_option('transaction_channel_subscription');
+ if ($this->get_option('sandbox') === 'yes') {
+ $isSandbox = true;
+ }
+ $this->payMethod->getRequest()->authentification(
+ $this->get_option('security_sender'),
+ $this->get_option('user_login'),
+ $this->get_option('user_password'),
+ $channel,
+ $isSandbox
+ );
+ $this->setAsync();
+ $this->setCustomer($order);
+ $this->setBasket($order->get_id());
+ $this->setCriterions();
+ $this->payMethod->getRequest()->getContact()->setIp(WC_Geolocation::get_ip_address());
+ }
}
diff --git a/languages/woocommerce-heidelpay-de_DE.mo b/languages/woocommerce-heidelpay-de_DE.mo
index 3dff71f..d9162dd 100644
Binary files a/languages/woocommerce-heidelpay-de_DE.mo and b/languages/woocommerce-heidelpay-de_DE.mo differ
diff --git a/languages/woocommerce-heidelpay-de_DE.po b/languages/woocommerce-heidelpay-de_DE.po
index 259684b..1cc9b59 100644
--- a/languages/woocommerce-heidelpay-de_DE.po
+++ b/languages/woocommerce-heidelpay-de_DE.po
@@ -1,72 +1,64 @@
-# Copyright (C) 2018 heidelpay GmbH
-# This file is distributed under the same license as the heidelpay WooCommerce package.
msgid ""
msgstr ""
-"Project-Id-Version: heidelpay WooCommerce 1.0.0\n"
-"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-heidelpay"
+"Project-Id-Version: heidelpay WooCommerce 1.7.0\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-"
"heidelpay\n"
-"POT-Creation-Date: 2018-06-13 08:38:11+00:00\n"
+"POT-Creation-Date: 2020-06-05T07:45:49+00:00\n"
+"PO-Revision-Date: 2020-06-05 08:31+0000\n"
+"Last-Translator: Florian Evertz
\n"
+"Language-Team: German (Germany)\n"
+"Language: de-DE\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2018-06-13 13:37+00:00\n"
-"Last-Translator: DANIEL KRAUT \n"
-"Language-Team: GERMAN\n"
+"X-Loco-Source-Locale: de_DE\n"
+"X-Generator: Loco https://localise.biz/\n"
+"X-Domain: woocommerce-heidelpay\n"
+"\n"
+"X-Loco-Parser: loco_parse_po"
-msgid "invoice_info"
-msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto: "
- "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
- "IBAN: {CONNECTOR_ACCOUNT_IBAN} "
- "BIC: {CONNECTOR_ACCOUNT_BIC} "
- "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
- "{IDENTIFICATION_SHORTID} "
-
-msgid "prepayment_info"
-msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto: "
- "Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
- "IBAN: {CONNECTOR_ACCOUNT_IBAN} "
- "Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
- "{IDENTIFICATION_SHORTID} "
+#. Plugin Name of the plugin
+msgid "heidelpay WooCommerce"
+msgstr "heidelpay WooCommerce"
-msgid "direct_debit_info"
-msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht: "
- "IBAN: {Iban} "
- "Die Abbuchung enthält die Mandatsreferenz-ID: {Ident} "
- "und die Gläubiger ID: {CreditorId} "
- " "
- "Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto."
+#. Plugin URI of the plugin
+msgid "https://dev.heidelpay.com"
+msgstr "https://dev.heidelpay.com"
-msgid "datePlaceholder"
-msgstr "tt.mm.jjjj"
+#. Description of the plugin
+msgid "heidelpay payment integration for WooCommerce"
+msgstr "heidelpay Zahlarten für WooCommerce"
-msgid "dateFormat"
-msgstr "dd.mm.yy"
+#. Author of the plugin
+msgid "heidelpay"
+msgstr "heidelpay GmbH"
-msgid "invalid date format"
-msgstr "Ungültiges Datumsformat."
+#. Author URI of the plugin
+msgid "htts://www.heidelpay.com"
+msgstr "htts://www.heidelpay.com"
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:57
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62
msgid "Awaiting payment"
msgstr "Auf Zahlung warten"
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:150
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163
msgid "Pay Now"
msgstr "Jetzt bezahlen"
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:329
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417
msgid " Error: Paymentmethod was not found: "
msgstr "Fehler: Zahlart nicht gefunden: "
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:43
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:107
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:67
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47
msgid "%s"
msgstr "%s"
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:44
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:391
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61
msgid "heidelpay %s"
msgstr "heidelpay %s"
@@ -75,8 +67,9 @@ msgid "Enable/Disable"
msgstr "Aktivieren"
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:69
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56
msgid "Enable %s"
msgstr "%s aktivieren"
@@ -97,8 +90,10 @@ msgid "Payment method description that the customer will see on your checkout."
msgstr "Beschreibung der Zahlart im Checkout"
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:68
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:85
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49
msgid "Insert payment data for %s"
msgstr "Zahlungsdaten für %s einfügen"
@@ -110,16 +105,6 @@ msgstr "Anweisungen"
msgid "Instructions that will be added to the thank you page and emails."
msgstr "Anweisungen auf der Bestellbestätigungsseite und in E-Mails"
-msgid "Payment information mail"
-msgstr "Zahlungsdaten per mail"
-
-msgid "Add payment information to e-mail"
-msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu"
-
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:127
-msgid "The following account will be billed:"
-msgstr "Das folgende Konto wird belastet:"
-
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131
msgid "Security Sender"
msgstr "Security Sender"
@@ -148,179 +133,246 @@ msgstr "Sandbox"
msgid "Enable sandbox mode"
msgstr "Sandbox-Modus aktivieren"
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:353
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
msgid "Payment error: "
msgstr "Zahlungsfehler: "
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:428
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692
msgid "Bookingmode"
msgstr "Buchungsmodus"
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:431
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695
msgid "Debit"
msgstr "Direktbuchung"
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:432
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696
msgid "Authorization"
msgstr "Authorisierung"
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:435
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699
msgid "Choose a bookingmode"
msgstr "Buchungsmodus wählen"
-#: includes/class-wc-heidelpay-response.php:74
+#: includes/class-wc-heidelpay-push.php:123
+msgid "Payment of %s %s received. Heidelpay ShortID %s"
+msgstr "Zahlung über %s %s erhalten. heidelpay Short-ID %s"
+
+#: includes/class-wc-heidelpay-response.php:111
msgid ""
"Payment reservation successful. Please use the hiP to check the payment."
-msgstr "Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen."
+msgstr ""
+"Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen."
-#: includes/class-wc-heidelpay-response.php:81
+#: includes/class-wc-heidelpay-response.php:119
msgid "Awaiting payment."
msgstr "Auf Zahlung warten"
-#: includes/gateways/class-wc-heidelpay-gateway-cc.php:33
+#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55
msgid "Credit Card"
msgstr "Kreditkarte"
-#: includes/gateways/class-wc-heidelpay-gateway-dc.php:33
+#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55
msgid "Debit Card"
msgstr "Debitkarte"
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:47
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57
msgid "You have to enter the account holder"
msgstr "Bitte den Kontoinhaber eingeben"
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:54
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64
msgid "You have to enter the IBAN"
msgstr "Bitte die IBAN eingeben"
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:67
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63
+msgid "Payment information mail"
+msgstr "Zahlungsdaten per mail"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65
+msgid "Add payment information to e-mail"
+msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60
msgid "Account Holder"
msgstr "Kontoinhaber"
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104
msgid "IBAN"
msgstr "IBAN"
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129
msgid "Direct Debit"
msgstr "Lastschrift"
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:43
+#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36
+msgid "GiroPay"
+msgstr "GiroPay"
+
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36
msgid "iDeal"
msgstr "iDeal"
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:68
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61
msgid "Bank"
msgstr "Bank"
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
msgid "Chose a bank please."
msgstr "Bitte eine Bank wählen"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:249
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52
+msgid "please send the money to IBAN BIC "
+msgstr "Bitte überweisen Sie an IBAN BIC "
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68
+msgid "Invoice"
+msgstr "Rechnungskauf"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286
msgid "You have to be at least 18 years old in order to use secured invoice"
msgstr "Der versicherte Rechnungskauf ist erst ab 18 Jahren möglich"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:53
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47
msgid "You have to enter your salutation"
msgstr "Bitte Anrede wählen"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:60
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54
msgid "You are not allowed to use secured invoice with a company name"
msgstr "Der versicherte Rechnungskauf ist nicht für Firmenkunden möglich"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86
-msgid "please send the money to IBAN BIC "
-msgstr "Bitte überweisen Sie an IBAN BIC "
-
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:94
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109
msgid "Advanced options"
msgstr "Erweiterte Optionen"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115
msgid "Minimum Amount"
msgstr "Mindestbetrag"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:107
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122
msgid "Maxmimum Amount"
msgstr "Maximalbetrag"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:114
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129
msgid "Available Countries for secured invoice"
msgstr "Erlaubte Länder für den versicherten Rechnungskauf"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:116
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131
msgid ""
"Here you can enable secured Invoice for specific countries. Be aware that "
"this will not enable the country in your WooCommerce settings and you have "
"to enable them seperately."
msgstr ""
-"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder beschränken."
-"Bitte beachten Sie, dass sie entsprechende Länder weiterhin in den WooCommerce Einstellungen aktivieren müssen"
+"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder "
+"beschränken.Bitte beachten Sie, dass sie entsprechende Länder weiterhin in "
+"den WooCommerce Einstellungen aktivieren müssen"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:121
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139
msgid "Enable Germany"
msgstr "Deutschland aktivieren"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:127
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145
msgid "Enable Austria"
msgstr "Österreich aktivieren"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:202
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226
msgid "Salutation"
msgstr "Anrede"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:203
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227
msgid "Mr"
msgstr "Herr"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:204
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228
msgid "Mrs"
msgstr "Frau"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:205
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320
msgid "Birthdate"
msgstr "Geburtsdatum"
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:269
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230
+msgid "datePlaceholder"
+msgstr "tt.mm.jjjj"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231
+msgid "dateFormat"
+msgstr "dd.mm.yy"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302
msgid "Secured Invoice"
msgstr "Versicherter Rechnungskauf"
-#: woocommerce-heidelpay.php:213
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321
+msgid "invalid date format"
+msgstr "Ungültiges Datumsformat."
+
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82
+msgid "Prepayment"
+msgstr "Vorkasse"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84
+msgid "Enable/Disable Sub"
+msgstr "Abonnement aktiv"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86
+msgid "Enable for Subscriptions"
+msgstr "Für Abonnements aktivieren"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90
+msgid "Transaction Channel for Subscriptions"
+msgstr "Transaction Channel für Abonnements"
+
+#: woocommerce-heidelpay.php:236
msgid "minimal PHP version error"
msgstr "PHP-Version zu niedrig"
-#: woocommerce-heidelpay.php:219
+#: woocommerce-heidelpay.php:242
msgid "WooCommerce plugin not activated"
msgstr "Das WooCommerce Plug-In ist nicht aktiviert"
-#: woocommerce-heidelpay.php:223
+#: woocommerce-heidelpay.php:246
msgid "minimal WC version error"
msgstr "WooCommerce-Version zu niedrig"
-#: woocommerce-heidelpay.php:229
+#: woocommerce-heidelpay.php:252
msgid "cURL is not installed."
msgstr "cURL ist nicht installiert"
-#. Plugin Name of the plugin/theme
-msgid "heidelpay WooCommerce"
-msgstr "heidelpay WooCommerce"
-
-#. Plugin URI of the plugin/theme
-msgid "https://dev.heidelpay.com"
-msgstr "https://dev.heidelpay.com"
-
-#. Description of the plugin/theme
-msgid "heidelpay payment integration for WooCommerce"
-msgstr "heidelpay Zahlarten für WooCommerce"
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147
+msgid "direct_debit_info"
+msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht: "
+"IBAN: {Iban} "
+"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident} "
+"und die Gläubiger ID: {CreditorId} "
+" "
+"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto."
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62
+msgid "invoice_info"
+msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto: "
+"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"BIC: {CONNECTOR_ACCOUNT_BIC} "
+"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
+"{IDENTIFICATION_SHORTID} "
-#. Author of the plugin/theme
-msgid "heidelpay"
-msgstr "heidelpay GmbH"
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89
+msgid "prepayment_info"
+msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto: "
+"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
+"{IDENTIFICATION_SHORTID} "
-#. Author URI of the plugin/theme
-msgid "htts://www.heidelpay.com"
-msgstr "htts://www.heidelpay.com"
diff --git a/languages/woocommerce-heidelpay-de_DE_formal.mo b/languages/woocommerce-heidelpay-de_DE_formal.mo
new file mode 100644
index 0000000..d9162dd
Binary files /dev/null and b/languages/woocommerce-heidelpay-de_DE_formal.mo differ
diff --git a/languages/woocommerce-heidelpay-de_DE_formal.po b/languages/woocommerce-heidelpay-de_DE_formal.po
new file mode 100644
index 0000000..1cc9b59
--- /dev/null
+++ b/languages/woocommerce-heidelpay-de_DE_formal.po
@@ -0,0 +1,378 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: heidelpay WooCommerce 1.7.0\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-"
+"heidelpay\n"
+"POT-Creation-Date: 2020-06-05T07:45:49+00:00\n"
+"PO-Revision-Date: 2020-06-05 08:31+0000\n"
+"Last-Translator: Florian Evertz \n"
+"Language-Team: German (Germany)\n"
+"Language: de-DE\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Loco-Source-Locale: de_DE\n"
+"X-Generator: Loco https://localise.biz/\n"
+"X-Domain: woocommerce-heidelpay\n"
+"\n"
+"X-Loco-Parser: loco_parse_po"
+
+#. Plugin Name of the plugin
+msgid "heidelpay WooCommerce"
+msgstr "heidelpay WooCommerce"
+
+#. Plugin URI of the plugin
+msgid "https://dev.heidelpay.com"
+msgstr "https://dev.heidelpay.com"
+
+#. Description of the plugin
+msgid "heidelpay payment integration for WooCommerce"
+msgstr "heidelpay Zahlarten für WooCommerce"
+
+#. Author of the plugin
+msgid "heidelpay"
+msgstr "heidelpay GmbH"
+
+#. Author URI of the plugin
+msgid "htts://www.heidelpay.com"
+msgstr "htts://www.heidelpay.com"
+
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62
+msgid "Awaiting payment"
+msgstr "Auf Zahlung warten"
+
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163
+msgid "Pay Now"
+msgstr "Jetzt bezahlen"
+
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417
+msgid " Error: Paymentmethod was not found: "
+msgstr "Fehler: Zahlart nicht gefunden: "
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47
+msgid "%s"
+msgstr "%s"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61
+msgid "heidelpay %s"
+msgstr "heidelpay %s"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:97
+msgid "Enable/Disable"
+msgstr "Aktivieren"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56
+msgid "Enable %s"
+msgstr "%s aktivieren"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:103
+msgid "Title"
+msgstr "Bezeichnung"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:106
+msgid "This controls the title which the user sees during checkout."
+msgstr "Bezeichnung der Zahlart im Checkout"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:111
+msgid "Description"
+msgstr "Beschreibung"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:113
+msgid "Payment method description that the customer will see on your checkout."
+msgstr "Beschreibung der Zahlart im Checkout"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49
+msgid "Insert payment data for %s"
+msgstr "Zahlungsdaten für %s einfügen"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:121
+msgid "Instructions"
+msgstr "Anweisungen"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:123
+msgid "Instructions that will be added to the thank you page and emails."
+msgstr "Anweisungen auf der Bestellbestätigungsseite und in E-Mails"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131
+msgid "Security Sender"
+msgstr "Security Sender"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:138
+msgid "User Login"
+msgstr "User Login"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:145
+msgid "User Password"
+msgstr "User Password"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:152
+msgid "Transaction Channel"
+msgstr "Transaction Channel"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:159
+msgid "Secret"
+msgstr "Secret"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:167
+msgid "Sandbox"
+msgstr "Sandbox"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:170
+msgid "Enable sandbox mode"
+msgstr "Sandbox-Modus aktivieren"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
+msgid "Payment error: "
+msgstr "Zahlungsfehler: "
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692
+msgid "Bookingmode"
+msgstr "Buchungsmodus"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695
+msgid "Debit"
+msgstr "Direktbuchung"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696
+msgid "Authorization"
+msgstr "Authorisierung"
+
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699
+msgid "Choose a bookingmode"
+msgstr "Buchungsmodus wählen"
+
+#: includes/class-wc-heidelpay-push.php:123
+msgid "Payment of %s %s received. Heidelpay ShortID %s"
+msgstr "Zahlung über %s %s erhalten. heidelpay Short-ID %s"
+
+#: includes/class-wc-heidelpay-response.php:111
+msgid ""
+"Payment reservation successful. Please use the hiP to check the payment."
+msgstr ""
+"Reservierung der Zahlung erfolgreich. Bitte Zahlungseingang im hIP prüfen."
+
+#: includes/class-wc-heidelpay-response.php:119
+msgid "Awaiting payment."
+msgstr "Auf Zahlung warten"
+
+#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55
+msgid "Credit Card"
+msgstr "Kreditkarte"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55
+msgid "Debit Card"
+msgstr "Debitkarte"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57
+msgid "You have to enter the account holder"
+msgstr "Bitte den Kontoinhaber eingeben"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64
+msgid "You have to enter the IBAN"
+msgstr "Bitte die IBAN eingeben"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63
+msgid "Payment information mail"
+msgstr "Zahlungsdaten per mail"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65
+msgid "Add payment information to e-mail"
+msgstr "Fügt Zahlungsdaten der Bestätigungsmail hinzu"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60
+msgid "Account Holder"
+msgstr "Kontoinhaber"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104
+msgid "IBAN"
+msgstr "IBAN"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129
+msgid "Direct Debit"
+msgstr "Lastschrift"
+
+#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36
+msgid "GiroPay"
+msgstr "GiroPay"
+
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36
+msgid "iDeal"
+msgstr "iDeal"
+
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61
+msgid "Bank"
+msgstr "Bank"
+
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
+msgid "Chose a bank please."
+msgstr "Bitte eine Bank wählen"
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52
+msgid "please send the money to IBAN BIC "
+msgstr "Bitte überweisen Sie an IBAN BIC "
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68
+msgid "Invoice"
+msgstr "Rechnungskauf"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286
+msgid "You have to be at least 18 years old in order to use secured invoice"
+msgstr "Der versicherte Rechnungskauf ist erst ab 18 Jahren möglich"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47
+msgid "You have to enter your salutation"
+msgstr "Bitte Anrede wählen"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54
+msgid "You are not allowed to use secured invoice with a company name"
+msgstr "Der versicherte Rechnungskauf ist nicht für Firmenkunden möglich"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109
+msgid "Advanced options"
+msgstr "Erweiterte Optionen"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115
+msgid "Minimum Amount"
+msgstr "Mindestbetrag"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122
+msgid "Maxmimum Amount"
+msgstr "Maximalbetrag"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129
+msgid "Available Countries for secured invoice"
+msgstr "Erlaubte Länder für den versicherten Rechnungskauf"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131
+msgid ""
+"Here you can enable secured Invoice for specific countries. Be aware that "
+"this will not enable the country in your WooCommerce settings and you have "
+"to enable them seperately."
+msgstr ""
+"Hier können Sie den versicherten Rechnungskauf auf bestimmte Länder "
+"beschränken.Bitte beachten Sie, dass sie entsprechende Länder weiterhin in "
+"den WooCommerce Einstellungen aktivieren müssen"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139
+msgid "Enable Germany"
+msgstr "Deutschland aktivieren"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145
+msgid "Enable Austria"
+msgstr "Österreich aktivieren"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226
+msgid "Salutation"
+msgstr "Anrede"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227
+msgid "Mr"
+msgstr "Herr"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228
+msgid "Mrs"
+msgstr "Frau"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320
+msgid "Birthdate"
+msgstr "Geburtsdatum"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230
+msgid "datePlaceholder"
+msgstr "tt.mm.jjjj"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231
+msgid "dateFormat"
+msgstr "dd.mm.yy"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302
+msgid "Secured Invoice"
+msgstr "Versicherter Rechnungskauf"
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321
+msgid "invalid date format"
+msgstr "Ungültiges Datumsformat."
+
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82
+msgid "Prepayment"
+msgstr "Vorkasse"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84
+msgid "Enable/Disable Sub"
+msgstr "Abonnement aktiv"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86
+msgid "Enable for Subscriptions"
+msgstr "Für Abonnements aktivieren"
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90
+msgid "Transaction Channel for Subscriptions"
+msgstr "Transaction Channel für Abonnements"
+
+#: woocommerce-heidelpay.php:236
+msgid "minimal PHP version error"
+msgstr "PHP-Version zu niedrig"
+
+#: woocommerce-heidelpay.php:242
+msgid "WooCommerce plugin not activated"
+msgstr "Das WooCommerce Plug-In ist nicht aktiviert"
+
+#: woocommerce-heidelpay.php:246
+msgid "minimal WC version error"
+msgstr "WooCommerce-Version zu niedrig"
+
+#: woocommerce-heidelpay.php:252
+msgid "cURL is not installed."
+msgstr "cURL ist nicht installiert"
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147
+msgid "direct_debit_info"
+msgstr "Der Betrag von {AMOUNT} {CURRENCY} wird in den nächsten Tagen von folgendem Konto abgebucht: "
+"IBAN: {Iban} "
+"Die Abbuchung enthält die Mandatsreferenz-ID: {Ident} "
+"und die Gläubiger ID: {CreditorId} "
+" "
+"Bitte sorgen Sie für ausreichende Deckung auf dem entsprechenden Konto."
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62
+msgid "invoice_info"
+msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} nach Erhalt der Ware auf folgendes Konto: "
+"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"BIC: {CONNECTOR_ACCOUNT_BIC} "
+"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
+"{IDENTIFICATION_SHORTID} "
+
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89
+msgid "prepayment_info"
+msgstr "Bitte überweisen Sie uns den Betrag von {AMOUNT} {CURRENCY} auf folgendes Konto: "
+"Kontoinhaber: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"Geben Sie als Verwendungszweck bitte ausschließlich diese Identifikationsnummer an: "
+"{IDENTIFICATION_SHORTID} "
+
diff --git a/languages/woocommerce-heidelpay-en_US.po b/languages/woocommerce-heidelpay-en_US.po
index 9b2fac9..d9c76d5 100644
--- a/languages/woocommerce-heidelpay-en_US.po
+++ b/languages/woocommerce-heidelpay-en_US.po
@@ -1,31 +1,39 @@
-msgid "invoice_info"
-msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} after receiving your order to the following account "
- "Holder: {CONNECTOR_ACCOUNT_HOLDER} "
- "IBAN: {CONNECTOR_ACCOUNT_IBAN} "
- "BIC: {CONNECTOR_ACCOUNT_BIC} "
- "Please use only this identification number as the descriptor : "
- "{IDENTIFICATION_SHORTID} "
-
-msgid "prepayment_info"
-msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} to the following account "
- "Holder: {CONNECTOR_ACCOUNT_HOLDER} "
- "IBAN: {CONNECTOR_ACCOUNT_IBAN} "
- "Please use only this identification number as the descriptor : "
- "{IDENTIFICATION_SHORTID} "
-
-msgid "direct_debit_info"
-msgstr "The amount of {AMOUNT} {CURRENCY} will be debited from this account within the next days: "
- "IBAN: {Iban} "
- "The booking contains the mandate reference ID: {Ident} "
- "and the creditor identifier: {CreditorId} "
- " "
- "Please ensure that there will be sufficient funds on the corresponding account."
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230
msgid "datePlaceholder"
msgstr "yyyy-mm-dd"
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231
msgid "dateFormat"
msgstr "yy-mm-dd"
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321
msgid "invalid date format"
-msgstr "Invalid date format."
\ No newline at end of file
+msgstr "Invalid date format."
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147
+msgid "direct_debit_info"
+msgstr "The amount of {AMOUNT} {CURRENCY} will be debited from this account within the next days: "
+"IBAN: {Iban} "
+"The booking contains the mandate reference ID: {Ident} "
+"and the creditor identifier: {CreditorId} "
+" "
+"Please ensure that there will be sufficient funds on the corresponding account."
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62
+msgid "invoice_info"
+msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} after receiving your order to the following account "
+"Holder: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"BIC: {CONNECTOR_ACCOUNT_BIC} "
+"Please use only this identification number as the descriptor : "
+"{IDENTIFICATION_SHORTID} "
+
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89
+msgid "prepayment_info"
+msgstr "Please transfer the amount of {AMOUNT} {CURRENCY} to the following account "
+"Holder: {CONNECTOR_ACCOUNT_HOLDER} "
+"IBAN: {CONNECTOR_ACCOUNT_IBAN} "
+"Please use only this identification number as the descriptor : "
+"{IDENTIFICATION_SHORTID} "
diff --git a/languages/woocommerce-heidelpay.pot b/languages/woocommerce-heidelpay.pot
index ae9f6ae..372470d 100644
--- a/languages/woocommerce-heidelpay.pot
+++ b/languages/woocommerce-heidelpay.pot
@@ -1,50 +1,60 @@
-# Copyright (C) 2018 heidelpay WooCommerce
-# This file is distributed under the same license as the heidelpay WooCommerce package.
+# Copyright (C) 2020 heidelpay
+# This file is distributed under the same license as the heidelpay WooCommerce plugin.
msgid ""
msgstr ""
-"Project-Id-Version: heidelpay WooCommerce 1.1.2\n"
-"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-"
-"heidelpay\n"
-"POT-Creation-Date: 2018-06-15 08:21:52+00:00\n"
+"Project-Id-Version: heidelpay WooCommerce 1.7.0\n"
+"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-heidelpay\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: LANGUAGE \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME \n"
-"Language-Team: LANGUAGE \n"
+"POT-Creation-Date: 2020-06-09T11:33:32+00:00\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"X-Generator: WP-CLI 2.4.0\n"
+"X-Domain: woocommerce-heidelpay\n"
-#: includes/class-wc-heidelpay-response.php:134
-msgid "invoice_info"
+#. Plugin Name of the plugin
+msgid "heidelpay WooCommerce"
msgstr ""
-msgid "prepayment_info"
+#. Plugin URI of the plugin
+msgid "https://dev.heidelpay.com"
msgstr ""
-msgid "direct_debit_info"
+#. Description of the plugin
+msgid "heidelpay payment integration for WooCommerce"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:57
+#. Author of the plugin
+msgid "heidelpay"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "htts://www.heidelpay.com"
+msgstr ""
+
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:62
msgid "Awaiting payment"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:150
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163
msgid "Pay Now"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:163
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:329
+#: includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php:180
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:417
msgid " Error: Paymentmethod was not found: "
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:43
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:107
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:67
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:60
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:77
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:82
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:47
msgid "%s"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:44
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:391
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:61
msgid "heidelpay %s"
msgstr ""
@@ -53,8 +63,9 @@ msgid "Enable/Disable"
msgstr ""
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:99
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:69
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:91
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:56
msgid "Enable %s"
msgstr ""
@@ -75,8 +86,10 @@ msgid "Payment method description that the customer will see on your checkout."
msgstr ""
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:117
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:68
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:85
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:35
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:84
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:49
msgid "Insert payment data for %s"
msgstr ""
@@ -88,10 +101,6 @@ msgstr ""
msgid "Instructions that will be added to the thank you page and emails."
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:127
-msgid "The following account will be billed:"
-msgstr ""
-
#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:131
msgid "Security Sender"
msgstr ""
@@ -120,177 +129,228 @@ msgstr ""
msgid "Enable sandbox mode"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:353
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:452
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
msgid "Payment error: "
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:428
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:692
msgid "Bookingmode"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:431
-msgid "Direct debit"
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:695
+msgid "Debit"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:432
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:696
msgid "Authorization"
msgstr ""
-#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:435
+#: includes/abstracts/abstract-wc-heidelpay-payment-gateway.php:699
msgid "Choose a bookingmode"
msgstr ""
-#: includes/class-wc-heidelpay-response.php:74
-msgid ""
-"Payment reservation successful. Please use the hiP to check the payment."
+#: includes/class-wc-heidelpay-push.php:123
+msgid "Payment of %s %s received. Heidelpay ShortID %s"
msgstr ""
-#: includes/class-wc-heidelpay-response.php:81
+#: includes/class-wc-heidelpay-response.php:111
+msgid "Payment reservation successful. Please use the hiP to check the payment."
+msgstr ""
+
+#: includes/class-wc-heidelpay-response.php:119
msgid "Awaiting payment."
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-cc.php:33
+#: includes/gateways/class-wc-heidelpay-gateway-cc.php:55
msgid "Credit Card"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dc.php:33
+#: includes/gateways/class-wc-heidelpay-gateway-dc.php:55
msgid "Debit Card"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:47
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:57
msgid "You have to enter the account holder"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:54
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:64
msgid "You have to enter the IBAN"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:78
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:67
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:85
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:45
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:98
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:63
+msgid "Payment information mail"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:47
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:65
+msgid "Add payment information to e-mail"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:103
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:60
msgid "Account Holder"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:79
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104
msgid "IBAN"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-dd.php:104
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:129
msgid "Direct Debit"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:43
+#: includes/gateways/class-wc-heidelpay-gateway-gp.php:36
+msgid "GiroPay"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:36
msgid "iDeal"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:68
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:61
msgid "Bank"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-idl.php:124
+#: includes/gateways/class-wc-heidelpay-gateway-idl.php:104
msgid "Chose a bank please."
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:248
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:38
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:87
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:52
+msgid "please send the money to IBAN BIC "
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:68
+msgid "Invoice"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:41
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:286
msgid "You have to be at least 18 years old in order to use secured invoice"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:53
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:47
msgid "You have to enter your salutation"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:60
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:54
msgid "You are not allowed to use secured invoice with a company name"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:86
-msgid "please send the money to IBAN BIC "
-msgstr ""
-
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:94
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:109
msgid "Advanced options"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:100
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:115
msgid "Minimum Amount"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:107
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:122
msgid "Maxmimum Amount"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:114
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:129
msgid "Available Countries for secured invoice"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:116
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:131
msgid ""
"Here you can enable secured Invoice for specific countries. Be aware that "
"this will not enable the country in your WooCommerce settings and you have "
"to enable them seperately."
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:120
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:139
msgid "Enable Germany"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:126
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:145
msgid "Enable Austria"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:201
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:226
msgid "Salutation"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:202
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:227
msgid "Mr"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:203
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:228
msgid "Mrs"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:204
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:229
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:320
msgid "Birthdate"
msgstr ""
-#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:268
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:230
+msgid "datePlaceholder"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:231
+msgid "dateFormat"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:302
msgid "Secured Invoice"
msgstr ""
-#: woocommerce-heidelpay.php:218
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:321
+msgid "invalid date format"
+msgstr ""
+
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:82
+msgid "Prepayment"
+msgstr ""
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:84
+msgid "Enable/Disable Sub"
+msgstr ""
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:86
+msgid "Enable for Subscriptions"
+msgstr ""
+
+#: includes/traits/trait-wc-heidelpay-subscription-gateway.php:90
+msgid "Transaction Channel for Subscriptions"
+msgstr ""
+
+#: woocommerce-heidelpay.php:236
msgid "minimal PHP version error"
msgstr ""
-#: woocommerce-heidelpay.php:224
+#: woocommerce-heidelpay.php:242
msgid "WooCommerce plugin not activated"
msgstr ""
-#: woocommerce-heidelpay.php:228
+#: woocommerce-heidelpay.php:246
msgid "minimal WC version error"
msgstr ""
-#: woocommerce-heidelpay.php:234
+#: woocommerce-heidelpay.php:252
msgid "cURL is not installed."
msgstr ""
-#. Plugin Name of the plugin/theme
-msgid "heidelpay WooCommerce"
+#: includes/gateways/class-wc-heidelpay-gateway-dd.php:147
+msgid "direct_debit_info"
msgstr ""
-#. Plugin URI of the plugin/theme
-msgid "https://dev.heidelpay.com"
+#: includes/gateways/class-wc-heidelpay-gateway-iv.php:58
+#: includes/gateways/class-wc-heidelpay-gateway-ivpg.php:62
+msgid "invoice_info"
msgstr ""
-#. Description of the plugin/theme
-msgid "heidelpay payment integration for WooCommerce"
-msgstr ""
-#. Author of the plugin/theme
-msgid "heidelpay"
+#: includes/gateways/class-wc-heidelpay-gateway-pp.php:89
+msgid "prepayment_info"
msgstr ""
-#. Author URI of the plugin/theme
-msgid "htts://www.heidelpay.com"
-msgstr ""
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index 25979f5..a9344b8 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1,17 +1,17 @@
[
{
"name": "heidelpay/php-message-code-mapper",
- "version": "v1.0.1",
- "version_normalized": "1.0.1.0",
+ "version": "v1.0.2",
+ "version_normalized": "1.0.2.0",
"source": {
"type": "git",
"url": "https://github.com/heidelpay/php-message-code-mapper.git",
- "reference": "d19a61e5f079d1e66169aefcbbaae227bff64130"
+ "reference": "4d9390b8a271b2eda98e411cbf1624e4f5cf7947"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/heidelpay/php-message-code-mapper/zipball/d19a61e5f079d1e66169aefcbbaae227bff64130",
- "reference": "d19a61e5f079d1e66169aefcbbaae227bff64130",
+ "url": "https://api.github.com/repos/heidelpay/php-message-code-mapper/zipball/4d9390b8a271b2eda98e411cbf1624e4f5cf7947",
+ "reference": "4d9390b8a271b2eda98e411cbf1624e4f5cf7947",
"shasum": ""
},
"require": {
@@ -23,7 +23,7 @@
"heidelpay/phpdocumentor": "^2.9.1",
"phpunit/phpunit": "~5.7"
},
- "time": "2018-03-01T07:22:04+00:00",
+ "time": "2019-02-04T15:13:31+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -54,20 +54,21 @@
},
{
"name": "heidelpay/php-payment-api",
- "version": "v1.5.0",
- "version_normalized": "1.5.0.0",
+ "version": "v1.7.1",
+ "version_normalized": "1.7.1.0",
"source": {
"type": "git",
"url": "https://github.com/heidelpay/php-payment-api.git",
- "reference": "f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9"
+ "reference": "30b5be4a784de8c6ee67931a251fffa77a30ab4b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/heidelpay/php-payment-api/zipball/f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9",
- "reference": "f3bea9bb5af0f0fc498f9d20c58e1c04efac13a9",
+ "url": "https://api.github.com/repos/heidelpay/php-payment-api/zipball/30b5be4a784de8c6ee67931a251fffa77a30ab4b",
+ "reference": "30b5be4a784de8c6ee67931a251fffa77a30ab4b",
"shasum": ""
},
"require": {
+ "ext-json": "*",
"ext-simplexml": "*",
"lib-curl": "*",
"lib-openssl": "*",
@@ -81,16 +82,17 @@
},
"require-dev": {
"codacy/coverage": "^1.4",
- "codeception/aspect-mock": "~2.1.1",
+ "codeception/aspect-mock": "~3.0.0",
"codeception/codeception": "~2.3.9",
"friendsofphp/php-cs-fixer": "^2.0",
+ "heidelpay/php-basket-api": "^1.0",
"heidelpay/phpdocumentor": "2.9.1"
},
"suggest": {
"heidelpay/php-basket-api": "Use this package to transmit basket information.",
"heidelpay/php-message-code-mapper": "You can use this package to provide user-friendly messages instead of error codes."
},
- "time": "2018-04-13T07:21:22+00:00",
+ "time": "2019-02-25T15:29:11+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -102,23 +104,6 @@
"license": [
"proprietary"
],
- "authors": [
- {
- "name": "Jens Richter"
- },
- {
- "name": "Ronja Wann"
- },
- {
- "name": "Stephano Vogel"
- },
- {
- "name": "Daniel Kraut"
- },
- {
- "name": "Simon Gabriel"
- }
- ],
"description": "New client library for heidelpay payments replacing heidelpay/php-api.",
"homepage": "http://dev.heidelpay.com",
"keywords": [
diff --git a/vendor/heidelpay/php-message-code-mapper/LICENSE.txt b/vendor/heidelpay/php-message-code-mapper/LICENSE.txt
index 1cb85b7..5ea8db4 100644
--- a/vendor/heidelpay/php-message-code-mapper/LICENSE.txt
+++ b/vendor/heidelpay/php-message-code-mapper/LICENSE.txt
@@ -3,7 +3,7 @@ Lizenzvereinbarung Plug-in
I. Präambel
-Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der Heidelberger Payment GmbH (nachfolgend „heidelpay“).
+Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der heidelpay GmbH (nachfolgend „heidelpay“).
Das Plug-in von heidelpay ist ein Software-Programm, welches die Schnittstelle zum Payment-System von heidelpay mit einer Anwendung (zum Beispiel: Shopsystem, Warenwirtschaft, Debitorenmanagement etc.) verbindet. Das Plug-in dient dem Datenaustausch zwischen dem Payment-System von heidelpay und der Anwendung. Das Plug-in erweitert den Funktionsumfang der Anwendung hinsichtlich der mit heidelpay gesondert vertraglich vereinbarten Leistungen.
diff --git a/vendor/heidelpay/php-message-code-mapper/README.md b/vendor/heidelpay/php-message-code-mapper/README.md
index 3245499..c22968f 100644
--- a/vendor/heidelpay/php-message-code-mapper/README.md
+++ b/vendor/heidelpay/php-message-code-mapper/README.md
@@ -7,9 +7,9 @@
[![PHP 7.1](https://img.shields.io/badge/php-7.1-blue.svg)](http://www.php.net)
[![PHP 7.2](https://img.shields.io/badge/php-7.2-blue.svg)](http://www.php.net)
-![Logo](https://dev.heidelpay.de/devHeidelpay_400_180.jpg)
+![Logo](http://dev.heidelpay.com/devHeidelpay_400_180.jpg)
-**heidelpay message code mapper**
+## heidelpay message code mapper
This library provides user-friendly output of (error)-messages coming from
the heidelpay API.
@@ -72,3 +72,18 @@ Now you can return or print out the message by calling the `getMessage()` method
```echo $instance->getMessage($errorcode);```
Error codes are accepted in either the 'XXX.XXX.XXX' or 'HP-Error-XXX.XXX.XXX' format.
+
+## Support
+For any issues or questions please get in touch with our support.
+
+#### Web page
+https://dev.heidelpay.com/
+
+#### Email
+support@heidelpay.com
+
+#### Phone
++49 (0)6221/6471-100
+
+#### Twitter
+@devHeidelpay
\ No newline at end of file
diff --git a/vendor/heidelpay/php-message-code-mapper/composer.json b/vendor/heidelpay/php-message-code-mapper/composer.json
index efad51d..50df935 100644
--- a/vendor/heidelpay/php-message-code-mapper/composer.json
+++ b/vendor/heidelpay/php-message-code-mapper/composer.json
@@ -7,13 +7,13 @@
"authors": [
{
"name": "Stephano Vogel",
- "email": "development@heidelpay.de"
+ "email": "development@heidelpay.com"
}
],
"support" : {
"email" : "development@heidelpay.de"
},
- "homepage" : "https://dev.heidelpay.de",
+ "homepage" : "http://dev.heidelpay.com",
"autoload" : {
"psr-4": {
"Heidelpay\\MessageCodeMapper\\": "lib"
diff --git a/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php b/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php
index d675bbc..73ed577 100644
--- a/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php
+++ b/vendor/heidelpay/php-message-code-mapper/lib/Exceptions/MissingLocaleFileException.php
@@ -8,15 +8,13 @@
* This class is used for indicating a missing locale file for the library usage.
*
* @license Use of this software requires acceptance of the License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
- * @link https://dev.heidelpay.de/php-messages-code-mapper
+ * @link http://dev.heidelpay.com/php-messages-code-mapper
*
- * @author Stephano Vogel
+ * @author Stephano Vogel
*
- * @package heidelpay
- * @subpackage php-messages-code-mapper
- * @category php-messages-code-mapper
+ * @package heidelpay\php-message-code-mapper\exceptions
*/
class MissingLocaleFileException extends Exception
{
diff --git a/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php b/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php
index 94a9801..2476658 100644
--- a/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php
+++ b/vendor/heidelpay/php-message-code-mapper/lib/Helpers/FileSystem.php
@@ -6,15 +6,13 @@
* This class provides the functionality for reading the locale files.
*
* @license Use of this software requires acceptance of the License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
- * @link https://dev.heidelpay.de/php-messages-code-mapper
+ * @link http://dev.heidelpay.com/php-messages-code-mapper
*
- * @author Stephano Vogel
+ * @author Stephano Vogel
*
- * @package heidelpay
- * @subpackage php-messages-code-mapper
- * @category php-messages-code-mapper
+ * @package heidelpay\php-message-code-mapper
*/
class FileSystem
{
diff --git a/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php b/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php
index fb1ae09..6659096 100644
--- a/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php
+++ b/vendor/heidelpay/php-message-code-mapper/lib/MessageCodeMapper.php
@@ -13,15 +13,13 @@
* The path is important when own implementations have to be used.
*
* @license Use of this software requires acceptance of the License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
- * @link https://dev.heidelpay.de/php-messages-code-mapper
+ * @link http://dev.heidelpay.com/php-messages-code-mapper
*
- * @author Stephano Vogel
+ * @author Stephano Vogel
*
- * @package heidelpay
- * @subpackage php-messages-code-mapper
- * @category php-messages-code-mapper
+ * @package heidelpay\php-message-code-mapper
*/
class MessageCodeMapper
{
diff --git a/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php b/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php
index d93e619..38b472b 100644
--- a/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php
+++ b/vendor/heidelpay/php-message-code-mapper/tests/unit/MessageCodeMapperTest.php
@@ -10,11 +10,11 @@
* This class provides unit tests for the CustomerMessage implementation.
*
* @license Use of this software requires acceptance of the License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
- * @link https://dev.heidelpay.de/php-messages-code-mapper
+ * @link http://dev.heidelpay.com/php-messages-code-mapper
*
- * @author Stephano Vogel
+ * @author Stephano Vogel
*
* @package heidelpay
* @subpackage php-messages-code-mapper
diff --git a/vendor/heidelpay/php-payment-api/.travis.yml b/vendor/heidelpay/php-payment-api/.travis.yml
index 35d5f72..91a512a 100644
--- a/vendor/heidelpay/php-payment-api/.travis.yml
+++ b/vendor/heidelpay/php-payment-api/.travis.yml
@@ -3,8 +3,6 @@ dist: trusty
matrix:
fast_finish: true
include:
- - php: 5.6
- env: deps=no
- php: 7.0
env: deps=no
- php: 7.0
diff --git a/vendor/heidelpay/php-payment-api/CHANGELOG.md b/vendor/heidelpay/php-payment-api/CHANGELOG.md
index 1b1f2c8..0c391f6 100644
--- a/vendor/heidelpay/php-payment-api/CHANGELOG.md
+++ b/vendor/heidelpay/php-payment-api/CHANGELOG.md
@@ -3,6 +3,58 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
+## [v1.7.1][v1.7.1]
+
+### Added
+- Support for factoring.
+
+## [v1.7.0][v1.7.0]
+
+### Fixed
+- Santanter Invoice integration tests.
+
+### Added
+- Payment method for B2B invoice secured and corresponding tests.
+- Missing parameter CUSTOMER.OptIn_2 for Santander Invoice.
+- Example implementation for Santander paying by instalments.
+
+### Changed
+- Used BasketApi to enable additional integration tests for Santander IV.
+
+## [v1.6.2][v1.6.2]
+
+### Fixed
+- Path to autoloader in EasyCredit example.
+
+## [v1.6.1][v1.6.1]
+
+### Added
+- Example implementation for easyCredit payment method.
+- Json extension dependency to composer.json.
+
+### Changed
+- Updated readme file.
+
+## [v1.6.0][v1.6.0]
+
+### Added
+- Payment method 'Santander Hire Purchase' and corresponding tests (unit and integration).
+- Missing unit tests.
+
+### Changed
+- Replaced warning suppression in mapFromPost method.
+- Visibility of *Parent methods in `CreditCardPaymentMethod` and `DebitCardPaymentMethods`
+- Prohibit setting the mode parameter of the frontend group.
+- Renamed 'Heidelberger Payment GmbH' to 'heidelpay GmbH'.
+- Re-enabled test deactivated due to error with aspect-mock package.
+
+### Fixed
+- Parameter names in riskinformation group.
+- Fix test data.
+
+### Removed
+- Php 5.6 from travis workflow.
+
## [v1.5.0][v1.5.0]
### Added
- New unit test to cover finalize payment method.
@@ -109,4 +161,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[v1.3.0]: https://github.com/heidelpay/php-payment-api/compare/v1.2.0...v1.3.0
[v1.4.0]: https://github.com/heidelpay/php-payment-api/compare/v1.3.0...v1.4.0
[v1.4.1]: https://github.com/heidelpay/php-payment-api/compare/v1.4.0...v1.4.1
-[v1.5.0]: https://github.com/heidelpay/php-payment-api/compare/v1.4.0...v1.5.0
+[v1.5.0]: https://github.com/heidelpay/php-payment-api/compare/v1.4.1...v1.5.0
+[v1.6.0]: https://github.com/heidelpay/php-payment-api/compare/v1.5.0...v1.6.0
+[v1.6.1]: https://github.com/heidelpay/php-payment-api/compare/v1.6.0...v1.6.1
+[v1.6.2]: https://github.com/heidelpay/php-payment-api/compare/v1.6.1...v1.6.2
diff --git a/vendor/heidelpay/php-payment-api/LICENSE.txt b/vendor/heidelpay/php-payment-api/LICENSE.txt
index 1328017..698d371 100644
--- a/vendor/heidelpay/php-payment-api/LICENSE.txt
+++ b/vendor/heidelpay/php-payment-api/LICENSE.txt
@@ -5,7 +5,7 @@ Lizenzvereinbarung Plug-in
I. Präambel
- Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der Heidelberger Payment GmbH (nachfolgend „heidelpay“).
+ Diese Lizenzvereinbarung Plug-in (nachfolgend – „Vereinbarung“) bildet einen Vertrag zwischen dem Nutzer des Plug-ins und der heidelpay GmbH (nachfolgend „heidelpay“).
Das Plug-in von heidelpay ist ein Software-Programm, welches die Schnittstelle zum Payment-System von heidelpay mit einer Anwendung (zum Beispiel: Shopsystem, Warenwirtschaft, Debitorenmanagement etc.) verbindet. Das Plug-in dient dem Datenaustausch zwischen dem Payment-System von heidelpay und der Anwendung. Das Plug-in erweitert den Funktionsumfang der Anwendung hinsichtlich der mit heidelpay gesondert vertraglich vereinbarten Leistungen.
@@ -90,7 +90,7 @@ Plug-in Licence Agreement
I. Introduction
- This Plug-in Licence Agreement (hereinafter 'Agreement') constitutes a contract between the plug-in user and Heidelberger Payment GmbH (hereinafter 'heidelpay').
+ This Plug-in Licence Agreement (hereinafter 'Agreement') constitutes a contract between the plug-in user and heidelpay GmbH (hereinafter 'heidelpay').
The plug-in from heidelpay is a software programme which links the heidelpay payment system interface to an application (for example, shop system, merchandise management, debtor management etc.). The plug-in is used to exchange data between the heidelpay payment system and the application. The plug-in expands the range of features in the application with regard to the services agreed separately with heidelpay.
diff --git a/vendor/heidelpay/php-payment-api/README.md b/vendor/heidelpay/php-payment-api/README.md
index 9407036..5df91db 100644
--- a/vendor/heidelpay/php-payment-api/README.md
+++ b/vendor/heidelpay/php-payment-api/README.md
@@ -28,8 +28,10 @@ This is the php payment api for heidelpay. The library will help you to easily i
* EPS
* invoice
* invoice secured b2c
+* invoice secured b2b
* direct debit secured b2c
* Santander invoice
+* Santander hire purchase
* easyCredit
* Payolution invoice
@@ -45,6 +47,21 @@ application takes care of sql injection, cross-site-scripting (xss) and so on. T
You can find a copy of this license in [LICENSE.txt](LICENSE.txt).
+## Support
+For any issues or questions please get in touch with our support.
+
+#### Web page
+https://dev.heidelpay.com/
+
+#### Email
+support@heidelpay.com
+
+#### Phone
++49 (0)6221/6471-100
+
+#### Twitter
+@devHeidelpay
+
## Documentation
Please visit [http://dev.heidelpay.com/heidelpay-php-payment-api/](http://dev.heidelpay.com/heidelpay-php-payment-api/) for the developer documentation.
@@ -54,19 +71,25 @@ Please visit [http://dev.heidelpay.com/heidelpay-php-payment-api/](http://dev.he
This library comes with a set of unit and integration tests. Please do not run the integration tests on each build.
Run prior to tests:
-`codecept build`
+`vendor/bin/codecept build`
Run unit tests:
-`codecept run unit`
+`vendor/bin/codecept run unit`
Run unit tests with code coverage report:
-`codecept run unit --coverage --coverage-html`
+`vendor/bin/codecept run unit --coverage --coverage-html`
Run integration tests:
-`codecept run integration`
+`vendor/bin/codecept run integration`
Run integration tests with debug output:
-`codecept run integration --debug`
+`vendor/bin/codecept run integration --debug`
+
+Run all integration test of a specific class:
+`vendor/bin/codecept run tests/integration/PaymentMethods/EasyCreditPaymentMethodTest`
+
+Run a specific integration test:
+`vendor/bin/codecept run tests/integration/PaymentMethods/EasyCreditPaymentMethodTest:initialRequest`
For coverage analysis results see:
`./tests/_output/coverage/index.html`
@@ -85,3 +108,5 @@ to
Please make sure to switch it off again, after you launch your application.
+To enable the easyCredit example you might have to change the file permissions for the file "example/EasyCredit/EasyCreditResponseParams.txt".\
+It will be used to store the post-parameters send asynchronously by the payment which otherwise would not be accessable in the client session.
diff --git a/vendor/heidelpay/php-payment-api/composer.json b/vendor/heidelpay/php-payment-api/composer.json
index 9def072..b43019c 100644
--- a/vendor/heidelpay/php-payment-api/composer.json
+++ b/vendor/heidelpay/php-payment-api/composer.json
@@ -2,35 +2,20 @@
"name": "heidelpay/php-payment-api",
"description": "New client library for heidelpay payments replacing heidelpay/php-api.",
"license": "proprietary",
- "authors": [
- {
- "name": "Jens Richter"
- },
- {
- "name": "Ronja Wann"
- },
- {
- "name": "Stephano Vogel"
- },
- {
- "name": "Daniel Kraut"
- },
- {
- "name": "Simon Gabriel"
- }
- ],
"require": {
"php": ">=5.6.0",
"lib-curl": "*",
"lib-openssl": "*",
- "ext-SimpleXML": "*"
+ "ext-SimpleXML": "*",
+ "ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"heidelpay/phpdocumentor": "2.9.1",
"codeception/codeception": "~2.3.9",
- "codeception/aspect-mock": "~2.1.1",
- "codacy/coverage": "^1.4"
+ "codeception/aspect-mock": "~3.0.0",
+ "codacy/coverage": "^1.4",
+ "heidelpay/php-basket-api": "^1.0"
},
"suggest": {
"heidelpay/php-message-code-mapper": "You can use this package to provide user-friendly messages instead of error codes.",
diff --git a/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php b/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php
index 1b2e628..6b271b9 100644
--- a/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php
+++ b/vendor/heidelpay/php-payment-api/example/CreditCardRegistration.php
@@ -88,7 +88,7 @@
);
/**
- * Set necessary parameters for Heidelpay payment Frame and send a registration request
+ * Set necessary parameters for heidelpay payment Frame and send a registration request
*/
$CreditCard->registration(
HEIDELPAY_PHP_PAYMENT_API_URL,
@@ -97,7 +97,7 @@
// PreventAsyncRedirect - this will tell the payment weather it should redirect the customer or not
HEIDELPAY_PHP_PAYMENT_API_URL .
HEIDELPAY_PHP_PAYMENT_API_FOLDER .
- 'style.css' // CSSPath - css url to style the Heidelpay payment frame
+ 'style.css' // CSSPath - css url to style the heidelpay payment frame
);
?>
diff --git a/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php b/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php
index d3c0ee3..891bfa3 100644
--- a/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php
+++ b/vendor/heidelpay/php-payment-api/example/DebitCardDebit.php
@@ -88,13 +88,13 @@
);
/**
- * Set necessary parameters for Heidelpay payment Frame and send a registration request
+ * Set necessary parameters for heidelpay payment Frame and send a registration request
*/
$DebitCard->debit(
HEIDELPAY_PHP_PAYMENT_API_URL, // PaymentFrameOrigin - uri of your application like https://dev.heidelpay.com
'FALSE', // PreventAsyncRedirect - this will tell the payment weather it should redirect the customer or not
HEIDELPAY_PHP_PAYMENT_API_URL .
- HEIDELPAY_PHP_PAYMENT_API_FOLDER // CSSPath - css url to style the Heidelpay payment frame
+ HEIDELPAY_PHP_PAYMENT_API_FOLDER // CSSPath - css url to style the heidelpay payment frame
);
?>
diff --git a/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php b/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php
index 8fed576..6a31a75 100644
--- a/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php
+++ b/vendor/heidelpay/php-payment-api/example/DirectDebitRegistration.php
@@ -88,7 +88,7 @@
);
/**
- * Set necessary parameters for Heidelpay payment Frame and send a registration request
+ * Set necessary parameters for heidelpay payment Frame and send a registration request
*/
$DirectDebit->registration();
?>
diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit.php b/vendor/heidelpay/php-payment-api/example/EasyCredit.php
new file mode 100644
index 0000000..f570cd7
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/EasyCredit.php
@@ -0,0 +1,141 @@
+EasyCredit example';
+ echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.';
+ exit;
+}
+
+//####### 1. Create an instance of the easyCredit payment method. ######################################################
+/**
+ * Load a new instance of the payment method
+ */
+ $easyCredit = new EasyCreditPaymentMethod();
+
+//####### 2. Prepare and send an initialization request. ######################################################
+//####### The response will provide a redirectUrl to a form where the customer can select the payment plan #
+//####### And an opt-in text the customer needs to agree to before redirecting him to the redirectUrl. #
+//####### Please make sure to set the riskinformation (see below) in order to increase acceptance rate. #
+
+/**
+ * Set up your authentification data for Heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$easyCredit->getRequest()->authentification(
+ '31HA07BC8181E8CCFDAD64E8A4B3B766', // SecuritySender
+ '31ha07bc8181e8ccfdad73fd513d2a53', // UserLogin
+ '4B2D4BE3', // UserPassword
+ '31HA07BC8179C95F6B59366492FD253D', // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+
+/**
+ * Set up asynchronous request parameters
+ */
+$easyCredit->getRequest()->async(
+ 'EN', // Language code for the Frame
+ RESPONSE_URL // Response url from your application
+);
+
+/**
+ * Set up customer information required for risk checks
+ */
+$easyCredit->getRequest()->customerAddress(
+ 'Heidel', // Given name
+ 'Berger-Payment', // Family name
+ null, // Company Name
+ '12344', // Customer id of your application
+ 'Vagerowstr. 18', // Billing address street
+ 'DE-BW', // Billing address state
+ '69115', // Billing address post code
+ 'Heidelberg', // Billing address city
+ 'DE', // Billing address country code
+ 'support@heidelpay.com' // Customer mail address
+);
+
+/**
+ * Set up basket or transaction information
+ */
+$easyCredit->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ 203.12, // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * Set up risk information.
+ */
+$easyCredit->getRequest()->getRiskInformation()
+ ->setCustomerGuestCheckout('false')
+ ->setCustomerOrderCount('23')
+ ->setCustomerSince('2005-08-12');
+
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$easyCredit->initialize();
+
+?>
+
+
+ EasyCredit example
+
+
+EasyCredit example';
+$response = $easyCredit->getResponse();
+if ($response->isSuccess()) {
+ echo '';
+ } else {
+ echo ''. print_r($response->getError(), 1).' ';
+ }
+ ?>
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php
new file mode 100644
index 0000000..39b6d70
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditConstants.php
@@ -0,0 +1,25 @@
+
+ *
+ * @package heidelpay/${Package}
+ */
+
+require_once __DIR__ . '/../_enableExamples.php';
+if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) {
+ exit();
+}
+
+const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER;
+define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'EasyCredit/EasyCreditResponse.php');
+define('RESERVATION_URL', EXAMPLE_BASE_FOLDER . 'EasyCredit/EasyCreditReservation.php');
+define('RESPONSE_FILE_NAME', __DIR__ . '/EasyCreditResponseParams.txt');
+define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php');
+define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php');
diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php
new file mode 100644
index 0000000..dee1116
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditReservation.php
@@ -0,0 +1,116 @@
+getRequest();
+
+/**
+ * Set up your authentification data for Heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$request->authentification(
+ '31HA07BC8181E8CCFDAD64E8A4B3B766', // SecuritySender
+ '31ha07bc8181e8ccfdad73fd513d2a53', // UserLogin
+ '4B2D4BE3', // UserPassword
+ '31HA07BC8179C95F6B59366492FD253D', // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+
+//####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the ##
+//####### readability of the example. This results in the payment server sending the response to the request #
+//####### immediately in the http-response of this request rather then sending it asyncronuously to the responseUrl #
+//####### (as seen before).
+/**
+ * Set up asynchronous request parameters
+ */
+$request->getFrontend()->setEnabled('FALSE');
+
+/**
+ * Set up customer information required for risk checks
+ */
+$request->customerAddress(
+ 'Heidel', // Given name
+ 'Berger-Payment', // Family name
+ null, // Company Name
+ '12344', // Customer id of your application
+ 'Vagerowstr. 18', // Billing address street
+ 'DE-BW', // Billing address state
+ '69115', // Billing address post code
+ 'Heidelberg', // Billing address city
+ 'DE', // Billing address country code
+ 'support@heidelpay.com' // Customer mail address
+);
+
+/**
+ * Set up basket or transaction information
+ */
+$request->basketData(
+ '2843294932', // Reference Id of your application
+ 203.12, // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * Set up risk information.
+ */
+$request->getRiskInformation()
+ ->setCustomerGuestCheckout('false')
+ ->setCustomerOrderCount('23')
+ ->setCustomerSince('2005-08-12');
+
+//####### 11.2. This time we call the method authorizeOnRegistration passing along the uniqueId of the previous #######
+//####### initialization as a reference to let the payment server know which payment plan to use. #
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$easyCredit->authorizeOnRegistration($response->getIdentification()->getUniqueId());
+$authorizationResponse = $easyCredit->getResponse();
+
+//####### 12. Now we redirect to the success or error page depending on the result of the request. #####################
+//####### Keep in mind there are three possible results: Success, Pending and Error. #
+//####### Since both pending and success indicate a successful handling by the payment server both should #
+//####### redirect to the success page. #
+$url = HEIDELPAY_SUCCESS_PAGE;
+if ($authorizationResponse->isError()) {
+ $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $authorizationResponse->getError()['message'];
+}
+
+header('Location: ' . $url); // perform the redirect
+?>
diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php
new file mode 100644
index 0000000..c192c77
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponse.php
@@ -0,0 +1,89 @@
+
+
+
+ EasyCredit example
+
+
+EasyCredit example';
+if ($response->isSuccess()) {
+ echo 'Please approve your payment plan: ' . '';
+ $amortisationtext = $response->getCriterion()->get('EASYCREDIT_AMORTISATIONTEXT');
+ $precontractInformationUrl = $response->getCriterion()->get('EASYCREDIT_PRECONTRACTINFORMATIONURL');
+ echo $amortisationtext . '';
+ echo 'Download the precontract information here... ';
+ echo 'Order total: ' . $response->getCriterion()->get('EASYCREDIT_TOTALORDERAMOUNT') . '';
+ echo 'Interest: '. $response->getCriterion()->get('EASYCREDIT_ACCRUINGINTEREST') . '';
+ echo 'Total incl. interest: '. $response->getCriterion()->get('EASYCREDIT_TOTALAMOUNT') . '';
+
+ echo'Place order... ';
+} else {
+ echo ''. print_r($response->getError(), 1).' ';
+}
+?>
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponseParams.txt b/vendor/heidelpay/php-payment-api/example/EasyCredit/EasyCreditResponseParams.txt
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php
new file mode 100644
index 0000000..81fae4f
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceConstants.php
@@ -0,0 +1,29 @@
+
+ *
+ * @package heidelpay/${Package}
+ */
+
+require_once __DIR__ . '/../_enableExamples.php';
+if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) {
+ exit();
+}
+
+const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER;
+define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'FactoringInvoice/FactoringInvoiceResponse.php');
+define('REVERSAL_URL', EXAMPLE_BASE_FOLDER . 'FactoringInvoice/FactoringInvoiceReversal.php');
+define('RESPONSE_FILE_NAME', __DIR__ . '/FactoringInvoiceResponseParams.txt');
+define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php');
+define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php');
+
+define('HEIDELPAY_TRANSACTION_CHANNEL', '31HA07BC8129FBA7AF65A35EC4E540C2');
+
+require_once __DIR__ . '/../_HeidelpayConstants.php';
\ No newline at end of file
diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php
new file mode 100644
index 0000000..8d4a9bc
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponse.php
@@ -0,0 +1,116 @@
+
+
+
+ Factoring example
+
+
+Invoice Factoring example';
+if ($response->isSuccess()) {
+ $paymentCode = explode('.', $response->getPayment()->getCode());
+ if($paymentCode[1] === 'PA') {
+ echo 'Reservation Sucessful: ' . '';
+ echo 'The Customer journey ends here.' . '';
+
+ /** ####### 9. Here finalize the order directly after successful reservation. In your case this should happen
+ * together with the shipping.
+ */
+
+ $basketData = [
+ '2843294932',
+ $response->getPresentation()->getAmount(),
+ $response->getPresentation()->getCurrency(),
+ '39542395235ßfsokkspreipsr'
+ ];
+
+ $invoicePaymentMethod = new InvoiceB2CSecuredPaymentMethod();
+ $invoicePaymentMethod->getRequest()->basketData(...$basketData);
+ $invoicePaymentMethod->getRequest()->authentification(
+ HEIDELPAY_SECURITY_SENDER, // SecuritySender
+ HEIDELPAY_USER_LOGIN, // UserLogin
+ HEIDELPAY_USER_PASSWORD, // UserPassword
+ HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel
+ true // Enable sandbox mode
+ );
+
+ /**
+ * Following steps are done by the Merchant:
+ * Order was shipped and finalized automatically.
+ * Insurance is active from now on.
+ * Sometimes a reversal is necessary.
+ */
+ $invoicePaymentMethod->finalize($response->getPaymentReferenceId());
+ $finalizeResponse = $invoicePaymentMethod->getResponse();
+ if ($finalizeResponse->isSuccess() || $finalizeResponse->getError()['cod'] === '700.400.800') {
+ echo"Following steps are done by the Merchant: \n
+ Usually the merchant finalizes the order with the shipping. In this example we did this automatically.
+ Insurance is active from now on.
+
";
+
+ echo 'Sometimes a reversal is necessary. This can be done here. Continue with Reversal
+
';
+ } else {
+ echo ''. print_r($finalizeResponse->getError(), 1).' ';
+ }
+ }
+
+} else {
+ echo ''. print_r($response->getError(), 1).' ';
+}
+?>
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponseParams.txt b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceResponseParams.txt
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php
new file mode 100644
index 0000000..31d82c5
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoice/FactoringInvoiceReversal.php
@@ -0,0 +1,121 @@
+getIdentification()->getShortId() . ' and the amount of '
+ . $response->getPresentation()->getAmount() .' ' . $response->getPresentation()->getCurrency()
+ . ' be reversed?';
+ echo '';
+ return;
+}
+
+// Check whether reversal was confirmed my merchant.
+if(empty($_POST['reversal_last_transaction'])) {
+ echo print_r($_POST, 1);
+ return;
+}
+
+//####### 11.1 We now prepare a reversal request however this has a few differences: ###############
+/**
+ * Load a new instance of the payment method
+ */
+$factoringInvoice = new InvoiceB2CSecuredPaymentMethod();
+
+/**
+ * Set up your authentification data for heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$factoringInvoice->getRequest()->authentification(
+ HEIDELPAY_SECURITY_SENDER, // SecuritySender
+ HEIDELPAY_USER_LOGIN, // UserLogin
+ HEIDELPAY_USER_PASSWORD, // UserPassword
+ HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+
+ /**
+ * ####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the
+ * ####### readability of the example. This results in the payment server sending the response to the request
+ * ####### immediately in the http-response of this request rather then sending it asynchronously to the responseUrl
+ * ####### (as seen before).
+ *
+ * Set up synchronous request parameters
+ */
+$factoringInvoice->getRequest()->getFrontend()->setEnabled('FALSE');
+
+// Set up basket for transaction information. The amount that is set here will be the amount of the reversal.
+$factoringInvoice->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ $response->getPresentation()->getAmount(), // Amount of reversal:
+ $response->getPresentation()->getCurrency(), // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/* ###### 11.2. This time we call the method reversal passing along the uniqueId of the previous #######
+ * ###### reservation as a reference to let the payment server know which payment we want to reversal.
+ * ###### The difference to a normal reversal is the additional Parameter $reversalType
+ * ###### The api provides a Class to provide the available reversal types as constants.
+ *
+ *
+ */
+
+// Set necessary parameters for heidelpay payment and send the request.
+// For an other reversalType please enable code below. (only one reversal at a time)
+$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_CANCEL);
+//$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_CREDIT);
+//$factoringInvoice->reversal($response->getPaymentReferenceId(), ReversalType::RT_RETURN);
+
+$reversalResponse = $factoringInvoice->getResponse();
+
+//####### 12. Now we redirect to the success or error page depending on the result of the request. #####################
+//####### Keep in mind there are three possible results: Success, Pending and Error. #
+//####### Since both pending and success indicate a successful handling by the payment server both should #
+//####### redirect to the success page. #
+$url = HEIDELPAY_SUCCESS_PAGE;
+if ($reversalResponse->isError()) {
+ $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $reversalResponse->getError()['message'];
+}
+
+// Clear transaction. This is only necessary for this for this example since we only safe the one transaction at a time.
+if ($reversalResponse->isSuccess()) {
+ file_put_contents (RESPONSE_FILE_NAME, null);
+}
+
+header('Location: ' . $url); // perform the redirect
diff --git a/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php
new file mode 100644
index 0000000..90d7bf2
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/FactoringInvoiceB2CSecuredAuthorize.php
@@ -0,0 +1,157 @@
+Factoring Examle example';
+ echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.';
+ exit;
+}
+
+/**
+ * Require the composer autoloader file
+ */
+require_once __DIR__ . '/../../../autoload.php';
+
+//####### 1. Create an instance of the InvoiceB2CSecured payment method. ###############################################
+/**
+ * Load a new instance of the payment method
+ */
+$invoice = new InvoiceB2CSecuredPaymentMethod();
+
+
+//####### 2. Prepare and send an initialization request. ######################################################
+//####### The response will provide a redirectUrl to where the customer can be redirected to. #
+
+/**
+ * Set up your authentification data for Heidepay api. The Constants are defined in FactoringInvoiceConstants.php
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$invoice->getRequest()->authentification(
+ HEIDELPAY_SECURITY_SENDER, // SecuritySender
+ HEIDELPAY_USER_LOGIN, // UserLogin
+ HEIDELPAY_USER_PASSWORD, // UserPassword
+ HEIDELPAY_TRANSACTION_CHANNEL, // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+/**
+ * Set up asynchronous request parameters
+ */
+$invoice->getRequest()->async(
+ 'EN', // Language code for the Frame
+ RESPONSE_URL // Response url from your application
+);
+
+/**
+ * Set up customer information required for risk checks
+ */
+$invoice->getRequest()->customerAddress(
+ 'Heidel', // Given name
+ 'Berger-Payment', // Family name
+ null, // Company Name
+ '12344', // Customer id of your application
+ 'Vagerowstr. 18', // Billing address street
+ 'DE-BW', // Billing address state
+ '69115', // Billing address post code
+ 'Heidelberg', // Billing address city
+ 'DE', // Billing address country code
+ 'support@heidelpay.com' // Customer mail address
+);
+
+/********************************************************************************************************************'''
+ * ###### Call factoring function to set necessary parameters.
+ * ###### Second parameter $shopperId is not needed here since it is already set with function call customerAddress().
+ * ###### If not you can call the factoring() as you you can see below in the
+ * ###### commend.
+ *
+ * The InvoiceID has to be unique for the merchant.
+ */
+$invoice->getRequest()->factoring('iv' . date('YmdHis'));
+//$invoice->getRequest()->factoring('iv' . date('YmdHis'), '1234');
+
+/**
+ * Set up basket or transaction information
+ */
+$invoice->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ 23.12, // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * For secured payment methods it is necessary to add additional customer
+ * information. For a better exception rate please also provide the basket details
+ * by using the basket api.
+ */
+$invoice->getRequest()->b2cSecured(
+ 'MR', // Customer salutation
+ '1982-07-12', // Customer birth date
+ null // Basket api id
+);
+
+
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$invoice->authorize();
+?>
+
+
+ Invoice authorize with factoring example
+
+
+getResponse()->isSuccess()) {
+ echo 'place Invoice ';
+} else {
+ echo '' . print_r($invoice->getResponse()->getError(), 1) . ' ';
+}
+?>
+It is not necessary to show the redirect url to your customer. You can
+ use php header to forward your customer directly.
+ For example:
+ header('Location: '.$Invoice->getResponse()->getPaymentFromUrl());
+
+Note: If you can not provide the customer details for secured invoice form your
+ application. You can build a form using getPaymentFormUrl() and provide NAME.SALUTATION
+ and NAME.BIRTHDATE as input fields.
+
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php
index cd97d36..b063545 100644
--- a/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php
+++ b/vendor/heidelpay/php-payment-api/example/InvoiceAuthorize.php
@@ -88,7 +88,7 @@
);
/**
- * Set necessary parameters for Heidelpay payment and send the request
+ * Set necessary parameters for heidelpay payment and send the request
*/
$Invoice->authorize();
?>
diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php
new file mode 100644
index 0000000..d262564
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/InvoiceB2BSecuredAuthorize.php
@@ -0,0 +1,162 @@
+
+ *
+ * @category example
+ */
+
+/**
+ * For security reason all examples are disabled by default.
+ */
+
+use Heidelpay\PhpPaymentApi\Constants\CommercialSector;
+use Heidelpay\PhpPaymentApi\Constants\RegistrationType;
+use Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2BSecuredPaymentMethod;
+
+require_once './_enableExamples.php';
+if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') and HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) {
+ exit();
+}
+
+
+/**
+ * Require the composer autoloader file
+ */
+require_once __DIR__ . '/../../../autoload.php';
+
+/**
+ * Load a new instance of the payment method
+ */
+$invoice = new InvoiceB2BSecuredPaymentMethod();
+
+/**
+ * Set up your authentification data for Heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$invoice->getRequest()->authentification(
+ '31HA07BC8142C5A171745D00AD63D182', // SecuritySender
+ '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin
+ '93167DE7', // UserPassword
+ '31HA07BC8129FBA7AF655AB2C27E5B3C', // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+/**
+ * Set up asynchronous request parameters
+ */
+$invoice->getRequest()->async(
+ 'EN', // Language code for the Frame
+ HEIDELPAY_PHP_PAYMENT_API_URL .
+ HEIDELPAY_PHP_PAYMENT_API_FOLDER .
+ 'HeidelpayResponse.php' // Response url from your application
+);
+
+/**
+ * Set up customer information required for risk checks
+ */
+$invoice->getRequest()->customerAddress(
+ 'Heidel', // Given name
+ 'Berger-Payment', // Family name
+ null, // Company Name
+ '12344', // Customer id of your application
+ 'Vangerowstr. 18', // Billing address street
+ null, // Billing address state
+ '69115', // Billing address post code
+ 'Heidelberg', // Billing address city
+ 'DE', // Billing address country code
+ 'support@heidelpay.com' // Customer mail address
+);
+
+/**
+ * Set up basket or transaction information
+ */
+$invoice->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ round(23.199, 2), // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * Set up company information necessary for B2B.
+ */
+$companyArray = [
+ 'heidelpay GmbH', // Company name
+ null, // Address postbox
+ 'Vangerowstr. 18', // Address street
+ '69115', // Address zip
+ 'Heidelberg', // Address city
+ 'DE', // Address country
+ CommercialSector::AIR_TRANSPORT, // CommercialSector provides
+ RegistrationType::NOT_REGISTERED, // Registration Type
+ '123123', // commercial register number. Necessary if registration type is "REGISTERED"
+ '123456' // Vat id
+];
+
+/**
+ * Set up executive Information. Executive is necessary if registration type is "NOT_REGISTERED"
+ */
+$executive = [
+ 'Herr', // Salutation
+ 'Testkäufer', // Given name
+ 'Händler', // Family name
+ '1988-12-12', // Birthdate
+ 'example@email.de', // Email address
+ '062216471400', // Phone number
+ 'Vangerowstr. 18', // Address street
+ '69115', // Address zip
+ 'Heidelberg', // Address city
+ 'DE', // Address country
+];
+
+/**
+ * Set request data für B2B.
+ */
+$invoice->getRequest()->company(...$companyArray);
+$invoice->getRequest()->getCompany()->addExecutive(...$executive);
+
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$invoice->authorize();
+
+?>
+
+
+ Invoice authorize example
+
+
+getResponse()->isSuccess()) {
+ echo 'place Invoice ';
+} else {
+ echo '' . print_r($invoice->getResponse()->getError(), 1) . ' ';
+}
+?>
+It is not necessary to show the redirect url to your customer. You can
+ use php header to forward your customer directly.
+ For example:
+ header('Location: '.$Invoice->getResponse()->getPaymentFromUrl());
+
+Note: If you can not provide the customer details for secured invoice form your
+ application. You can build a form using getPaymentFormUrl() and provide NAME.SALUTATION
+ and NAME.BIRTDATE as input fields.
+
+
+
+
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php b/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php
index 71a1a1d..e866007 100644
--- a/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php
+++ b/vendor/heidelpay/php-payment-api/example/InvoiceB2CSecuredAuthorize.php
@@ -100,7 +100,7 @@
/**
- * Set necessary parameters for Heidelpay payment and send the request
+ * Set necessary parameters for heidelpay payment and send the request
*/
$Invoice->authorize();
?>
diff --git a/vendor/heidelpay/php-payment-api/example/PayPalDebit.php b/vendor/heidelpay/php-payment-api/example/PayPalDebit.php
index c6f0fb5..0683f09 100644
--- a/vendor/heidelpay/php-payment-api/example/PayPalDebit.php
+++ b/vendor/heidelpay/php-payment-api/example/PayPalDebit.php
@@ -88,7 +88,7 @@
);
/**
- * Set necessary parameters for Heidelpay payment Frame and send a registration request
+ * Set necessary parameters for heidelpay payment Frame and send a registration request
*/
$PayPal->debit();
?>
diff --git a/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php b/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php
index a60d1cf..0bb313e 100644
--- a/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php
+++ b/vendor/heidelpay/php-payment-api/example/PostFinanceCardAuthorize.php
@@ -9,7 +9,7 @@
*
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-payment-api/
*
diff --git a/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php b/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php
index bc66430..c401d6c 100644
--- a/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php
+++ b/vendor/heidelpay/php-payment-api/example/PrepaymentAuthorize.php
@@ -88,7 +88,7 @@
);
/**
- * Set necessary parameters for Heidelpay payment and send the request
+ * Set necessary parameters for heidelpay payment and send the request
*/
$Prepayment->authorize();
?>
diff --git a/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php b/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php
index eabc61e..7fea2c1 100644
--- a/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php
+++ b/vendor/heidelpay/php-payment-api/example/Przelewy24Authorize.php
@@ -9,7 +9,7 @@
*
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-payment-api/
*
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php b/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php
index d3c78df..af6c2f4 100644
--- a/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php
+++ b/vendor/heidelpay/php-payment-api/example/SantanderAuthorize.php
@@ -100,7 +100,7 @@
/**
- * Set necessary parameters for Heidelpay payment and send the request
+ * Set necessary parameters for heidelpay payment and send the request
*/
$Invoice->authorize();
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php
new file mode 100644
index 0000000..cde8240
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpConstants.php
@@ -0,0 +1,25 @@
+
+ *
+ * @package heidelpay/${Package}
+ */
+
+require_once __DIR__ . '/../_enableExamples.php';
+if (defined('HEIDELPAY_PHP_PAYMENT_API_EXAMPLES') && HEIDELPAY_PHP_PAYMENT_API_EXAMPLES !== true) {
+ exit();
+}
+
+const EXAMPLE_BASE_FOLDER = HEIDELPAY_PHP_PAYMENT_API_URL . HEIDELPAY_PHP_PAYMENT_API_FOLDER;
+define('RESPONSE_URL', EXAMPLE_BASE_FOLDER . 'SantanderHp/SantanderHpResponse.php');
+define('RESERVATION_URL', EXAMPLE_BASE_FOLDER . 'SantanderHp/SantanderHpReservation.php');
+define('RESPONSE_FILE_NAME', __DIR__ . '/SantanderHpResponseParams.txt');
+define('HEIDELPAY_SUCCESS_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpaySuccess.php');
+define('HEIDELPAY_FAILURE_PAGE', EXAMPLE_BASE_FOLDER . 'HeidelpayError.php');
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php
new file mode 100644
index 0000000..bec459a
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpReservation.php
@@ -0,0 +1,126 @@
+getRequest();
+
+/**
+ * Set up your authentification data for Heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$santanderHp->getRequest()->authentification(
+ '31HA07BC8142C5A171745D00AD63D182', // SecuritySender
+ '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin
+ '93167DE7', // UserPassword
+ '31HA07BC81302E8725994B52D85F062E', // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+
+//####### 11.1. This time we do a sync request rather than an async request as before. We do this for the sake of the ##
+//####### readability of the example. This results in the payment server sending the response to the request #
+//####### immediately in the http-response of this request rather then sending it asyncronuously to the responseUrl #
+//####### (as seen before).
+/**
+ * Set up asynchronous request parameters
+ */
+$santanderHp->getRequest()->getFrontend()->setEnabled('FALSE');
+
+/**
+ * Set up customer information required for risk checks
+ */
+$santanderHp->getRequest()->customerAddress(
+ 'Ampel', // Given name
+ 'Grün', // Family name
+ null, // Company Name
+ '12345', // Customer id of your application
+ 'Lichtweg 2', // Billing address street
+ null, // Billing address state
+ '12345', // Billing address post code
+ 'Laterne', // Billing address city
+ 'DE', // Billing address country code
+ 'g.ampel@test.de' // Customer mail address
+);
+
+/**
+ * Set up basket or transaction information. Please ensure that you do not have divergent amounts between initialize and
+ * reservation transaction
+ */
+$santanderHp->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ 203.12, // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * Set up risk information.
+ */
+$santanderHp->getRequest()->getRiskInformation()
+ ->setCustomerGuestCheckout('false')
+ ->setCustomerOrderCount('23')
+ ->setCustomerSince('2005-08-12');
+
+//####### 11.2. This time we call the method authorizeOnRegistration passing along the uniqueId of the previous #######
+//####### initialization as a reference to let the payment server know which payment plan to use. #
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$santanderHp->authorizeOnRegistration($response->getIdentification()->getUniqueId());
+$authorizationResponse = $santanderHp->getResponse();
+
+//####### 12. Now we redirect to the success or error page depending on the result of the request. #####################
+//####### Keep in mind there are three possible results: Success, Pending and Error. #
+//####### Since both pending and success indicate a successful handling by the payment server both should #
+//####### redirect to the success page. #
+$url = HEIDELPAY_SUCCESS_PAGE;
+if ($authorizationResponse->isError()) {
+ $url = HEIDELPAY_FAILURE_PAGE . '?errorMessage=' . $authorizationResponse->getError()['message'];
+}
+
+header('Location: ' . $url); // perform the redirect
+
+
+//####### 13. After placing that order / reservation transaction you have to report the shiping. ######################
+//####### to faciliate this example, this is just an example of code because you can also trigger this transaction via #
+//####### heidelpay-Hip #
+
+//$santanderHp->finalize($paymentReferenceIdOfReservationTransaction);
+?>
+
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php
new file mode 100644
index 0000000..ca75b01
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponse.php
@@ -0,0 +1,77 @@
+
+
+
+ Santander HP example
+
+
+Santander Hire Purchase example';
+if ($response->isSuccess()) {
+ echo 'Please approve your payment plan: ' . '';
+ echo 'Download the precontract information here... ';
+ echo'Place order... ';
+} else {
+ echo ''. print_r($response->getError(), 1).' ';
+}
+?>
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponseParams.txt b/vendor/heidelpay/php-payment-api/example/SantanderHp/SantanderHpResponseParams.txt
new file mode 100644
index 0000000..e69de29
diff --git a/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php b/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php
new file mode 100644
index 0000000..1359ab9
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/SantanderHpInitialize.php
@@ -0,0 +1,157 @@
+Santander Hire Purchase example';
+ echo 'File: ' . RESPONSE_FILE_NAME . ' is not writable or does not exist. Please change permissions.';
+ exit;
+}
+
+//####### 1. Create an instance of the SantandeHirePurchase payment method. ######################################################
+/**
+ * Load a new instance of the payment method
+ */
+$santanderHp = new SantanderHirePurchasePaymentMethod();
+
+//####### 2. Prepare and send an initialization request. ######################################################
+//####### The response will provide a redirectUrl to a site where the customer can select the payment plan #
+//####### Please make sure to set the riskinformation (see below) in order to increase acceptance rate. #
+
+/**
+ * Set up your authentification data for Heidepay api
+ *
+ * @link https://dev.heidelpay.com/testumgebung/#Authentifizierungsdaten
+ */
+$santanderHp->getRequest()->authentification(
+ '31HA07BC8142C5A171745D00AD63D182', // SecuritySender
+ '31ha07bc8142c5a171744e5aef11ffd3', // UserLogin
+ '93167DE7', // UserPassword
+ '31HA07BC81302E8725994B52D85F062E', // TransactionChannel credit card without 3d secure
+ true // Enable sandbox mode
+);
+
+/**
+ * Set up asynchronous request parameters
+ */
+$santanderHp->getRequest()->async(
+ 'DE', // Language code for the Frame
+ RESPONSE_URL // Response url from your application
+);
+
+/**
+ * Set up customer information required for risk checks. For a declined transaction please enable code below.
+ */
+$santanderHp->getRequest()->customerAddress(
+ 'Grün', // Given name
+ 'Ampel', // Family name
+ null, // Company Name
+ '12345', // Customer id of your application
+ 'Lichtweg 2', // Billing address street
+ null, // Billing address state
+ '12345', // Billing address post code
+ 'Laterne', // Billing address city
+ 'DE', // Billing address country code
+ 'g.ampel@test.de' // Customer mail address
+);
+//$santanderHp->getRequest()->customerAddress(
+// 'Rot', // Given name
+// 'Ampel', // Family name
+// null, // Company Name
+// '12345', // Customer id of your application
+// 'Lichtweg 2', // Billing address street
+// null, // Billing address state
+// '12345', // Billing address post code
+// 'Laterne', // Billing address city
+// 'DE', // Billing address country code
+// 'r.ampel@test.de' // Customer mail address
+//);
+
+/**
+ * Set up basket or transaction information
+ */
+$santanderHp->getRequest()->basketData(
+ '2843294932', // Reference Id of your application
+ 203.12, // Amount of this request
+ 'EUR', // Currency code of this request
+ '39542395235ßfsokkspreipsr' // A secret passphrase from your application
+);
+
+/**
+ * Set up risk information.
+ */
+$santanderHp->getRequest()->getRiskInformation()
+ ->setCustomerGuestCheckout('false')
+ ->setCustomerOrderCount('23')
+ ->setCustomerSince('2005-08-12');
+
+/**
+ * Set up Customer-specific data for Santander hire purchase (salutation and bithdate)
+ */
+$santanderHp->getRequest()->getName()->setBirthdate("1987-12-12");
+$santanderHp->getRequest()->getName()->setSalutation("MR");
+
+/**
+ * Set necessary parameters for heidelpay payment and send the request
+ */
+$santanderHp->initialize();
+
+?>
+
+
+ Santander Hire Purchase example
+
+
+Santander Hire Purchase example';
+$responseHpIn = $santanderHp->getResponse();
+
+if ($responseHpIn->isSuccess()) {
+ // Logo has to be Shown to the customer
+ echo ' ';
+ echo 'Zum Santander Ratenplan ';
+} else {
+ echo ''. print_r($responseHpIn->getError(), 1).' ';
+}
+?>
+
+
+
diff --git a/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php b/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php
new file mode 100644
index 0000000..a5fed27
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/example/_HeidelpayConstants.php
@@ -0,0 +1,10 @@
+
+
/**
* Account getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\AccountParameterGroup
+ * @return AccountParameterGroup
*/
public function getAccount()
{
@@ -164,7 +111,7 @@ public function getAccount()
/**
* Address getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\AddressParameterGroup
+ * @return AddressParameterGroup
*/
public function getAddress()
{
@@ -178,7 +125,7 @@ public function getAddress()
/**
* Basket getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\BasketParameterGroup
+ * @return BasketParameterGroup
*/
public function getBasket()
{
@@ -189,10 +136,24 @@ public function getBasket()
return $this->basket;
}
+ /**
+ * Company getter
+ *
+ * @return \Heidelpay\PhpPaymentApi\ParameterGroups\CompanyParameterGroup
+ */
+ public function getCompany()
+ {
+ if ($this->company === null) {
+ return $this->company = new CompanyParameterGroup();
+ }
+
+ return $this->company;
+ }
+
/**
* Config getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\ConfigParameterGroup
+ * @return ConfigParameterGroup
*/
public function getConfig()
{
@@ -206,7 +167,7 @@ public function getConfig()
/**
* Contact getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\ContactParameterGroup
+ * @return ContactParameterGroup
*/
public function getContact()
{
@@ -220,7 +181,7 @@ public function getContact()
/**
* Criterion getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\CriterionParameterGroup
+ * @return CriterionParameterGroup
*/
public function getCriterion()
{
@@ -234,7 +195,7 @@ public function getCriterion()
/**
* Frondend getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup
+ * @return FrontendParameterGroup
*/
public function getFrontend()
{
@@ -248,7 +209,7 @@ public function getFrontend()
/**
* Identification getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\IdentificationParameterGroup
+ * @return IdentificationParameterGroup
*/
public function getIdentification()
{
@@ -259,10 +220,20 @@ public function getIdentification()
return $this->identification;
}
+ /**
+ * company location getter
+ *
+ * @return ParameterGroups\LocationParameterGroup
+ */
+ public function getLocation()
+ {
+ return $this->getCompany()->getLocation();
+ }
+
/**
* Name getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\NameParameterGroup
+ * @return NameParameterGroup
*/
public function getName()
{
@@ -276,7 +247,7 @@ public function getName()
/**
* Payment getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\PaymentParameterGroup
+ * @return PaymentParameterGroup
*/
public function getPayment()
{
@@ -290,7 +261,7 @@ public function getPayment()
/**
* Presentation getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\PresentationParameterGroup
+ * @return PresentationParameterGroup
*/
public function getPresentation()
{
@@ -304,7 +275,7 @@ public function getPresentation()
/**
* Request getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RequestParameterGroup
+ * @return RequestParameterGroup
*/
public function getRequest()
{
@@ -318,7 +289,7 @@ public function getRequest()
/**
* RiskInformation getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup
+ * @return RiskInformationParameterGroup
*/
public function getRiskInformation()
{
@@ -332,7 +303,7 @@ public function getRiskInformation()
/**
* Security getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\SecurityParameterGroup
+ * @return SecurityParameterGroup
*/
public function getSecurity()
{
@@ -346,7 +317,7 @@ public function getSecurity()
/**
* Transaction getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\TransactionParameterGroup
+ * @return TransactionParameterGroup
*/
public function getTransaction()
{
@@ -360,7 +331,7 @@ public function getTransaction()
/**
* User getter
*
- * @return \Heidelpay\PhpPaymentApi\ParameterGroups\UserParameterGroup
+ * @return UserParameterGroup
*/
public function getUser()
{
@@ -371,6 +342,20 @@ public function getUser()
return $this->user;
}
+ /**
+ * @return CustomerParameterGroup
+ */
+ public function getCustomer()
+ {
+ if ($this->customer === null) {
+ return $this->customer = new CustomerParameterGroup();
+ }
+
+ return $this->customer;
+ }
+
+ //
+
/**
* @inheritdoc
*/
@@ -401,12 +386,42 @@ public function toArray($doSort = false)
ksort($paramValues);
}
- foreach ($paramValues as $parameterLastName => $parameterValue) {
- if ($parameterValue === null) {
- continue;
- }
+ $result[] = $this->buildSubParameterArray($parameterValues, $parameterGroup);
+ }
+ $result = array_merge(...$result);
+ return $result;
+ }
- $result[strtoupper($parameterGroup . '.' . $parameterLastName)] = $parameterValue;
+ /**
+ * Build an array for subParameterGroups like Company->location
+ *
+ * @param mixed $requestParameter Is whether a parametergroup, array or string
+ * @param $parentParameterName
+ *
+ * @return array
+ */
+ public function buildSubParameterArray($requestParameter, $parentParameterName)
+ {
+ $result = [];
+ if (!($requestParameter instanceof AbstractParameterGroup || is_array($requestParameter))) {
+ // If $requestParameter is no subGroup set the array parameter
+ if ($requestParameter !== null) {
+ $result[strtoupper($parentParameterName)] = $requestParameter;
+ return $result;
+ }
+ } else {
+ // handle subParameterGroup
+ if (is_object($requestParameter)) {
+ $requestParameter = get_object_vars($requestParameter);
+ }
+ foreach ($requestParameter as $parameterName => $parameterSubValue) {
+ $parameterName = is_numeric($parameterName)?$parameterName+1:$parameterName;
+ $tempResult = $result;
+ $result = array_merge(
+ $tempResult,
+ $this->buildSubParameterArray($parameterSubValue,
+ $parentParameterName . '.' . $parameterName)
+ );
}
}
return $result;
@@ -469,10 +484,60 @@ protected function mapFromJson($json)
$parameterGroupGetterFunc = 'get' . ucfirst($parameterGroupName);
if (!empty($parameterGroupObject) && is_callable([$this, $parameterGroupGetterFunc])) {
foreach ($parameterGroupObject as $property => $value) {
- $this->{$parameterGroupGetterFunc}()->set($property, $value);
+ if (!(is_object($value) || is_array($value))) {
+ //echo print_r($value, 1) . "\n\t";
+ $this->{$parameterGroupGetterFunc}()->set($property, $value);
+ } else {
+ $this->mapFromJsonSubGroups($this->{$parameterGroupGetterFunc}(), $property, $value);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Maps subparametergroups of JSON object
+ *
+ * @param AbstractParameterGroup $parameterGroup
+ * @param string $propertyName
+ * @param mixed $content
+ */
+ protected function mapFromJsonSubGroups($parameterGroup, $propertyName, $content)
+ {
+ $getterFunction = 'get' . ucfirst($propertyName);
+ $addFunction = 'add' . ucfirst($propertyName);
+
+ if (is_callable([$parameterGroup, $getterFunction])) {
+ $subParameterGroup = $parameterGroup->{$getterFunction}();
+ if (is_object($content)) {
+ foreach ($content as $subParameterName => $subValue) {
+ $this->mapFromJsonSubGroups($subParameterGroup, $subParameterName, $subValue);
}
+ return;
+ }
+ if (is_array($content)) {
+ foreach ($content as $index => $value) {
+ if ($index+1 > count($subParameterGroup)) {
+ $className = 'Heidelpay\PhpPaymentApi\ParameterGroups\\'.ucfirst($propertyName) . "ParameterGroup";
+ $subParameterGroup[] = new $className();
+ $parameterGroup->set($propertyName, $subParameterGroup);
+ }
+
+ if ($value == null) {
+ continue;
+ }
+
+ foreach ($value as $arrayParameter => $arrayParameterValue) {
+ if (!empty($subParameterGroup[$index])) {
+ $this->mapFromJsonSubGroups($subParameterGroup[$index], $arrayParameter, $arrayParameterValue);
+ }
+ }
+ }
+ return;
}
}
+
+ $parameterGroup->set($propertyName, $content);
}
/**
@@ -487,11 +552,64 @@ protected function mapFromPost(array $post)
}
foreach ($post as $paramGroupKey => $value) {
- @list($paramGroupName, $paramGroupProp) = explode('_', strtolower($paramGroupKey), 2);
+ $values = explode('_', strtolower($paramGroupKey), 2);
+ if (count($values) < 2) {
+ continue;
+ }
+
+ list($paramGroupName, $paramGroupProp) = $values;
$parameterGroupGetterFunc = 'get' . ucfirst($paramGroupName);
if ($paramGroupProp !== null && is_callable([$this, $parameterGroupGetterFunc])) {
- $this->{$parameterGroupGetterFunc}()->set($paramGroupProp, $value);
+ $parameterGroup = $this->{$parameterGroupGetterFunc}();
+ //If property exists in parameter group set the value.
+ if (array_key_exists($paramGroupProp, get_object_vars($parameterGroup)) || $parameterGroup instanceof CriterionParameterGroup) {
+ $parameterGroup->set($paramGroupProp, $value);
+ } else {
+ // call function to map subParameterGroups
+ $this->mapSubGroupsFromPost($parameterGroup, $paramGroupProp, $value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Map response array attributes to sub parameter classes recursively
+ *
+ * @param mixed $parameterGroup
+ * @param string $paramGroupProp
+ * @param string $value
+ */
+ protected function mapSubGroupsFromPost($parameterGroup, $paramGroupProp, $value)
+ {
+ $values = explode('_', strtolower($paramGroupProp), 2);
+
+ if (count($values) < 2) {
+ //set the parameter of the given subgroup
+ if ($parameterGroup instanceof AbstractParameterGroup && is_callable([$parameterGroup, 'get' . ucfirst($paramGroupProp)])) {
+ $parameterGroup->set($paramGroupProp, $value);
+ }
+ } else {
+ // look for subParameterGroup and call this function on it
+ list($paramGroupName, $paramGroupString) = $values;
+ $parameterGroupGetterFunc = 'get' . ucfirst($paramGroupName);
+ if ($paramGroupProp !== null && is_callable([$parameterGroup, $parameterGroupGetterFunc])) {
+ $parameterGroup = $parameterGroup->{$parameterGroupGetterFunc}();
+ if (is_array($parameterGroup)) {
+ $parameterGroup = $paramGroupName;
+ }
+ $this->mapSubGroupsFromPost($parameterGroup, $paramGroupString, $value);
+ }
+
+ //Handle executive parametergroup
+ if (is_numeric($paramGroupName) && $parameterGroup === 'executive') {
+ if ((int)$paramGroupName > count(($this->getCompany()->executive))) {
+ $executives = $this->getCompany()->getExecutive();
+ $executives[] = new ExecutiveParameterGroup();
+ $this->getCompany()->setExecutive($executives);
+ }
+ $executive = $this->getCompany()->getExecutive()[$paramGroupName-1];
+ $this->mapSubGroupsFromPost($executive, $paramGroupString, $value);
}
}
}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php b/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php
index 41e4dfa..f885c2a 100644
--- a/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/ApiConfig.php
@@ -18,7 +18,7 @@
*/
class ApiConfig
{
- const SDK_VERSION = 'v1.5.0';
+ const SDK_VERSION = 'v1.7.1';
const LIVE_URL = 'https://heidelpay.hpcgw.net/ngw/post';
const TEST_URL = 'https://test-heidelpay.hpcgw.net/ngw/post';
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php b/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php
index 2295960..f555fdb 100644
--- a/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/Brand.php
@@ -50,6 +50,7 @@ class Brand
const BILLSAFE = 'BILLSAFE';
const PAYOLUTION_DIRECT = 'PAYOLUTION_DIRECT';
const SANTANDER = 'SANTANDER';
+ const UNIVERSUM_B2B = 'UNIVERSUM_B2B';
// Online Transfer
const EPS = 'EPS';
@@ -76,4 +77,5 @@ class Brand
// Hire Purchase
const EASYCREDIT = 'EASYCREDIT';
+ const SANTANDER_HP = 'SANTANDER_HP';
}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php b/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php
new file mode 100644
index 0000000..996d562
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/CommercialSector.php
@@ -0,0 +1,61 @@
+
+ *
+ * @package heidelpay\php-payment-api\constants
+ */
+class CommercialSector
+{
+ const OTHERS_COMMERCIAL_SECTORS = 'OTHERS_COMMERCIAL_SECTORS';
+ const WHOLESALE_TRADE_EXCEPT_VEHICLE_TRADE = 'WHOLESALE_TRADE_EXCEPT_VEHICLE_TRADE';
+ const RETAIL_TRADE_EXCEPT_VEHICLE_TRADE = 'RETAIL_TRADE_EXCEPT_VEHICLE_TRADE';
+ const WATER_TRANSPORT = 'WATER_TRANSPORT';
+ const AIR_TRANSPORT = 'AIR_TRANSPORT';
+ const WAREHOUSING_AND_SUPPORT_ACTIVITIES_FOR_TRANSPORTATION = 'WAREHOUSING_AND_SUPPORT_ACTIVITIES_FOR_TRANSPORTATION';
+ const POSTAL_AND_COURIER_ACTIVITIES = 'POSTAL_AND_COURIER_ACTIVITIES';
+ const ACCOMMODATION = 'ACCOMMODATION';
+ const FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES = 'FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES';
+ const MOTION_PICTURE_PRODUCTION_AND_SIMILAR_ACTIVITIES = 'FOOD_AND_BEVERAGE_SERVICE_ACTIVITIES';
+ const TELECOMMUNICATIONS = 'TELECOMMUNICATIONS';
+ const COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES = 'COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES';
+ const INFORMATION_SERVICE_ACTIVITIES = 'INFORMATION_SERVICE_ACTIVITIES';
+ const RENTAL_AND_LEASING_ACTIVITIES = 'RENTAL_AND_LEASING_ACTIVITIES';
+ const TRAVEL_AGENCY_AND_RELATED_ACTIVITIES = 'TRAVEL_AGENCY_AND_RELATED_ACTIVITIES';
+ const SERVICES_TO_BUILDINGS_AND_LANDSCAPE_ACTIVITIES = 'SERVICES_TO_BUILDINGS_AND_LANDSCAPE_ACTIVITIES';
+ const LIBRARIES_AND_SIMILAR_CULTURAL_ACTIVITIES = 'LIBRARIES_AND_SIMILAR_CULTURAL_ACTIVITIES';
+ const SPORTS_ACTIVITIES_AND_AMUSEMENT_AND_RECREATION_ACTIVITIES = 'SPORTS_ACTIVITIES_AND_AMUSEMENT_AND_RECREATION_ACTIVITIES';
+ const OTHER_PERSONAL_SERVICE_ACTIVITIES = 'OTHER_PERSONAL_SERVICE_ACTIVITIES';
+ const NON_RESIDENTIAL_REAL_ESTATE_ACTIVITIES = 'NON_RESIDENTIAL_REAL_ESTATE_ACTIVITIES';
+ const MANAGEMENT_CONSULTANCY_ACTIVITIES = 'MANAGEMENT_CONSULTANCY_ACTIVITIES';
+ const ELECTRICITY_GAS_AND_STEAM_SUPPLY = 'ELECTRICITY_GAS_AND_STEAM_SUPPLY';
+ const WATER_COLLECTION_TREATMENT_AND_SUPPLY = 'WATER_COLLECTION_TREATMENT_AND_SUPPLY';
+ const SEWERAGE = 'SEWERAGE';
+
+ const MANUFACTURE_OF_FOOD_PRODUCTS = 'MANUFACTURE_OF_FOOD_PRODUCTS';
+ const MANUFACTURE_OF_BEVERAGES = 'MANUFACTURE_OF_BEVERAGES';
+ const MANUFACTURE_OF_TEXTILES = 'MANUFACTURE_OF_TEXTILES';
+ const MANUFACTURE_OF_WEARING_APPAREL = 'MANUFACTURE_OF_WEARING_APPAREL';
+ const MANUFACTURE_OF_LEATHER_AND_RELATED_PRODUCTS = 'MANUFACTURE_OF_LEATHER_AND_RELATED_PRODUCTS';
+ const MANUFACTURE_OF_PHARMACEUTICAL_PRODUCTS = 'MANUFACTURE_OF_PHARMACEUTICAL_PRODUCTS';
+
+ const REPAIR_AND_INSTALLATION_OF_MACHINERY_AND_EQUIPMENT = 'REPAIR_AND_INSTALLATION_OF_MACHINERY_AND_EQUIPMENT';
+ const TRADE_AND_REPAIR_OF_MOTOR_VEHICLES = 'TRADE_AND_REPAIR_OF_MOTOR_VEHICLES';
+ const PUBLISHING_ACTIVITIES = 'PUBLISHING_ACTIVITIES';
+ const REPAIR_OF_COMPUTERS_AND_GOODS = 'REPAIR_OF_COMPUTERS_AND_GOODS';
+ const PRINTING_AND_REPRODUCTION_OF_RECORDED_MEDIA = 'PRINTING_AND_REPRODUCTION_OF_RECORDED_MEDIA';
+ const MANUFACTURE_OF_FURNITURE = 'MANUFACTURE_OF_FURNITURE';
+ const OTHER_MANUFACTURING = 'OTHER_MANUFACTURING';
+ const ADVERTISING_AND_MARKET_RESEARCH = 'ADVERTISING_AND_MARKET_RESEARCH';
+ const OTHER_PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_ACTIVITIES = 'OTHER_PROFESSIONAL_SCIENTIFIC_AND_TECHNICAL_ACTIVITIES';
+ const ARTS_ENTERTAINMENT_AND_RECREATION = 'ARTS_ENTERTAINMENT_AND_RECREATION';
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php b/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php
new file mode 100644
index 0000000..72d2027
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/ExecutiveFunction.php
@@ -0,0 +1,25 @@
+
+ *
+ * @package heidelpay\php-payment-api\constants
+ */
+class ExecutiveFunction
+{
+ const OWNER = 'OWNER';
+ const PARTNER = 'PARTNER';
+ const SHAREHOLDER = 'SHAREHOLDER';
+ const DIRECTOR = 'DIRECTOR';
+ const MANAGER = 'MANAGER';
+ const REGISTERED_MANAGER = 'REGISTERED_MANAGER';
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php b/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php
new file mode 100644
index 0000000..a12671c
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/FrontendMode.php
@@ -0,0 +1,20 @@
+
+ *
+ * @package heidelpay\php-payment-api\constants
+ */
+class FrontendMode
+{
+ const FRONTEND_MODE_WHITELABEL = 'WHITELABEL';
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php b/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php
new file mode 100644
index 0000000..564a6eb
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/RegistrationType.php
@@ -0,0 +1,21 @@
+
+ *
+ * @package heidelpay\php-payment-api\constants
+ */
+class RegistrationType
+{
+ const REGISTERED = 'REGISTERED';
+ const NOT_REGISTERED = 'NOT_REGISTERED';
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php b/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php
new file mode 100644
index 0000000..e1e51f0
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/ReversalType.php
@@ -0,0 +1,22 @@
+
+ *
+ * @package heidelpay\php-payment-api\constants
+ */
+class ReversalType
+{
+ const RT_CANCEL = 'CANCEL';
+ const RT_RETURN = 'RETURN';
+ const RT_CREDIT = 'CREDIT';
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php b/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php
index 805c998..6f6a34c 100644
--- a/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php
+++ b/vendor/heidelpay/php-payment-api/lib/Constants/TransactionMode.php
@@ -10,11 +10,9 @@
*
* @link http://dev.heidelpay.com/php-payment-api
*
- * @author Stephano Vogel
+ * @author David Owusu
*
* @package heidelpay\php-payment-api\constants
- *
- * @since 1.3.0 First time this was introduced.
*/
class TransactionMode
{
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php
new file mode 100644
index 0000000..c6e9432
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CompanyParameterGroup.php
@@ -0,0 +1,283 @@
+setFunction(!empty($function) && is_string($function) ?$function: ExecutiveFunction::OWNER);
+ $newExecutive->setSalutation($salutation);
+ $newExecutive->setGiven($given);
+ $newExecutive->setFamily($family);
+ $newExecutive->setBirthdate($birthdate);
+ $newExecutive->setEmail($email);
+ $newExecutive->setPhone($phone);
+
+ $home = $newExecutive->getHome();
+
+ $home->street = $homeStreet;
+ $home->city = $homeCity;
+ $home->country =$homeCountry;
+ $home->zip = $homeZip;
+
+ $executives = $this->getExecutive();
+ $executives[] = $newExecutive;
+ $this->setExecutive($executives);
+
+ return $this;
+ }
+
+ /**
+ * Company executive getter
+ *
+ * @return array
+ *
+ * @param null|mixed $index
+ */
+ public function getExecutive($index = null)
+ {
+ if ($this->executive === null) {
+ return $this->executive = [];
+ }
+
+ if ($index !== null) {
+ if (!is_bool($index) && isset($this->executive[$index])) {
+ return $this->executive[$index];
+ } else {
+ return null;
+ }
+ }
+
+ return $this->executive;
+ }
+
+ /**
+ * Setter for company executive
+ *
+ * @param array $executive
+ */
+ public function setExecutive($executive)
+ {
+ $this->executive = $executive;
+ return $this;
+ }
+
+ /**
+ * Company location getter
+ *
+ * @return LocationParameterGroup
+ */
+ public function getLocation()
+ {
+ if ($this->location === null) {
+ return $this->location = new LocationParameterGroup();
+ }
+ return $this->location;
+ }
+
+ /**
+ * Setter for company location
+ *
+ * @param LocationParameterGroup $location
+ */
+ public function setLocation($location)
+ {
+ $this->location = $location;
+ return $this;
+ }
+
+ /**
+ * Companyname getter
+ *
+ * @return string | null
+ */
+ public function getCompanyname()
+ {
+ return $this->companyname;
+ }
+
+ /**
+ * Setter for companyname
+ *
+ * @param string $companyname
+ */
+ public function setCompanyname($companyname)
+ {
+ $this->companyname = $companyname;
+ return $this;
+ }
+
+ /**
+ * Company registrationtype getter
+ *
+ * @return string | null
+ */
+ public function getRegistrationtype()
+ {
+ return $this->registrationtype;
+ }
+
+ /**
+ * Setter for company registrationtype
+ *
+ * @param string $registrationtype
+ */
+ public function setRegistrationtype($registrationtype)
+ {
+ $this->registrationtype = $registrationtype;
+ return $this;
+ }
+
+ /**
+ * Commercialregistrnumber getter
+ *
+ * @return string | null
+ */
+ public function getCommercialregisternumber()
+ {
+ return $this->commercialregisternumber;
+ }
+
+ /**
+ * Setter for commercialregistrnumber
+ *
+ * @param string $commercialregisternumber
+ */
+ public function setCommercialregisternumber($commercialregisternumber)
+ {
+ $this->commercialregisternumber = $commercialregisternumber;
+ return $this;
+ }
+
+ /**
+ * Company vatid getter
+ *
+ * @return string | null
+ */
+ public function getVatid()
+ {
+ return $this->vatid;
+ }
+
+ /**
+ * Setter for vatid
+ *
+ * @param string $vatid
+ */
+ public function setVatid($vatid)
+ {
+ $this->vatid = $vatid;
+ return $this;
+ }
+
+ /**
+ * Commercialsector getter
+ *
+ * @return string | null
+ */
+ public function getCommercialSector()
+ {
+ return $this->commercialsector;
+ }
+
+ /**
+ * Setter commerialSector
+ *
+ * @param string $commercialSector
+ */
+ public function setCommercialSector($commercialSector)
+ {
+ $this->commercialsector = $commercialSector;
+ return $this;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php
index 585487f..713db09 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ConfigParameterGroup.php
@@ -52,7 +52,7 @@ public function getBankCountry()
/**
* Config brands getter
*
- * @return string
+ * @return array
*/
public function getBrands()
{
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php
new file mode 100644
index 0000000..03ab230
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/CustomerParameterGroup.php
@@ -0,0 +1,44 @@
+
+
+ /**
+ * @return bool
+ */
+ public function isOptIn2()
+ {
+ return $this->optIn_2 === 'TRUE';
+ }
+
+ /**
+ * @param bool $optIn_2
+ *
+ * @return CustomerParameterGroup
+ */
+ public function setOptIn2($optIn_2)
+ {
+ $this->optIn_2 = $optIn_2 ? 'TRUE' : 'FALSE';
+ return $this;
+ }
+
+ //
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php
new file mode 100644
index 0000000..74b8e5f
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/ExecutiveParameterGroup.php
@@ -0,0 +1,246 @@
+function;
+ }
+
+ /**
+ * Setter for executive function
+ *
+ * @param mixed $function
+ */
+ public function setFunction($function)
+ {
+ $this->function = $function;
+ return $this;
+ }
+
+ /**
+ * Executive salutation getter
+ *
+ * @return string | null
+ */
+ public function getSalutation()
+ {
+ return $this->salutation;
+ }
+
+ /**
+ * Setter for executive salutation
+ *
+ * @param mixed $salutation
+ */
+ public function setSalutation($salutation)
+ {
+ $this->salutation = $salutation;
+ return $this;
+ }
+
+ /**
+ * Executive name given getter
+ *
+ * @return string | null
+ */
+ public function getGiven()
+ {
+ return $this->given;
+ }
+
+ /**
+ * Setter for executive name given
+ *
+ * @param mixed $given
+ */
+ public function setGiven($given)
+ {
+ $this->given = $given;
+ return $this;
+ }
+
+ /**
+ * Executive family name getter
+ *
+ * @return string | null
+ */
+ public function getFamily()
+ {
+ return $this->family;
+ }
+
+ /**
+ * Setter for executive family name
+ *
+ * @param mixed $family
+ */
+ public function setFamily($family)
+ {
+ $this->family = $family;
+ return $this;
+ }
+
+ /**
+ * Executive birthdate getter
+ *
+ * @return string | null
+ */
+ public function getBirthdate()
+ {
+ return $this->birthdate;
+ }
+
+ /**
+ * Setter for executive birthdate
+ *
+ * @param string $birthdate format:YYYY-MMM-DD
+ */
+ public function setBirthdate($birthdate)
+ {
+ $this->birthdate = $birthdate;
+ return $this;
+ }
+
+ /**
+ * Executive email getter
+ *
+ * @return string | null
+ */
+ public function getEmail()
+ {
+ return $this->email;
+ }
+
+ /**
+ * Setter for executive email
+ *
+ * @param string $email
+ */
+ public function setEmail($email)
+ {
+ $this->email = $email;
+ return $this;
+ }
+
+ /**
+ * Executive phone number getter
+ *
+ * @return string | null
+ */
+ public function getPhone()
+ {
+ return $this->phone;
+ }
+
+ /**
+ * Setter for executive phone number
+ *
+ * @param mixed $phone
+ */
+ public function setPhone($phone)
+ {
+ $this->phone = $phone;
+ return $this;
+ }
+
+ /**
+ * Executive home getter
+ *
+ * @return HomeParameterGroup
+ */
+ public function getHome()
+ {
+ if ($this->home === null) {
+ return $this->home = new HomeParameterGroup();
+ }
+ return $this->home;
+ }
+
+ /**
+ * Setter for executive home
+ *
+ * @param HomeParameterGroup $home
+ */
+ public function setHome($home)
+ {
+ $this->home = $home;
+ return $this;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php
index b0ad65c..7ed8e43 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/FrontendParameterGroup.php
@@ -2,6 +2,8 @@
namespace Heidelpay\PhpPaymentApi\ParameterGroups;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
+
/**
* This class provides every api parameter used for frontend settings like language etc.
*
@@ -42,7 +44,7 @@ class FrontendParameterGroup extends AbstractParameterGroup
*
* @var string always set to withelabel on ngw (mandatory)
*/
- public $mode = 'WHITELABEL';
+ public $mode = FrontendMode::FRONTEND_MODE_WHITELABEL;
/**
* FrontendPaymentFrameOrigin
@@ -230,10 +232,11 @@ public function setLanguage($language)
* @param string $mode
*
* @return \Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup
+ *
+ * @deprecated Change of the mode propertie is prohibited since ngw-api needs WHITELABLE mode.
*/
public function setMode($mode)
{
- $this->mode = $mode;
return $this;
}
@@ -301,4 +304,22 @@ public function setRedirectUrl($redirect_url)
$this->redirect_url = $redirect_url;
return $this;
}
+
+ /**
+ * Override magic setter to prohibit change of specific properties.
+ *
+ * @param string $key
+ * @param string $value
+ *
+ * @return $this|AbstractParameterGroup
+ */
+ public function set($key, $value)
+ {
+ $unchangeableProperties = ['mode'];
+ if (in_array(strtolower($key), $unchangeableProperties)) {
+ return $this;
+ }
+
+ return parent::set($key, $value);
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php
new file mode 100644
index 0000000..b036b0d
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/HomeParameterGroup.php
@@ -0,0 +1,142 @@
+street = $street;
+ $this->zip = $zip;
+ $this->city = $city;
+ $this->country = $country;
+ }
+
+ /**
+ * Executive home street getter
+ *
+ * @return string | null
+ */
+ public function getStreet()
+ {
+ return $this->street;
+ }
+
+ /**
+ * Setter for executive home street
+ *
+ * @param string $street
+ */
+ public function setStreet($street)
+ {
+ $this->street = $street;
+ return $this;
+ }
+
+ /**
+ * Executive home zip getter
+ *
+ * @return string | null
+ */
+ public function getZip()
+ {
+ return $this->zip;
+ }
+
+ /**
+ * Setter for executive home zip
+ *
+ * @param string $zip
+ */
+ public function setZip($zip)
+ {
+ $this->zip = $zip;
+ return $this;
+ }
+
+ /**
+ * Executive home city getter
+ *
+ * @return string | null
+ */
+ public function getCity()
+ {
+ return $this->city;
+ }
+
+ /**
+ * Setter for executive home city
+ *
+ * @param string $city
+ */
+ public function setCity($city)
+ {
+ $this->city = $city;
+ return $this;
+ }
+
+ /**
+ * Executive home country getter
+ *
+ * @return string | null
+ */
+ public function getCountry()
+ {
+ return $this->country;
+ }
+
+ /**
+ * Setter for executive home country
+ *
+ * @param string $country
+ */
+ public function setCountry($country)
+ {
+ $this->country = $country;
+ return $this;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php
index 35da4e8..749e1b9 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/IdentificationParameterGroup.php
@@ -23,6 +23,11 @@ class IdentificationParameterGroup extends AbstractParameterGroup
*/
public $creditor_id;
+ /**
+ * @var string $invoiceid
+ */
+ public $invoiceid;
+
/**
* IdentificationShopperId
*
@@ -180,4 +185,21 @@ public function setReferenceid($referenceid)
$this->referenceid = $referenceid;
return $this;
}
+
+ /**
+ * @return string
+ */
+ public function getInvoiceid()
+ {
+ return $this->invoiceid;
+ }
+
+ /**
+ * @param string $invoiceid
+ */
+ public function setInvoiceid($invoiceid)
+ {
+ $this->invoiceid = $invoiceid;
+ return $this;
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php
new file mode 100644
index 0000000..45bd750
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/LocationParameterGroup.php
@@ -0,0 +1,168 @@
+pobox;
+ }
+
+ /**
+ * Setter for company location pobox
+ *
+ * @param $pobox
+ *
+ * @return $this
+ */
+ public function setPobox($pobox)
+ {
+ $this->pobox = $pobox;
+ return $this;
+ }
+
+ /**
+ * Company location street getter
+ *
+ * @return string
+ */
+ public function getStreet()
+ {
+ return $this->street;
+ }
+
+ /**
+ * Setter for company location street
+ *
+ * @param $street
+ *
+ * @return $this
+ */
+ public function setStreet($street)
+ {
+ $this->street = $street;
+ return $this;
+ }
+
+ /**
+ * Company location zip getter
+ *
+ * @return string
+ */
+ public function getZip()
+ {
+ return $this->zip;
+ }
+
+ /**
+ * Setter for company location pobox
+ *
+ * @param $zip
+ *
+ * @return $this
+ */
+ public function setZip($zip)
+ {
+ $this->zip = $zip;
+ return $this;
+ }
+
+ /**
+ * Company location city getter
+ *
+ * @return string
+ */
+ public function getCity()
+ {
+ return $this->city;
+ }
+
+ /**
+ * Setter for company location city
+ *
+ * @param $city
+ *
+ * @return $this
+ */
+ public function setCity($city)
+ {
+ $this->city = $city;
+ return $this;
+ }
+
+ /**
+ * Company location country getter
+ *
+ * @return string
+ */
+ public function getCountry()
+ {
+ return $this->country;
+ }
+
+ /**
+ * Setter for company location country
+ *
+ * @param $country
+ *
+ * @return $this
+ */
+ public function setCountry($country)
+ {
+ $this->country = $country;
+ return $this;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php
index 40449f7..39ec1e9 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/PaymentParameterGroup.php
@@ -33,6 +33,11 @@ class PaymentParameterGroup extends AbstractParameterGroup
*/
public $code;
+ /**
+ * @var string $reversaltype available options are "CANCEL, RETURN or CREDIT"
+ */
+ public $reversaltype;
+
/**
* PamyentCode getter
*
@@ -55,4 +60,21 @@ public function setCode($code)
$this->code = $code;
return $this;
}
+
+ /**
+ * @return string
+ */
+ public function getReversaltype()
+ {
+ return $this->reversaltype;
+ }
+
+ /**
+ * @param string|null $reversaltype
+ */
+ public function setReversaltype($reversaltype)
+ {
+ $this->reversaltype = $reversaltype;
+ return $this;
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php
index 6fa3328..1b77c78 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/RiskInformationParameterGroup.php
@@ -19,26 +19,26 @@ class RiskInformationParameterGroup extends AbstractParameterGroup
/**
* @var bool if guest checkout (true/false) (optional)
*/
- public $guestcheckout;
+ public $customerGuestCheckout;
/**
* @var string first date of customers relationship (YYYY-MM-DD) (optional)
*/
- public $since;
+ public $customerSince;
/**
* @var integer of customer's order count (optional)
*/
- public $ordercount;
+ public $customerOrderCount;
/**
* Guestcheckout getter
*
* @return bool state
*/
- public function getGuestcheckout()
+ public function getCustomerGuestCheckout()
{
- return $this->guestcheckout;
+ return $this->customerGuestCheckout;
}
/**
@@ -46,9 +46,9 @@ public function getGuestcheckout()
*
* @return string since
*/
- public function getSince()
+ public function getCustomerSince()
{
- return $this->since;
+ return $this->customerSince;
}
/**
@@ -56,47 +56,47 @@ public function getSince()
*
* @return int ordercount
*/
- public function getOrdercount()
+ public function getCustomerOrderCount()
{
- return $this->ordercount;
+ return $this->customerOrderCount;
}
/**
- * setter for is quest checkout
+ * setter for is guest checkout
*
- * @param string $guestcheckout
+ * @param string $customerGuestCheckout
*
* @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup
*/
- public function setGuestCheckout($guestcheckout)
+ public function setCustomerGuestCheckout($customerGuestCheckout)
{
- $this->guestcheckout = $guestcheckout;
+ $this->customerGuestCheckout = $customerGuestCheckout;
return $this;
}
/**
* setter for customer since
*
- * @param string $since
+ * @param string $customerSince
*
* @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup
*/
- public function setSince($since)
+ public function setCustomerSince($customerSince)
{
- $this->since = $since;
+ $this->customerSince = $customerSince;
return $this;
}
/**
* setter for order count
*
- * @param int $ordercount
+ * @param int $customerOrderCount
*
* @return \Heidelpay\PhpPaymentApi\ParameterGroups\RiskInformationParameterGroup
*/
- public function setOrderCount($ordercount)
+ public function setCustomerOrderCount($customerOrderCount)
{
- $this->ordercount = $ordercount;
+ $this->customerOrderCount = $customerOrderCount;
return $this;
}
}
diff --git a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php
index 8382ae0..3745d58 100644
--- a/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php
+++ b/vendor/heidelpay/php-payment-api/lib/ParameterGroups/UserParameterGroup.php
@@ -27,7 +27,7 @@ class UserParameterGroup extends AbstractParameterGroup
/**
* UserPwd
*
- * The Passwort of the payment account
+ * The password of the payment account
*
* @var string pwd (mandatory)
*/
diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php
index c82c470..a3bcb0d 100644
--- a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php
+++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/CreditCardPaymentMethod.php
@@ -30,16 +30,16 @@ class CreditCardPaymentMethod implements PaymentMethodInterface
{
use BasicPaymentMethodTrait;
use RegistrationTransactionType {
- registration as registrationParent;
+ registration as protected registrationParent;
}
use ReregistrationTransactionType {
- reregistration as reregistrationParent;
+ reregistration as protected reregistrationParent;
}
use AuthorizeTransactionType {
- authorize as authorizeParent;
+ authorize as protected authorizeParent;
}
use DebitTransactionType {
- debit as debitParent;
+ debit as protected debitParent;
}
use AuthorizeOnRegistrationTransactionType;
use DebitOnRegistrationTransactionType;
diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php
index aec0986..3ac10db 100644
--- a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php
+++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/DebitCardPaymentMethod.php
@@ -30,16 +30,16 @@ class DebitCardPaymentMethod implements PaymentMethodInterface
{
use BasicPaymentMethodTrait;
use RegistrationTransactionType {
- registration as registrationParent;
+ registration as protected registrationParent;
}
use ReregistrationTransactionType {
- reregistration as reregistrationParent;
+ reregistration as protected reregistrationParent;
}
use AuthorizeTransactionType {
- authorize as authorizeParent;
+ authorize as protected authorizeParent;
}
use DebitTransactionType {
- debit as debitParent;
+ debit as protected debitParent;
}
use AuthorizeOnRegistrationTransactionType;
use DebitOnRegistrationTransactionType;
diff --git a/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php
new file mode 100644
index 0000000..c3889b8
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/PaymentMethods/InvoiceB2BSecuredPaymentMethod.php
@@ -0,0 +1,41 @@
+ Account::class,
AddressParameterGroup::class => Address::class,
+ CompanyParameterGroup::class => Company::class,
ConnectorParameterGroup::class => Connector::class,
ContactParameterGroup::class => Contact::class,
FrontendParameterGroup::class => Frontend::class,
IdentificationParameterGroup::class => Identification::class,
+ LocationParameterGroup::class => Location::class,
NameParameterGroup::class => Name::class,
PaymentParameterGroup::class => Payment::class,
PresentationParameterGroup::class => Presentation::class,
@@ -157,6 +166,25 @@ private function parseXmlResponse()
}
}
+ // set Executives
+ if (isset($xml->Transaction, $xml->Transaction->Customer->Company->Executive)) {
+ $xmlExecutive = $xml->Transaction->Customer->Company->Executive;
+ $executivesCount = $xmlExecutive->count();
+
+ $executiveMapper = new Executive();
+ $homeMapper = new Home();
+
+ for ($index = 0; $index < $executivesCount; $index++) {
+ if (!isset($this->response->getCompany()->getExecutive()[$index])) {
+ $executive = $this->response->getCompany()->getExecutive();
+ $executive[] = new ExecutiveParameterGroup();
+ $this->response->getCompany()->setExecutive($executive);
+ }
+ $this->setParameterGroupProperties($this->response->getCompany()->getExecutive()[$index], $executiveMapper, $xmlExecutive[$index]);
+ $this->setParameterGroupProperties($this->response->getCompany()->getExecutive()[$index]->getHome(), $homeMapper, $xmlExecutive[$index]);
+ }
+ }
+
// set the criterion data
if (isset($xml->Transaction, $xml->Transaction->Analysis->Criterion)) {
foreach ($xml->Transaction->Analysis->Criterion as $criterion) {
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php
new file mode 100644
index 0000000..f1e1b1e
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Company.php
@@ -0,0 +1,41 @@
+ 'companyname',
+ 'RegistrationType' => 'registrationtype',
+ 'CommercialRegisterNumber' => 'commercialregisternumber',
+ 'VatID' => 'vatid',
+ 'CommercialSector' => 'commercialsector',
+ ];
+
+ /**
+ * @inheritdoc
+ */
+ public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field)
+ {
+ if (isset($xmlElement->Transaction, $xmlElement->Transaction->Customer->Company->$field)) {
+ return (string)$xmlElement->Transaction->Customer->Company->$field;
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php
new file mode 100644
index 0000000..fb0c0c1
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Executive.php
@@ -0,0 +1,42 @@
+ 'given',
+ 'Family' => 'family',
+ 'Birthdate' => 'birthdate',
+ 'Phone' => 'phone',
+ 'Email' => 'email',
+ 'Function' => 'function',
+ ];
+
+ /**
+ * @inheritdoc
+ */
+ public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field)
+ {
+ if (isset($xmlElement->$field)) {
+ return (string)$xmlElement->$field;
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php
new file mode 100644
index 0000000..0df962b
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Home.php
@@ -0,0 +1,40 @@
+ 'city',
+ 'Country' => 'country',
+ 'Street' => 'street',
+ 'Zip' => 'zip',
+ ];
+
+ /**
+ * @inheritdoc
+ */
+ public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field)
+ {
+ if (isset($xmlElement->Home, $xmlElement->Home->$field)) {
+ return (string) $xmlElement->Home->$field;
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php
index cc0fe91..4a4b1c2 100644
--- a/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Identification.php
@@ -21,6 +21,7 @@ class Identification extends AbstractPushMapper
*/
public $fields = [
'CreditorID' => 'creditor_id',
+ 'InvoiceID' => 'invoiceid',
'ReferenceID' => 'referenceid',
'ShopperID' => 'shopperid',
'ShortID' => 'shortid',
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php
new file mode 100644
index 0000000..ab54cd6
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Location.php
@@ -0,0 +1,41 @@
+ 'city',
+ 'RegistrationType' => 'registrationtype',
+ 'Country' => 'country',
+ 'Street' => 'street',
+ 'Zip' => 'zip',
+ ];
+
+ /**
+ * @inheritdoc
+ */
+ public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field)
+ {
+ if (isset($xmlElement->Transaction, $xmlElement->Transaction->Customer->Company->Location->$field)) {
+ return (string) $xmlElement->Transaction->Customer->Company->Location->$field;
+ }
+
+ return null;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php b/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php
index f60ac30..2917d95 100644
--- a/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php
+++ b/vendor/heidelpay/php-payment-api/lib/PushMapping/Payment.php
@@ -16,6 +16,10 @@
*/
class Payment extends AbstractPushMapper
{
+ public $fields = [
+ 'ReversalType' => 'reversaltype'
+ ];
+
/**
* @inheritdoc
*/
@@ -34,4 +38,20 @@ public function getXmlObjectProperty(\SimpleXMLElement $xmlElement, $property)
return null;
}
+
+ /**
+ * Only map fields that are listed here.
+ *
+ * @inheritdoc
+ */
+ public function getXmlObjectField(\SimpleXMLElement $xmlElement, $field)
+ {
+ if (isset($xmlElement->Transaction->Payment, $field)) {
+ $xmlField = $xmlElement->Transaction->Payment->$field;
+ if (array_key_exists($xmlField->getName(), $this->fields)) {
+ return (string)$xmlField;
+ }
+ }
+ return null;
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/lib/Request.php b/vendor/heidelpay/php-payment-api/lib/Request.php
index 1242429..c425f0f 100644
--- a/vendor/heidelpay/php-payment-api/lib/Request.php
+++ b/vendor/heidelpay/php-payment-api/lib/Request.php
@@ -84,19 +84,63 @@ public function async($languageCode = 'EN', $responseUrl = null)
return $this;
}
+ /**
+ * Set all necessary parameter for company.
+ *
+ * The executive array can be created beforehand or kept empty and be added later
+ *
+ * @param string $companyName
+ * @param string $poBox
+ * @param string $street
+ * @param string $zip
+ * @param string $city
+ * @param string $country
+ * @param string $CommercialSector
+ * @param string $registrationType
+ * @param string $commercialRegisterNumber
+ * @param string $vatId
+ * @param array $executives
+ */
+ public function company(
+ $companyName = null,
+ $poBox = null,
+ $street = null,
+ $zip = null,
+ $city = null,
+ $country = null,
+ $CommercialSector = null,
+ $registrationType = null,
+ $commercialRegisterNumber = null,
+ $vatId = null,
+ $executives = null
+ ) {
+ $this->getCompany()->setCompanyname($companyName)
+ ->setRegistrationtype($registrationType)
+ ->setCommercialregisternumber($commercialRegisterNumber)
+ ->setVatid($vatId)
+ ->setCommercialSector($CommercialSector)
+ ->setExecutive($executives)
+ ->getLocation()
+ ->setPobox($poBox)
+ ->setStreet($street)
+ ->setZip($zip)
+ ->setCity($city)
+ ->setCountry($country);
+ }
+
/**
* Set all necessary customer parameter for a request
*
* @param string $nameGiven customer given name, e.g. John
* @param string $nameFamily customer family name, e.g. Doe
- * @param string $nameCompany company name, e.g. Heidelpay
+ * @param string $nameCompany company name, e.g. heidelpay
* @param string $shopperId customer id in your application, e.g. 1249
* @param string $addressStreet address street of the customer, e.g. Vagerowstr.
* @param string $addressState address state ot the customer, e.g. Bayern
* @param string $addressZip address zip code, e.g. 69115
* @param string $addressCity address city, e.g. Heidelberg
* @param string $addressCountry address country code 2 letters, e.g. DE
- * @param string $contactMail email adress of the customer, e.g. ab@mail.de
+ * @param string $contactMail email address of the customer, e.g. ab@mail.de
*
* @return \Heidelpay\PhpPaymentApi\Request
*/
@@ -126,6 +170,19 @@ public function customerAddress(
return $this;
}
+ /**
+ * @param string $shopperId
+ * @param string $invoiceId
+ * @param string $reversaltype string $reversaltype "CANCLE, RETURN or CREDIT"
+ */
+ public function factoring($invoiceId, $shopperId = null)
+ {
+ $this->getIdentification()->setInvoiceid($invoiceId);
+ if ($shopperId !== null) {
+ $this->getIdentification()->setShopperid($shopperId);
+ }
+ }
+
/**
* Set all basket or order information
*
diff --git a/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php b/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php
index 879f666..a173cf1 100644
--- a/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php
+++ b/vendor/heidelpay/php-payment-api/lib/TransactionTypes/ReversalTransactionType.php
@@ -29,15 +29,17 @@ trait ReversalTransactionType
* it back to the given account. This can be used to lower an amount on an
* invoice for example.
*
- * @param mixed $paymentReferenceId payment reference id (unique id of the authorisation)
+ * @param mixed $paymentReferenceId payment reference id (unique id of the authorisation)
+ * @param null|mixed $reversalType
*
* @return $this
*
* @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException
*/
- public function reversal($paymentReferenceId)
+ public function reversal($paymentReferenceId, $reversalType = null)
{
$this->getRequest()->getPayment()->setCode($this->getPaymentCode() . '.' . TransactionType::REVERSAL);
+ $this->getRequest()->getPayment()->setReversaltype($reversalType);
$this->getRequest()->getFrontend()->setEnabled('FALSE');
$this->getRequest()->getIdentification()->setReferenceId($paymentReferenceId);
$this->prepareRequest();
diff --git a/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php b/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php
index ced1006..ff24182 100644
--- a/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php
+++ b/vendor/heidelpay/php-payment-api/tests/Helper/Authentication.php
@@ -1,10 +1,5 @@
companyName,
+ $this->poBox,
+ $this->street,
+ $this->zip,
+ $this->city,
+ $this->country,
+ $this->commercialSector,
+ $this->registrationType,
+ $this->commercialRegisterNumber,
+ $this->vatId,
+ $this->executive
+ ];
+ }
+
+ /**
+ * @param null $companyName
+ */
+ public function setCompanyName($companyName)
+ {
+ $this->companyName = $companyName;
+ return $this;
+ }
+
+ /**
+ * @param null $poBox
+ */
+ public function setPoBox($poBox)
+ {
+ $this->poBox = $poBox;
+ return $this;
+ }
+
+ /**
+ * @param null $street
+ */
+ public function setStreet($street)
+ {
+ $this->street = $street;
+ return $this;
+ }
+
+ /**
+ * @param null $zip
+ */
+ public function setZip($zip)
+ {
+ $this->zip = $zip;
+ return $this;
+ }
+
+ /**
+ * @param null $city
+ */
+ public function setCity($city)
+ {
+ $this->city = $city;
+ return $this;
+ }
+
+ /**
+ * @param null $country
+ */
+ public function setCountry($country)
+ {
+ $this->country = $country;
+ return $this;
+ }
+
+ /**
+ * @param null $commercialSector
+ */
+ public function setCommercialSector($commercialSector)
+ {
+ $this->commercialSector = $commercialSector;
+ return $this;
+ }
+
+ /**
+ * @param null $registrationType
+ */
+ public function setRegistrationType($registrationType)
+ {
+ $this->registrationType = $registrationType;
+ return $this;
+ }
+
+ /**
+ * @param null $commercialRegisterNumber
+ */
+ public function setCommercialRegisterNumber($commercialRegisterNumber)
+ {
+ $this->commercialRegisterNumber = $commercialRegisterNumber;
+ return $this;
+ }
+
+ /**
+ * @param null $vatId
+ */
+ public function setVatId($vatId)
+ {
+ $this->vatId = $vatId;
+ return $this;
+ }
+
+ /**
+ * @param array $executive
+ */
+ public function setExecutive($executive)
+ {
+ $this->executive = $executive;
+ return $this;
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php b/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php
index c69001b..7c6eed6 100644
--- a/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php
+++ b/vendor/heidelpay/php-payment-api/tests/Helper/Constraints/ArraysMatchConstraint.php
@@ -1,10 +1,5 @@
executiveOneArray = [
+ null,
+ 'Testkäufer',
+ 'Händler',
+ '1988-12-12',
+ 'example@email.de',
+ '062216471400',
+ 'Vangerowstr. 18',
+ '69115',
+ 'Heidelberg',
+ 'DE',
+ 'OWNER',
+ ];
+
+ $this->executiveTwoArray = [
+ '',
+ '',
+ '',
+ '123',
+ '',
+ '',
+ 'null',
+ 'null',
+ 'null',
+ 'null',
+ 'OWNER',
+ ];
+ }
+
+ protected $executiveOneArray;
+
+ /**
+ * @return array
+ */
+ public function getExecutiveOneArray()
+ {
+ return $this->executiveOneArray;
+ }
+
+ /**
+ * @return array
+ */
+ public function getExecutiveTwoArray()
+ {
+ return $this->executiveTwoArray;
+ }
+
+ protected $executiveTwoArray;
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php
index ab0258a..30c1336 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/DirectDebitB2CSecuredPaymentMethodTest.php
@@ -13,7 +13,7 @@
* This does not have to mean that your integration is broken. Please verify the given debug information
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php
index 50fc21d..c72b8be 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/EasyCreditPaymentMethodTest.php
@@ -9,7 +9,7 @@
* easyCredit Tests
*
* @license Use of this software requires acceptance of the License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php
new file mode 100644
index 0000000..d1b0c53
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php
@@ -0,0 +1,269 @@
+
+
+ /**
+ * Transaction currency
+ *
+ * @var string currency
+ */
+ protected $currency = 'EUR';
+ /**
+ * Secret
+ *
+ * The secret will be used to generate a hash using
+ * transaction id + secret. This hash can be used to
+ * verify the the payment response. Can be used for
+ * brute force protection.
+ *
+ * @var string secret
+ */
+ protected $secret = 'Heidelpay-PhpPaymentApi';
+
+ /**
+ * PaymentObject
+ *
+ * @var \Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2CSecuredPaymentMethod
+ */
+ protected $paymentObject;
+
+ /**
+ * @var string $authorizeReference
+ */
+ protected $authorizeReference;
+
+ protected $companyData;
+
+ protected $executiveData;
+
+ /**
+ * Constructor used to set timezone to utc
+ */
+ public function __construct()
+ {
+ date_default_timezone_set('UTC');
+ parent::__construct();
+
+ $this->companyData = new Company();
+ $this->executiveData = new Executive();
+ }
+
+ //
+
+ //
+
+ /**
+ * Set up function will create a invoice object for each test case
+ *
+ * @see PHPUnit_Framework_TestCase::setUp()
+ */
+ // @codingStandardsIgnoreStart
+ public function _before()
+ {
+ // @codingStandardsIgnoreEnd
+ $authentication = $this->authentication
+ ->setTransactionChannel('31HA07BC8129FBA7AF655AB2C27E5B3C')
+ ->getAuthenticationArray();
+
+ $customerDetails = $this->customerData->getCustomerDataArray();
+ $companyDetails = $this->companyData->getCompanyDataArray();
+
+ $Invoice = new Invoice();
+ $Invoice->getRequest()->authentification(...$authentication);
+ $Invoice->getRequest()->customerAddress(...$customerDetails);
+ $Invoice->getRequest()->company(...$companyDetails);
+ $this->paymentObject = $Invoice;
+ }
+
+ //
+
+ //
+
+ /**
+ * Test case for a single invoice authorisation
+ *
+ * @return string payment reference id for the invoice authorize transaction
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function authorize()
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);
+ $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE');
+
+ $this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12');
+
+ $this->setCompanyNotRegistered();
+
+ $this->paymentObject->authorize();
+
+ /* verify response */
+ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
+
+ /* transaction result */
+ $this->assertTrue(
+ $this->paymentObject->getResponse()->isSuccess(),
+ 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1)
+ );
+ $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'authorize is pending');
+ $this->assertFalse(
+ $this->paymentObject->getResponse()->isError(),
+ 'authorize failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1)
+ );
+ $this->assertEquals($this->paymentObject->getRequest()->getCompany(), $this->paymentObject->getResponse()->getCompany(),
+ 'request\'s company object differs from respons\'s company object');
+
+ $this->logDataToDebug();
+
+ return $this->authorizeReference = (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ /**
+ * Test case for a invoice finalize of a existing authorisation
+ *
+ * @param $referenceId string payment reference id of the invoice authorisation
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends authorize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function finalize($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);
+
+ $this->paymentObject->finalize($referenceId);
+
+ /* verify response */
+ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
+
+ /* transaction result */
+ $this->assertTrue(
+ $this->paymentObject->getResponse()->isSuccess(),
+ 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1)
+ );
+ $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending');
+ $this->assertFalse(
+ $this->paymentObject->getResponse()->isError(),
+ 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1)
+ );
+
+ $this->logDataToDebug();
+
+ return $referenceId;
+ }
+
+ /**
+ * Test case for a invoice reversal of a existing authorisation
+ *
+ * @param $referenceId
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends authorize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function reversal($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+
+ $this->paymentObject->reversal($referenceId);
+
+ /* verify response */
+ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
+
+ /* transaction result */
+ $this->assertTrue(
+ $this->paymentObject->getResponse()->isSuccess(),
+ 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1)
+ );
+ $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending');
+ $this->assertFalse(
+ $this->paymentObject->getResponse()->isError(),
+ 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1)
+ );
+
+ $this->logDataToDebug();
+
+ return (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ /**
+ * Test case for invoice refund
+ *
+ * @param string $referenceId reference id of the invoice to refund
+ *
+ * @depends authorize
+ * @test
+ *
+ * @group connectionTest
+ *
+ * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException
+ */
+ public function refund($referenceId = null)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 3.54, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+ $this->paymentObject->dryRun = true;
+
+ $this->paymentObject->refund((string)$referenceId);
+
+ $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode());
+
+ $this->logDataToDebug();
+ }
+
+ public function setCompanyNotRegistered()
+ {
+ $executiveDetails = $this->executiveData->getExecutiveOneArray();
+
+ $this->paymentObject->getRequest()->getCompany()->setRegistrationtype(RegistrationType::NOT_REGISTERED);
+ $this->paymentObject->getRequest()->getCompany()->setVatid(null);
+ $this->paymentObject->getRequest()->getCompany()->addExecutive(...$executiveDetails);
+ }
+
+ //
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php
new file mode 100644
index 0000000..ff06354
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredFactoringTest.php
@@ -0,0 +1,305 @@
+
+
+ /**
+ * Transaction currency
+ *
+ * @var string currency
+ */
+ protected $currency = 'EUR';
+ /**
+ * Secret
+ *
+ * The secret will be used to generate a hash using
+ * transaction id + secret. This hash can be used to
+ * verify the the payment response. Can be used for
+ * brute force protection.
+ *
+ * @var string secret
+ */
+ protected $secret = 'Heidelpay-PhpPaymentApi';
+
+ /**
+ * PaymentObject
+ *
+ * @var \Heidelpay\PhpPaymentApi\PaymentMethods\InvoiceB2CSecuredPaymentMethod
+ */
+ protected $paymentObject;
+
+ /**
+ * @var string $authorizeReference
+ */
+ protected $authorizeReference;
+
+ /**
+ * Constructor used to set timezone to utc
+ */
+ public function __construct()
+ {
+ date_default_timezone_set('UTC');
+ parent::__construct();
+ }
+
+ //
+
+ //
+
+ /**
+ * Set up function will create a invoice object for each test case
+ *
+ * @see PHPUnit_Framework_TestCase::setUp()
+ */
+ // @codingStandardsIgnoreStart
+ public function _before()
+ {
+ // @codingStandardsIgnoreEnd
+ $authentication = $this->authentication
+ ->setTransactionChannel('31HA07BC8129FBA7AF65A35EC4E540C2')
+ ->getAuthenticationArray();
+ $customerDetails = $this->customerData->getCustomerDataArray();
+
+ $Invoice = new Invoice();
+ $Invoice->getRequest()->authentification(...$authentication);
+ $Invoice->getRequest()->customerAddress(...$customerDetails);
+ $this->paymentObject = $Invoice;
+ }
+
+ //
+
+ //
+
+ /**
+ * Test case for a single invoice authorisation
+ *
+ * @return string payment reference id for the invoice authorize transaction
+ * @group connectionTest
+ *
+ * @dataProvider authorizeDataProvider
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function authorize()
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);
+ $this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE');
+
+ $this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12');
+ $this->paymentObject->getRequest()->factoring('iv' . date('YmdHis'), 'shopperId');
+
+ $this->paymentObject->authorize();
+
+ /* verify response */
+ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
+
+ /* transaction result */
+ $this->assertTrue(
+ $this->paymentObject->getResponse()->isSuccess(),
+ 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1)
+ );
+ $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'authorize is pending');
+ $this->assertFalse(
+ $this->paymentObject->getResponse()->isError(),
+ 'authorize failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1)
+ );
+
+ $this->logDataToDebug();
+
+ return $this->authorizeReference = (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ public function authorizeDataProvider()
+ {
+ return [
+
+ ];
+ }
+
+ /**
+ * Test case for a invoice finalize of a existing authorisation
+ *
+ * @param $referenceId string payment reference id of the invoice authorisation
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends authorize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function finalize($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.12, $this->currency, $this->secret);
+
+ $this->paymentObject->finalize($referenceId);
+
+ /* verify response */
+ $this->successResponseAssertion($timestamp);
+
+ return $referenceId;
+ }
+
+ /**
+ * Test case for a invoice reversal (type REVERSAL)of a existing authorisation
+ *
+ * @param $referenceId
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends finalize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function reversalCancel($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 10, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+
+ $this->paymentObject->reversal($referenceId, ReversalType::RT_CANCEL);
+
+ /* verify response */
+ $this->successResponseAssertion($timestamp);
+
+ return (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ /**
+ * Test case for a invoice reversal (type CREDIT) of a existing authorisation
+ *
+ * @param $referenceId
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends finalize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function reversalCredit($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 10, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+
+ $this->paymentObject->reversal($referenceId, ReversalType::RT_CREDIT);
+
+ /* verify response */
+ $this->successResponseAssertion($timestamp);
+
+ return (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ /**
+ * Test case for a invoice reversal (type RETURN)of a existing authorisation
+ *
+ * @param $referenceId
+ *
+ * @return string payment reference id for the prepayment reversal transaction
+ * @depends finalize
+ * @group connectionTest
+ *
+ * @test
+ *
+ * @throws \Exception
+ */
+ public function reversalReturn($referenceId)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d-H-i-s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 3.12, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+
+ $this->paymentObject->reversal($referenceId, ReversalType::RT_RETURN);
+ $this->successResponseAssertion($timestamp);
+
+ return (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ }
+
+ /**
+ * Test case for invoice refund
+ *
+ * @param string $referenceId reference id of the invoice to refund
+ *
+ * @depends authorize
+ * @test
+ *
+ * @group connectionTest
+ *
+ * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException
+ */
+ public function refund($referenceId = null)
+ {
+ $timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
+ $this->paymentObject->getRequest()->basketData($timestamp, 3.54, $this->currency, $this->secret);
+
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+ $this->paymentObject->dryRun = true;
+
+ $this->paymentObject->refund((string)$referenceId);
+
+ $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode());
+
+ $this->logDataToDebug();
+ }
+
+ /**
+ * @param $timestamp
+ *
+ * @throws \Heidelpay\PhpPaymentApi\Exceptions\HashVerificationException
+ */
+ protected function successResponseAssertion($timestamp)
+ {
+ /* verify response */
+ $this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
+
+ /* transaction result */
+ $this->assertTrue(
+ $this->paymentObject->getResponse()->isSuccess(),
+ 'Transaction failed : ' . print_r($this->paymentObject->getResponse(), 1)
+ );
+ $this->assertFalse($this->paymentObject->getResponse()->isPending(), 'reversal is pending');
+ $this->assertFalse(
+ $this->paymentObject->getResponse()->isError(),
+ 'reversal failed : ' . print_r($this->paymentObject->getResponse()->getError(), 1)
+ );
+
+ $this->logDataToDebug();
+ }
+
+ //
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php
index 158eedc..1115e5b 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/InvoiceB2CSecuredPaymentMethodTest.php
@@ -79,7 +79,7 @@ public function _before()
{
// @codingStandardsIgnoreEnd
$authentication = $this->authentication
- ->setTransactionChannel('31HA07BC81856CAD6D8E05CDDE7E2AC8')
+ ->setTransactionChannel('31HA07BC8129FBA7AF65934626B0F907')
->getAuthenticationArray();
$customerDetails = $this->customerData->getCustomerDataArray();
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php
index 398e728..ec24dc4 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PayPalPaymentMethodTest.php
@@ -13,7 +13,7 @@
* This does not have to mean that your integration is broken. Please verify the given debug information
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php
index 7f1ccb1..6f635e0 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/PrepaymentPaymentMethodTest.php
@@ -14,7 +14,7 @@
* This does not have to mean that your integration is broken. Please verify the given debug information
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php
new file mode 100644
index 0000000..ac4c20f
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php
@@ -0,0 +1,115 @@
+authentication
+ ->setSecuritySender('31HA07BC8142C823FFA6831A1C7A39EF')
+ ->setUserLogin('31ha07bc8142c823ffa666acb95d3b3f')
+ ->setUserPassword('81C93566')
+ ->setTransactionChannel('31HA07BC8142C823FFA60C952A9C414D')
+ ->getAuthenticationArray();
+ $customerDetails = $this->customerData->getCustomerDataArray();
+
+ $santander = new SantanderHirePurchasePaymentMethod();
+
+ $santander->getRequest()->authentification(...$authentication);
+ $santander->getRequest()->customerAddress(...$customerDetails);
+ $santander->getRequest()->b2cSecured('MR', '1970-01-01');
+ $santander->getRequest()->async('DE', 'https://dev.heidelpay.com');
+
+ $santander->getRequest()->getRiskInformation()->set('guestcheckout', false);
+ $santander->getRequest()->getRiskInformation()->set('since', '2013-01-01');
+ $santander->getRequest()->getRiskInformation()->set('ordercount', 3);
+
+ $santander->getRequest()->basketData(
+ 'santanderHirePurchaseTest',
+ 500.98,
+ $this->currency,
+ $this->secret
+ );
+
+ $this->paymentObject = $santander;
+ }
+
+ /**
+ * @test
+ *
+ * @throws \Heidelpay\PhpPaymentApi\Exceptions\UndefinedTransactionModeException
+ */
+ public function initialRequest()
+ {
+ $this->paymentObject->initialize();
+
+ $response = $this->paymentObject->getResponse();
+
+ $this->assertTrue($response->isSuccess(), 'Response is not successful.');
+
+ // following field is essential for santander hire purchase, so it must not be null.
+ $this->assertNotNull($response->getFrontend()->getRedirectUrl(), 'RedirectUrl is null.');
+
+ $this->logDataToDebug();
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php
index a69cf2e..c6ba1f1 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SantanderInvoicePaymentMethodTest.php
@@ -2,6 +2,9 @@
namespace Heidelpay\Tests\PhpPaymentApi\Integration\PaymentMethods;
+use Heidelpay\PhpBasketApi\Request as BasketRequest;
+use Heidelpay\PhpBasketApi\Response as BasketResponse;
+use Heidelpay\PhpBasketApi\Object\BasketItem;
use Heidelpay\PhpPaymentApi\Constants\PaymentMethod;
use Heidelpay\PhpPaymentApi\Constants\TransactionType;
use Heidelpay\PhpPaymentApi\PaymentMethods\SantanderInvoicePaymentMethod;
@@ -14,7 +17,7 @@
* This does not have to mean that your integration is broken. Please verify the given debug information
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
@@ -95,12 +98,16 @@ public function _before()
*/
public function authorize()
{
+ $basketReferenceId = $this->createTestBasket();
+
$timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
$this->paymentObject->getRequest()->basketData($timestamp, 123.12, $this->currency, $this->secret);
$this->paymentObject->getRequest()->b2cSecured('MRS', '1982-07-12');
$this->paymentObject->getRequest()->async('DE', 'https://dev.heidelpay.com');
$this->paymentObject->getRequest()->getFrontend()->setEnabled('FALSE');
+ $this->paymentObject->getRequest()->getCustomer()->setOptIn2(true);
+ $this->paymentObject->getRequest()->getBasket()->setId($basketReferenceId);
$this->paymentObject->authorize();
@@ -124,24 +131,27 @@ public function authorize()
}
/**
- * Test case for a invoice finalize of a existing authorisation
+ * Test case for a invoice reversal of a existing authorisation
*
- * @param $referenceId string payment reference id of the invoice authorisation
*
* @return string payment reference id for the prepayment reversal transaction
- * @depends authorize
* @group connectionTest
+ * @depends authorize
*
* @test
*
* @throws \Exception
+ *
+ * @param mixed $referenceId
*/
- public function finalize($referenceId)
+ public function reversal($referenceId)
{
$timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
- $this->paymentObject->getRequest()->basketData($timestamp, 82.12, $this->currency, $this->secret);
+ $this->paymentObject->getRequest()->basketData($timestamp, 23.54, $this->currency, $this->secret);
- $this->paymentObject->finalize($referenceId);
+ /* the refund can not be processed because there will be no receipt automatically on the sandbox */
+
+ $this->paymentObject->reversal($referenceId);
/* verify response */
$this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
@@ -163,26 +173,28 @@ public function finalize($referenceId)
}
/**
- * Test case for a invoice reversal of a existing authorisation
+ * Test case for a invoice finalize of a existing authorisation
*
+ * @param $referenceId string payment reference id of the invoice authorisation
*
* @return string payment reference id for the prepayment reversal transaction
- * @depends finalize
* @group connectionTest
*
* @test
*
* @throws \Exception
*/
- public function reversal()
+ public function finalize()
{
+ $basketReferenceId = $this->createTestBasket();
$referenceId = $this->authorize();
+
$timestamp = $this->getMethod(__METHOD__) . ' ' . date('Y-m-d H:i:s');
- $this->paymentObject->getRequest()->basketData($timestamp, 23.54, $this->currency, $this->secret);
+ $this->paymentObject->getRequest()->basketData($timestamp, 123.12, $this->currency, $this->secret);
+ $this->paymentObject->getRequest()->getBasket()->setId($basketReferenceId);
- /* the refund can not be processed because there will be no receipt automatically on the sandbox */
- $this->paymentObject->reversal($referenceId);
+ $this->paymentObject->finalize($referenceId);
/* verify response */
$this->assertTrue($this->paymentObject->getResponse()->verifySecurityHash($this->secret, $timestamp));
@@ -200,7 +212,7 @@ public function reversal()
$this->logDataToDebug();
- return (string)$this->paymentObject->getResponse()->getPaymentReferenceId();
+ return $referenceId;
}
/**
@@ -208,7 +220,7 @@ public function reversal()
*
* @param string $referenceId reference id of the invoice to refund
*
- * @depends authorize
+ * @depends finalize
* @test
*
* @group connectionTest
@@ -225,8 +237,55 @@ public function refund($referenceId = null)
$this->paymentObject->refund((string)$referenceId);
- $this->assertEquals(PaymentMethod::INVOICE . '.' . TransactionType::REFUND, $this->paymentObject->getRequest()->getPayment()->getCode());
+ $this->assertEquals(
+ PaymentMethod::INVOICE . '.' . TransactionType::REFUND,
+ $this->paymentObject->getRequest()->getPayment()->getCode()
+ );
$this->logDataToDebug();
}
+
+ /**
+ * @return string
+ *
+ * @throws \Heidelpay\PhpBasketApi\Exception\BasketException
+ * @throws \Heidelpay\PhpBasketApi\Exception\CurlAdapterException
+ * @throws \Heidelpay\PhpBasketApi\Exception\InvalidBasketitemPositionException
+ * @throws \Heidelpay\PhpBasketApi\Exception\ParameterOverflowException
+ * @throws \PHPUnit\Framework\AssertionFailedError
+ */
+ public function createTestBasket()
+ {
+ $basketRequest = new BasketRequest();
+
+ $basketItem = (new BasketItem())
+ ->setBasketItemReferenceId('refId')
+ ->setTitle('item name')
+ ->setAmountNet(12312)
+ ->setAmountPerUnit(12312)
+ ->setQuantity(1);
+
+ $basketRequest->getBasket()
+ ->setCurrencyCode('EUR')
+ ->setBasketReferenceId('123456')
+ ->addBasketItem($basketItem)
+ ->setAmountTotalNet(12312);
+
+ $basketRequest->setAuthentication(
+ $this->authentication->getUserLogin(),
+ $this->authentication->getUserPassword(),
+ $this->authentication->getSecuritySender()
+ );
+
+ $basketRequest->setIsSandboxMode(true);
+
+ /** @var BasketResponse $basketResponse */
+ $basketResponse = $basketRequest->addNewBasket();
+
+ $this->logDataToDebug($basketResponse);
+
+ $this->assertTrue($basketResponse->isSuccess());
+
+ return $basketResponse->getBasketId();
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php
index c730d42..f3e01d7 100644
--- a/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/integration/PaymentMethods/SofortPaymentMethodTest.php
@@ -15,7 +15,7 @@
* This does not have to mean that your integration is broken. Please verify the given debug information
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php b/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php
index 944268c..e25326d 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/Adapter/CurlAdapterTest.php
@@ -12,6 +12,7 @@
use Heidelpay\Tests\PhpPaymentApi\Helper\Constraints\ArraysMatchConstraint;
use PHPUnit\Framework\Constraint\Constraint;
use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
/**
* Unit test for the curl adapter
@@ -161,7 +162,7 @@ public function simplePost()
'TRANSACTION.MODE' => TransactionMode::CONNECTOR_TEST,
'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865',
'PAYMENT.CODE' => PaymentMethod::CREDIT_CARD . '.' . TransactionType::REGISTRATION,
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'FRONTEND.ENABLED' => 'TRUE',
'FRONTEND.LANGUAGE' => 'EN',
'FRONTEND.RESPONSE_URL' => 'http://dev.heidelpay.com',
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php
new file mode 100644
index 0000000..a6537ab
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/CompanyParameterGroupTest.php
@@ -0,0 +1,204 @@
+company = new Company();
+ $executive = new Executive();
+
+ $this->company->addExecutive(...$executive->getExecutiveOneArray());
+ $this->company->addExecutive(...$executive->getExecutiveTwoArray());
+ $this->company->addExecutive(...$executive->getExecutiveOneArray());
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->company = null;
+ }
+
+ /**
+ * companyName getter/setter test
+ *
+ * @test
+ */
+ public function companyName()
+ {
+ $value = 'company name';
+ $this->company->setCompanyname($value);
+
+ $this->assertEquals($value, $this->company->getCompanyname());
+ }
+
+ /**
+ * registrationType getter/setter test
+ *
+ * @test
+ */
+ public function registrationType()
+ {
+ $value = 'REGISTRED';
+ $this->company->setRegistrationType($value);
+
+ $this->assertEquals($value, $this->company->getRegistrationType());
+ }
+
+ /**
+ * commercialRegisterNumber getter/setter test
+ *
+ * @test
+ */
+ public function commercialRegisterNumber()
+ {
+ $value = 'company name';
+ $this->company->setCommercialRegisterNumber($value);
+
+ $this->assertEquals($value, $this->company->getCommercialRegisterNumber());
+ }
+
+ /**
+ * vatId getter/setter test
+ *
+ * @test
+ */
+ public function vatId()
+ {
+ $value = 'company name';
+ $this->company->setVatId($value);
+
+ $this->assertEquals($value, $this->company->getVatId());
+ }
+
+ /**
+ * executive getter/setter test
+ *
+ * @test
+ */
+ public function executive()
+ {
+ $value = [
+ new ExecutiveParameterGroup()
+ ];
+
+ $this->company->setExecutive($value);
+ $this->assertEquals($value, $this->company->getExecutive());
+ }
+
+ /**
+ * @param ExecutiveParameterGroup $expected
+ * @param mixed $index
+ * @dataProvider executiveGetterIndexShouldWorkAsExpectedDataProvider
+ * @test
+ */
+ public function executiveGetterIndexShouldWorkAsExpected($expected, $index)
+ {
+ $this->assertEquals($expected, $this->company->getExecutive($index));
+ }
+
+ public function executiveGetterIndexShouldWorkAsExpectedDataProvider()
+ {
+ $executiveFixture = new Executive();
+
+ $testCompany = new CompanyParameterGroup();
+ $testCompany->addExecutive(...$executiveFixture->getExecutiveOneArray());
+ $testCompany->addExecutive(...$executiveFixture->getExecutiveTwoArray());
+ $testCompany->addExecutive(...$executiveFixture->getExecutiveOneArray());
+
+ return [
+ 'index exists' => [$testCompany->executive[0], 0],
+ 'index of second executive' => [$testCompany->executive[1], 1],
+ 'last element exists' => [$testCompany->executive[2], 2],
+ 'index element doesnt exists' => [null, 3],
+ 'negative index' => [null, -3],
+ 'index is boolean true' => [null, true],
+ 'index is boolean false' => [null, false],
+ ];
+ }
+
+ /**
+ * CommercialSector getter/setter test
+ *
+ * @test
+ */
+ public function commercialSector()
+ {
+ $value = CommercialSector::COMPUTER_PROGRAMMING_CONSULTANCY_AND_RELATED_ACTIVITIES;
+ $this->company->setCommercialSector($value);
+
+ $this->assertEquals($value, $this->company->getCommercialSector());
+ }
+
+ /**
+ * location getter/setter test
+ *
+ * @test
+ */
+ public function location()
+ {
+ $value = new Location();
+ $this->company->setLocation($value);
+
+ $this->assertEquals($value, $this->company->getLocation());
+ }
+
+ /**
+ * @dataProvider functionShouldBeSetAsExpectedDataProvider
+ * @test
+ *
+ * @param mixed $expected
+ * @param mixed $function
+ */
+ public function functionShouldBeSetAsExpected($expected, $function)
+ {
+ $company = new Company();
+ $company->addExecutive('', '', '', '', '', '', '', '', '', '', $function);
+
+ $this->assertEquals($expected, $company->getExecutive()[0]->getFunction());
+ }
+
+ public function functionShouldBeSetAsExpectedDataProvider()
+ {
+ return [
+ 'function is null' => ['OWNER', null],
+ 'function is empty string' => ['OWNER', ''],
+ 'function is false' => ['OWNER', false],
+ 'function is true' => ['OWNER', true],
+ 'function is string' => ['hello world', 'hello world'],
+ 'function is number' => ['OWNER', 42],
+ ];
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php
new file mode 100644
index 0000000..4328a13
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/ExecutiveParameterGroupTest.php
@@ -0,0 +1,149 @@
+executive = new Executive();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->executive = null;
+ }
+
+ /**
+ * function getter/setter test
+ *
+ * @test
+ */
+ public function functionTest()
+ {
+ $value = 'company name';
+ $this->executive->setFunction($value);
+
+ $this->assertEquals($value, $this->executive->getFunction());
+ }
+
+ /**
+ * salutation getter/setter test
+ *
+ * @test
+ */
+ public function salutation()
+ {
+ $value = 'company name';
+ $this->executive->setSalutation($value);
+
+ $this->assertEquals($value, $this->executive->getSalutation());
+ }
+
+ /**
+ * given getter/setter test
+ *
+ * @test
+ */
+ public function given()
+ {
+ $value = 'company name';
+ $this->executive->setGiven($value);
+
+ $this->assertEquals($value, $this->executive->getGiven());
+ }
+
+ /**
+ * family getter/setter test
+ *
+ * @test
+ */
+ public function family()
+ {
+ $value = 'company name';
+ $this->executive->setFamily($value);
+
+ $this->assertEquals($value, $this->executive->getFamily());
+ }
+
+ /**
+ * birthdate getter/setter test
+ *
+ * @test
+ */
+ public function birthdate()
+ {
+ $value = 'company name';
+ $this->executive->setBirthdate($value);
+
+ $this->assertEquals($value, $this->executive->getBirthdate());
+ }
+
+ /**
+ * email getter/setter test
+ *
+ * @test
+ */
+ public function email()
+ {
+ $value = 'company name';
+ $this->executive->setEmail($value);
+
+ $this->assertEquals($value, $this->executive->getEmail());
+ }
+
+ /**
+ * phone getter/setter test
+ *
+ * @test
+ */
+ public function phone()
+ {
+ $value = 'company name';
+ $this->executive->setPhone($value);
+
+ $this->assertEquals($value, $this->executive->getPhone());
+ }
+
+ /**
+ * home getter/setter test
+ *
+ * @test
+ */
+ public function home()
+ {
+ $value = new HomeParameterGroup();
+ $this->executive->setHome($value);
+
+ $this->assertEquals($value, $this->executive->getHome());
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php
index d105ed8..9642c65 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/FrontendParameterGroupTest.php
@@ -3,8 +3,8 @@
namespace Heidelpay\Tests\PhpPaymentApi\Unit\ParameterGroup;
use Codeception\TestCase\Test;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
use Heidelpay\PhpPaymentApi\ParameterGroups\FrontendParameterGroup as Frontend;
-use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
/**
* Unit test for FrontendParameterGroup
@@ -81,18 +81,19 @@ public function responseUrl()
}
/**
- *Frontend mode getter/setter test
+ * Frontend mode getter/setter test
*
* @test
*/
- public function mode()
+ public function modeShouldNotBeChangeable()
{
$frontend = new Frontend();
- $value = TransactionMode::CONNECTOR_TEST;
- $frontend->setMode($value);
+ $frontend->setMode('DEFAULT');
+ $this->assertEquals(FrontendMode::FRONTEND_MODE_WHITELABEL, $frontend->getMode());
- $this->assertEquals($value, $frontend->getMode());
+ $frontend->set('mode', 'OTHERMODE');
+ $this->assertEquals(FrontendMode::FRONTEND_MODE_WHITELABEL, $frontend->getMode());
}
/**
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php
new file mode 100644
index 0000000..30f28a3
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/HomeParameterGroupTest.php
@@ -0,0 +1,96 @@
+home = new Home();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->home = null;
+ }
+
+ /**
+ * street getter/setter test
+ *
+ * @test
+ */
+ public function street()
+ {
+ $value = 'company name';
+ $this->home->setStreet($value);
+
+ $this->assertEquals($value, $this->home->getStreet());
+ }
+
+ /**
+ * zip getter/setter test
+ *
+ * @test
+ */
+ public function zip()
+ {
+ $value = 'company name';
+ $this->home->setZip($value);
+
+ $this->assertEquals($value, $this->home->getZip());
+ }
+
+ /**
+ * city getter/setter test
+ *
+ * @test
+ */
+ public function city()
+ {
+ $value = 'company name';
+ $this->home->setCity($value);
+
+ $this->assertEquals($value, $this->home->getCity());
+ }
+
+ /**
+ * country getter/setter test
+ *
+ * @test
+ */
+ public function country()
+ {
+ $value = 'company name';
+ $this->home->setCountry($value);
+
+ $this->assertEquals($value, $this->home->getCountry());
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php
index 90f616d..defd60d 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/IdentificationParameterGroupTest.php
@@ -19,6 +19,21 @@
*/
class IdentificationParameterGroupTest extends Test
{
+ /**
+ * @var Identification
+ */
+ protected $identification;
+
+ public function _before()
+ {
+ $this->identification = new Identification();
+ }
+
+ public function _after()
+ {
+ $this->identification = null;
+ }
+
/**
* Creditor id getter/setter test
*
@@ -108,4 +123,17 @@ public function uniqueId()
$this->assertEquals($value, $identification->getUniqueId());
}
+
+ /**
+ * Invoice id getter/setter test
+ *
+ * @test
+ */
+ public function invoiceId()
+ {
+ $value = '132456';
+ $this->identification->setInvoiceid($value);
+
+ $this->assertEquals($value, $this->identification->getInvoiceid());
+ }
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php
new file mode 100644
index 0000000..281dcf1
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/LocationParameterGroupTest.php
@@ -0,0 +1,109 @@
+location = new Location();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->location = null;
+ }
+
+ /**
+ * pobox getter/setter test
+ *
+ * @test
+ */
+ public function pobox()
+ {
+ $value = 'company name';
+ $this->location->setPobox($value);
+
+ $this->assertEquals($value, $this->location->getPobox());
+ }
+
+ /**
+ * street getter/setter test
+ *
+ * @test
+ */
+ public function street()
+ {
+ $value = 'company name';
+ $this->location->setStreet($value);
+
+ $this->assertEquals($value, $this->location->getStreet());
+ }
+
+ /**
+ * zip getter/setter test
+ *
+ * @test
+ */
+ public function zip()
+ {
+ $value = 'company name';
+ $this->location->setZip($value);
+
+ $this->assertEquals($value, $this->location->getZip());
+ }
+
+ /**
+ * city getter/setter test
+ *
+ * @test
+ */
+ public function city()
+ {
+ $value = 'company name';
+ $this->location->setCity($value);
+
+ $this->assertEquals($value, $this->location->getCity());
+ }
+
+ /**
+ * country getter/setter test
+ *
+ * @test
+ */
+ public function country()
+ {
+ $value = 'company name';
+ $this->location->setCountry($value);
+
+ $this->assertEquals($value, $this->location->getCountry());
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php
index 897b6ee..5182ed9 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/PaymentParameterGroupTest.php
@@ -4,6 +4,7 @@
use Codeception\TestCase\Test;
use Heidelpay\PhpPaymentApi\Constants\PaymentMethod;
+use Heidelpay\PhpPaymentApi\Constants\ReversalType;
use Heidelpay\PhpPaymentApi\Constants\TransactionType;
use Heidelpay\PhpPaymentApi\ParameterGroups\PaymentParameterGroup as Payment;
@@ -21,16 +22,37 @@
*/
class PaymentParameterGroupTest extends Test
{
+ /**
+ * @var Payment
+ */
+ protected $payment;
+
+ public function _before()
+ {
+ $this->payment = new Payment();
+ }
+
/**
* Payment code setter/getter test
*/
public function testCode()
{
- $Payment = new Payment();
-
$value = PaymentMethod::INVOICE . '.' . TransactionType::RESERVATION;
- $Payment->setCode($value);
+ $this->payment->setCode($value);
+
+ $this->assertEquals($value, $this->payment->getCode());
+ }
+
+ /**
+ * reversal type getter/setter test
+ *
+ * @test
+ */
+ public function reversalType()
+ {
+ $value = ReversalType::RT_CREDIT;
+ $this->payment->setReversaltype($value);
- $this->assertEquals($value, $Payment->getCode());
+ $this->assertEquals($value, $this->payment->getReversaltype());
}
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php
index 9e745c2..a7e5f62 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/RiskInformationParameterGroupTest.php
@@ -29,9 +29,9 @@ public function guestcheckout()
$riskInformation = new RiskInformation();
$guestcheckout = false;
- $riskInformation->setGuestCheckout($guestcheckout);
+ $riskInformation->setCustomerGuestCheckout($guestcheckout);
- $this->assertFalse($riskInformation->getGuestcheckout(), 'guestcheckout should be false');
+ $this->assertFalse($riskInformation->getCustomerGuestCheckout(), 'guestcheckout should be false');
}
/**
@@ -44,9 +44,9 @@ public function since()
$riskInformation = new RiskInformation();
$since = '1984-05-23';
- $riskInformation->setSince($since);
+ $riskInformation->setCustomerSince($since);
- $this->assertEquals($since, $riskInformation->getSince());
+ $this->assertEquals($since, $riskInformation->getCustomerSince());
}
/**
@@ -59,8 +59,8 @@ public function ordercount()
$riskInformation = new RiskInformation();
$ordercount = 5;
- $riskInformation->setOrderCount($ordercount);
+ $riskInformation->setCustomerOrderCount($ordercount);
- $this->assertEquals($ordercount, $riskInformation->getOrdercount());
+ $this->assertEquals($ordercount, $riskInformation->getCustomerOrderCount());
}
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php
index 2c00ea7..4e7ded3 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ParameterGroups/TransactionParameterGroupTest.php
@@ -10,7 +10,7 @@
* Unit test for TransactionParameterGroup
*
* @license Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
- * @copyright Copyright © 2016-present Heidelberger Payment GmbH. All rights reserved.
+ * @copyright Copyright © 2016-present heidelpay GmbH. All rights reserved.
*
* @link http://dev.heidelpay.com/heidelpay-php-payment-api/
*
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php
index edc93c4..d2808d8 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/CreditCardPaymentMethodTest.php
@@ -9,6 +9,7 @@
use Heidelpay\Tests\PhpPaymentApi\Helper\BasePaymentMethodTest;
use Heidelpay\PhpPaymentApi\Constants\TransactionType;
use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
/**
* This test class verifies the special functionality of the CreditCardPaymentMethod not covered in
@@ -142,6 +143,23 @@ public function _after()
//
+ //
+
+ /**
+ * @return array
+ */
+ public static function traitImportedParentMethods()
+ {
+ return [
+ ['authorizeParent'],
+ ['debitParent'],
+ ['registrationParent'],
+ ['reregistrationParent'],
+ ];
+ }
+
+ //
+
//
/**
@@ -199,7 +217,7 @@ public function registrationParametersShouldBeSetUpAsExpected()
'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
'FRONTEND.CSS_PATH' => self::CSS_PATH,
'FRONTEND.ENABLED' => 'FALSE',
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN,
'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect,
'IDENTIFICATION.SHOPPERID' => $shopperId,
@@ -281,7 +299,7 @@ public function reregistrationParametersShouldBeSetUpAsExpected()
'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
'FRONTEND.CSS_PATH' => self::CSS_PATH,
'FRONTEND.ENABLED' => 'FALSE',
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN,
'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect,
'IDENTIFICATION.SHOPPERID' => $shopperId,
@@ -357,7 +375,7 @@ public function authorizeParametersShouldBeSetUpAsExpected()
'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
'FRONTEND.CSS_PATH' => self::CSS_PATH,
'FRONTEND.ENABLED' => $frontendEnabled,
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN,
'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect,
'IDENTIFICATION.SHOPPERID' => $shopperId,
@@ -456,7 +474,7 @@ public function debitParametersShouldBeSetUpAsExpected()
'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
'FRONTEND.CSS_PATH' => self::CSS_PATH,
'FRONTEND.ENABLED' => $frontendEnabled,
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'FRONTEND.PAYMENT_FRAME_ORIGIN' => self::PAYMENT_FRAME_ORIGIN,
'FRONTEND.PREVENT_ASYNC_REDIRECT' => $preventAsyncRedirect,
'IDENTIFICATION.SHOPPERID' => $shopperId,
@@ -551,5 +569,26 @@ public function reregistrationShouldNotOverwriteParametersWhenCalledWithNoArgume
$this->assertEquals($this->paymentObject->getRequest()->getFrontend()->getCssPath(), self::CSS_PATH);
}
+ /**
+ * Verify that the imported but overwritten trait methods declared as *parent
+ * are not callable from the instance itself.
+ *
+ * @dataProvider traitImportedParentMethods
+ * @test
+ *
+ * @param string $methodName
+ */
+ public function parentTraitMethodShouldNotBeCallable($methodName)
+ {
+ $this->log(' Testing visibility for method ' . $methodName . ' on ' . get_class($this->paymentObject) . ' ...');
+
+ $this->assertNotInternalType(
+ 'callable',
+ [$this->paymentObject, $methodName],
+ $methodName . ' is callable but should not be!');
+
+ $this->success();
+ }
+
//
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php
index e479ccb..cbb3c45 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/DebitCardPaymentMethodTest.php
@@ -138,6 +138,23 @@ public function _after()
//
+ //
+
+ /**
+ * @return array
+ */
+ public static function traitImportedParentMethods()
+ {
+ return [
+ ['authorizeParent'],
+ ['debitParent'],
+ ['registrationParent'],
+ ['reregistrationParent'],
+ ];
+ }
+
+ //
+
//
/**
@@ -571,5 +588,23 @@ public function reregistrationShouldNotOverwriteParametersWhenCalledWithNoArgume
$this->assertEquals($this->paymentObject->getRequest()->getFrontend()->getCssPath(), self::CSS_PATH);
}
+ /**
+ * Verify that the imported but overwritten trait methods declared as *parent
+ * are not callable from the instance itself.
+ *
+ * @dataProvider traitImportedParentMethods
+ * @test
+ *
+ * @param string $methodName
+ */
+ public function parentTraitMethodShouldNotBeCallable($methodName)
+ {
+ $this->log(' Testing visibility for method ' . $methodName . ' on ' . get_class($this->paymentObject) . ' ...');
+
+ $this->assertNotInternalType('callable', [$this->paymentObject, $methodName], ' is callable but should not be!');
+
+ $this->success();
+ }
+
//
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php
index 37450c2..e58a8a5 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/GenericPaymentMethodTest.php
@@ -5,6 +5,7 @@
use AspectMock\Test as test;
use Heidelpay\PhpPaymentApi\Constants\PaymentMethod;
use Heidelpay\PhpPaymentApi\Constants\TransactionType;
+use Heidelpay\PhpPaymentApi\PaymentMethods\BasicPaymentMethodTrait;
use Heidelpay\Tests\PhpPaymentApi\Helper\BasePaymentMethodTest;
/**
@@ -153,5 +154,26 @@ public function verifyPaymentMethodPresentsAsExpected($paymentMethodClass, $paym
$this->success();
}
+ /**
+ * Verify getPaymentCode returns null if the property 'paymentCode' does not exist.
+ *
+ * @test
+ */
+ public function basicPaymentMethodTraitShouldReturnNullWhenAPropertyIsNotDefined()
+ {
+ $paymentMethod = new DummyPaymentMethod();
+ $this->assertNull($paymentMethod->getPaymentCode());
+ }
+
//
}
+
+/**
+ * This class is used to test the perform trait test.
+ *
+ * @package Heidelpay\Tests\PhpPaymentApi\Unit\PaymentMethods
+ */
+class DummyPaymentMethod
+{
+ use BasicPaymentMethodTrait;
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php
new file mode 100644
index 0000000..7f4c479
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/InvoiceB2BSecuredPaymentMethodTest.php
@@ -0,0 +1,217 @@
+company = new Company();
+ }
+
+ /**
+ * Set up function will create a payment method object for each test case
+ *
+ * @throws \Exception
+ */
+ // @codingStandardsIgnoreStart
+ public function _before()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->authentication->setTransactionChannel('31HA07BC8142C5A171744F3D6D155865');
+
+ $paymentObject = new InvoiceB2CSecuredPaymentMethod();
+
+ $request = $paymentObject->getRequest();
+ $request->authentification(...$this->authentication->getAuthenticationArray());
+ $request->customerAddress(...$this->customerData->getCustomerDataArray());
+ $request->company(...$this->company->getCompanyDataArray());
+
+ $executive = new Executive();
+
+ $executiveOne = $executive->getExecutiveOneArray();
+ $executiveTwo = $executive->getExecutiveTwoArray();
+
+ $request->getCompany()->addExecutive(...$executiveOne);
+ $request->getCompany()->addExecutive(...$executiveTwo);
+ $paymentObject->dryRun = false;
+
+ $this->paymentObject = $paymentObject;
+
+ $this->mockCurlAdapter();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->paymentObject = null;
+ test::clean();
+ }
+
+ /**
+ * Prepare request company.
+ * This test will convert the request object to post array format
+ *
+ * @test
+ */
+ public function companyParametersShouldBeSetAsExpected()
+ {
+ $expectedRequestArray = [
+ 'COMPANY.COMPANYNAME' => 'heidelpay GmbH',
+ 'COMPANY.REGISTRATIONTYPE' => RegistrationType::REGISTERED,
+ 'COMPANY.COMMERCIALREGISTERNUMBER' => 'HRB 702091',
+ 'COMPANY.VATID' => 'DE 253 689 876',
+ 'COMPANY.COMMERCIALSECTOR' => CommercialSector::AIR_TRANSPORT,
+ 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi',
+ 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
+ 'FRONTEND.ENABLED' => 'TRUE',
+ 'FRONTEND.MODE' => 'WHITELABEL',
+ 'REQUEST.VERSION' => '1.0',
+ 'TRANSACTION.MODE' => 'CONNECTOR_TEST',
+ 'COMPANY.LOCATION.STREET' => 'Vangerowstr. 18',
+ 'COMPANY.LOCATION.ZIP' => '69115',
+ 'COMPANY.LOCATION.CITY' => 'Heidelberg',
+ 'COMPANY.LOCATION.COUNTRY' => 'DE',
+ 'COMPANY.EXECUTIVE.1.FUNCTION' => 'OWNER',
+ 'COMPANY.EXECUTIVE.1.BIRTHDATE' => '1988-12-12',
+ 'COMPANY.EXECUTIVE.1.GIVEN' => 'Testkäufer',
+ 'COMPANY.EXECUTIVE.1.FAMILY' => 'Händler',
+ 'COMPANY.EXECUTIVE.1.EMAIL' => 'example@email.de',
+ 'COMPANY.EXECUTIVE.1.PHONE' => '062216471400',
+ 'COMPANY.EXECUTIVE.1.HOME.STREET' => 'Vangerowstr. 18',
+ 'COMPANY.EXECUTIVE.1.HOME.ZIP' => '69115',
+ 'COMPANY.EXECUTIVE.1.HOME.CITY' => 'Heidelberg',
+ 'COMPANY.EXECUTIVE.1.HOME.COUNTRY' => 'DE',
+ 'COMPANY.EXECUTIVE.2.FUNCTION' => 'OWNER',
+ 'COMPANY.EXECUTIVE.2.SALUTATION' => '',
+ 'COMPANY.EXECUTIVE.2.BIRTHDATE' => '123',
+ 'COMPANY.EXECUTIVE.2.GIVEN' => '',
+ 'COMPANY.EXECUTIVE.2.FAMILY' => '',
+ 'COMPANY.EXECUTIVE.2.EMAIL' => '',
+ 'COMPANY.EXECUTIVE.2.PHONE' => '',
+ 'COMPANY.EXECUTIVE.2.HOME.STREET' => 'null',
+ 'COMPANY.EXECUTIVE.2.HOME.ZIP' => 'null',
+ 'COMPANY.EXECUTIVE.2.HOME.CITY' => 'null',
+ 'COMPANY.EXECUTIVE.2.HOME.COUNTRY' => 'null',
+ 'ADDRESS.CITY' => 'Heidelberg',
+ 'ADDRESS.COUNTRY' => 'DE',
+ 'ADDRESS.STATE' => 'DE-BW',
+ 'ADDRESS.STREET' => 'Vangerowstr. 18',
+ 'ADDRESS.ZIP' => '69115',
+ 'CONTACT.EMAIL' => 'development@heidelpay.com',
+ 'IDENTIFICATION.SHOPPERID' => '1234',
+ 'NAME.GIVEN' => 'Heidel',
+ 'NAME.FAMILY' => 'Berger-Payment',
+ 'SECURITY.SENDER' => '31HA07BC8142C5A171745D00AD63D182',
+ 'TRANSACTION.CHANNEL' => '31HA07BC8142C5A171744F3D6D155865',
+ 'USER.LOGIN' => '31ha07bc8142c5a171744e5aef11ffd3',
+ 'USER.PWD' => '93167DE7',
+ ];
+
+ $request = $this->paymentObject->getRequest();
+
+ $this->assertThat($request->toArray(), $this->arraysMatchExactly($expectedRequestArray));
+ }
+
+ /**
+ * @dataProvider requestPostArrayShouldBeMappedAsExpectedDataProvider
+ * @test
+ *
+ * @param mixed $parameterArray
+ */
+ public function requestPostArrayShouldBeMappedAsExpected($parameterArray)
+ {
+ $postResponse = [
+ 'COMPANY_COMPANYNAME' => 'heidelpay GmbH',
+ 'COMPANY_COMMERCIALREGISTERNUMBER' => 'HRB 702091',
+ 'COMPANY_COMMERCIALSECTOR' => 'AIR_TRANSPORT',
+ 'COMPANY_EXECUTIVE_1_BIRTHDATE' => '1988-12-12',
+ 'COMPANY_EXECUTIVE_1_EMAIL' => 'example@email.de',
+ 'COMPANY_EXECUTIVE_1_FAMILY' => 'Händler',
+ 'COMPANY_EXECUTIVE_1_FUNCTION' => 'OWNER',
+ 'COMPANY_EXECUTIVE_1_GIVEN' => 'Testkäufer',
+ 'COMPANY_EXECUTIVE_1_HOME_CITY' => 'Heidelberg',
+ 'COMPANY_EXECUTIVE_1_HOME_COUNTRY' => 'DE',
+ 'COMPANY_EXECUTIVE_1_HOME_STREET' => 'Vangerowstr. 18',
+ 'COMPANY_EXECUTIVE_1_HOME_ZIP' => '69115',
+ 'COMPANY_EXECUTIVE_1_PHONE' => '062216471400',
+ 'COMPANY_EXECUTIVE_2_FUNCTION' => 'OWNER',
+ 'COMPANY_EXECUTIVE_2_SALUTATION' => '',
+ 'COMPANY_EXECUTIVE_2_BIRTHDATE' => '123',
+ 'COMPANY_EXECUTIVE_2_GIVEN' => '',
+ 'COMPANY_EXECUTIVE_2_FAMILY' => '',
+ 'COMPANY_EXECUTIVE_2_EMAIL' => '',
+ 'COMPANY_EXECUTIVE_2_PHONE' => '',
+ 'COMPANY_EXECUTIVE_2_HOME_STREET' => 'null',
+ 'COMPANY_EXECUTIVE_2_HOME_ZIP' => 'null',
+ 'COMPANY_EXECUTIVE_2_HOME_CITY' => 'null',
+ 'COMPANY_EXECUTIVE_2_HOME_COUNTRY' => 'null',
+ 'COMPANY_LOCATION_STREET' => 'Vangerowstr. 18',
+ 'COMPANY_LOCATION_ZIP' => '69115',
+ 'COMPANY_LOCATION_CITY' => 'Heidelberg',
+ 'COMPANY_LOCATION_COUNTRY' => 'DE',
+ 'COMPANY_REGISTRATIONTYPE' => 'REGISTERED',
+ 'COMPANY_VATID' => 'DE 253 689 876',
+ ];
+
+ $postResponse = array_merge($postResponse, $parameterArray);
+
+ $this->assertEquals(
+ $this->paymentObject->getRequest()->getCompany(),
+ Request::fromPost($postResponse)->getCompany()
+ );
+ }
+
+ public function requestPostArrayShouldBeMappedAsExpectedDataProvider()
+ {
+ $invalidParameterkeys = [
+ 'COMPANY_EXECUTIVE_1' => '1988-12-12',
+ 'COMPANY_EXECUTIVE_EMAIL' => 'example@email.de',
+ 'COMPANY_EXECUTIVE_HOME' => 'home',
+ 'COMPANY_EXECUTIVE_1_' => 'home',
+ ];
+ return [
+ 'only default array used' => [[]],
+ 'non existing parameter' => [$invalidParameterkeys],
+ ];
+ }
+
+ /**
+ * @test
+ */
+ public function fromJsonShouldBeMappedAsExpected()
+ {
+ $request = new Request();
+
+ $executive = new Executive();
+ $company = new Company();
+
+ $company->getCompanyDataArray();
+ $request->company(...$company->getCompanyDataArray());
+ $request->getCompany()->addExecutive(...$executive->getExecutiveOneArray());
+ $request->getCompany()->addExecutive(...$executive->getExecutiveTwoArray());
+
+ $mappedRequest = Request::fromJson($request->toJson());
+ $this->assertEquals($request, $mappedRequest);
+ }
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php
new file mode 100644
index 0000000..10172c1
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodFactoringTest.php
@@ -0,0 +1,181 @@
+
+
+ /**
+ * Transaction currency
+ *
+ * @var string $currency
+ */
+ protected $currency = 'EUR';
+ /**
+ * Secret
+ *
+ * The secret will be used to generate a hash using
+ * transaction id + secret. This hash can be used to
+ * verify the the payment response. Can be used for
+ * brute force protection.
+ *
+ * @var string $secret
+ */
+ protected $secret = 'Heidelpay-PhpPaymentApi';
+
+ /**
+ * PaymentObject
+ *
+ * @var DirectDebitB2CSecuredPaymentMethod $paymentObject
+ */
+ protected $paymentObject;
+
+ //
+
+ //
+
+ /**
+ * Set up function will create a payment method object for each test case
+ *
+ * @throws \Exception
+ */
+ // @codingStandardsIgnoreStart
+ public function _before()
+ {
+ $invoiceB2CSecured = new InvoiceB2CSecuredPaymentMethod();
+ $request = $invoiceB2CSecured->getRequest();
+
+ $request->getIdentification()->setShopperid('OriginalShopperId');
+ $request->getIdentification()->setInvoiceid('OriginalInvoiceId');
+ $invoiceB2CSecured->dryRun = false;
+ $this->paymentObject = $invoiceB2CSecured;
+
+ $this->mockCurlAdapter();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->paymentObject = null;
+ test::clean();
+ }
+
+ //
+
+ //
+
+ /**
+ * @return array
+ */
+ public static function transactionCodeProvider()
+ {
+ return [
+ ['finalize', null, TransactionType::FINALIZE]
+ ];
+ }
+
+ /**
+ * @dataProvider FactoringParameterShouldBeSetAsExpectedDataProvider
+ * @test
+ *
+ * @param $invoiceId
+ * @param $shopperId
+ * @param $expectedInvoiceId
+ * @param $expectedShopperId
+ *
+ * @return array
+ */
+ public function factoringParameterShouldBeSetAsExpected($invoiceId, $shopperId, $expectedInvoiceId, $expectedShopperId)
+ {
+ $request = $this->paymentObject->getRequest();
+
+ $request->getIdentification()->setShopperid('OriginalShopperId');
+ $request->getIdentification()->setInvoiceid('OriginalInvoiceId');
+
+ if ($shopperId) {
+ $request->factoring($invoiceId, $shopperId);
+ } else {
+ $request->factoring($invoiceId);
+ }
+
+ $this->expectedRequestVars = [
+ 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi',
+ 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
+ 'FRONTEND.ENABLED' => 'TRUE',
+ 'FRONTEND.MODE' => 'WHITELABEL',
+ 'IDENTIFICATION.INVOICEID' => $expectedInvoiceId,
+ 'IDENTIFICATION.SHOPPERID' => $expectedShopperId,
+ 'REQUEST.VERSION' => '1.0',
+ 'TRANSACTION.MODE' => 'CONNECTOR_TEST',
+ ];
+
+ $this->assertEquals($this->expectedRequestVars, $request->toArray());
+ return $this->expectedRequestVars;
+ }
+
+ public function FactoringParameterShouldBeSetAsExpectedDataProvider()
+ {
+ return [
+ 'shopperid null' => ['invoice01', null, 'invoice01', 'OriginalShopperId'],
+ 'shopperid set separately' => ['invoice01', 'shopper01', 'invoice01', 'shopper01'],
+ ];
+ }
+
+ /**
+ * @test
+ *
+ * @param $requestArray
+ *
+ * @return mixed
+ */
+ public function arrayShouldBeMappedToObjectAsExpected()
+ {
+ $responseArray = [
+ 'CRITERION_SDK_NAME' => 'Heidelpay\PhpPaymentApi',
+ 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
+ 'FRONTEND_ENABLED' => 'TRUE',
+ 'FRONTEND_MODE' => 'WHITELABEL',
+ 'IDENTIFICATION_INVOICEID' => 'OriginalInvoiceId',
+ 'IDENTIFICATION_SHOPPERID' => 'OriginalShopperId',
+ 'REQUEST_VERSION' => '1.0',
+ 'TRANSACTION_MODE' => 'CONNECTOR_TEST',
+ ];
+
+ $this->assertEquals($this->getPaymentObject()->getRequest(), Request::fromPost($responseArray));
+ return $this->paymentObject->getRequest();
+ }
+
+ //
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php
index 4493b02..43d8338 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/PaymentMethodTransactionTest.php
@@ -152,23 +152,23 @@ public function verifyTransactionReturnsThePaymentObject($method, $parameters)
$this->assertSame($this->paymentObject, $object);
}
-// /**
-// * Verify sendPost id called once in each payment method call.
-// *
-// * @dataProvider transactionCodeProvider
-// * @test
-// *
-// * @param $method
-// * @param $parameters
-// */
-// public function verifySendPostIsCalledOnceInEachPaymentMethodCall($method, $parameters)
-// {
-// call_user_func([$this->paymentObject, $method], $parameters);
-//
-// /** @var InstanceProxy $adapter */
-// $adapter = $this->getAdapterMock();
-// $adapter->verifyInvokedOnce('sendPost');
-// }
+ /**
+ * Verify sendPost id called once in each payment method call.
+ *
+ * @dataProvider transactionCodeProvider
+ * @test
+ *
+ * @param $method
+ * @param $parameters
+ */
+ public function verifySendPostIsCalledOnceInEachPaymentMethodCall($method, $parameters)
+ {
+ call_user_func([$this->paymentObject, $method], $parameters);
+
+ /** @var InstanceProxy $adapter */
+ $adapter = $this->getAdapterMock();
+ $adapter->verifyInvokedOnce('sendPost');
+ }
//
@@ -204,7 +204,7 @@ public function registrationParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected =
[
'ACCOUNT.HOLDER' => $this->holder,
@@ -338,7 +338,7 @@ public function authorizeOnRegistrationParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
@@ -400,7 +400,7 @@ public function debitParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ACCOUNT.HOLDER' => $this->holder,
'ACCOUNT.IBAN' => $this->iban,
@@ -467,7 +467,7 @@ public function debitOnRegistrationParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
@@ -528,7 +528,7 @@ public function refundParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
@@ -589,7 +589,7 @@ public function reversalParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
@@ -650,7 +650,7 @@ public function rebillParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
@@ -711,7 +711,7 @@ public function captureParametersShouldBeSetUpAsExpected()
// this is done to avoid syntax warnings
$object = $this->paymentObject;
-
+
$expected = [
'ADDRESS.CITY' => $city,
'ADDRESS.COUNTRY' => $country,
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php
new file mode 100644
index 0000000..391221e
--- /dev/null
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PaymentMethods/SantanderHirePurchasePaymentMethodTest.php
@@ -0,0 +1,153 @@
+
+
+ /**
+ * Account holder
+ *
+ * @var string $holder
+ */
+ protected $holder = 'Heidel Berger-Payment';
+
+ /**
+ * Transaction currency
+ *
+ * @var string $currency
+ */
+ protected $currency = 'EUR';
+
+ /**
+ * Secret
+ *
+ * The secret will be used to generate a hash using
+ * transaction id + secret. This hash can be used to
+ * verify the the payment response. Can be used for
+ * brute force protection.
+ *
+ * @var string $secret
+ */
+ protected $secret = 'Heidelpay-PhpPaymentApi';
+
+ //
+
+ //
+
+ /**
+ * Set up function will create a payment method object for each test case
+ */
+ // @codingStandardsIgnoreStart
+ public function _before()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->authentication->setTransactionChannel('31HA07BC8142C5A171744F3D6D155865');
+
+ $paymentObject = new SantanderHirePurchasePaymentMethod();
+ $paymentObject->getRequest()->authentification(...$this->authentication->getAuthenticationArray());
+ $paymentObject->getRequest()->customerAddress(...$this->customerData->getCustomerDataArray());
+ $paymentObject->dryRun = false;
+
+ $this->paymentObject = $paymentObject;
+
+ $this->mockCurlAdapter();
+ }
+
+ /**
+ * Tear down function will remove all registered test doubles (i.e. Mocks)
+ */
+ // @codingStandardsIgnoreStart
+ public function _after()
+ {
+ // @codingStandardsIgnoreEnd
+ $this->paymentObject = null;
+ test::clean();
+ }
+
+ //
+
+ //
+
+ /**
+ * Verify initialize parameters generated as expected
+ *
+ * @test
+ */
+ public function initializeParametersShouldBeSetUpAsExpected()
+ {
+ $timestamp = 'EasyCreditPaymentMethodTest::initializeParametersShouldBeSetUpAsExpected 2017-11-23 11:41:54';
+ $this->paymentObject->getRequest()->basketData($timestamp, self::TEST_AMOUNT, $this->currency, $this->secret);
+
+ $this->paymentObject->initialize();
+
+ list($firstName, $lastName, , $shopperId, $street, $state, $zip, $city, $country, $email) =
+ $this->customerData->getCustomerDataArray();
+
+ list($securitySender, $userLogin, $userPassword, $transactionChannel, ) =
+ $this->authentication->getAuthenticationArray();
+
+ // this is done to avoid syntax warnings
+ $object = $this->paymentObject;
+
+ $expected = [
+ 'ACCOUNT.BRAND' => Brand::SANTANDER_HP,
+ 'ADDRESS.CITY' => $city,
+ 'ADDRESS.COUNTRY' => $country,
+ 'ADDRESS.STATE' => $state,
+ 'ADDRESS.STREET' => $street,
+ 'ADDRESS.ZIP' => $zip,
+ 'CONTACT.EMAIL' => $email,
+ 'CRITERION.PAYMENT_METHOD' => $object::getClassName(),
+ 'CRITERION.SECRET' => '8263dc9e31b5754332aa23752b0044f4f6ab716ca9ec8d94a1b74ac19d2c5b822d3b' .
+ '1a0d8106c93cd02f2f5654d54c510444e310576e5559e3926fbdab0af02b',
+ 'CRITERION.SDK_NAME' => 'Heidelpay\\PhpPaymentApi',
+ 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
+ 'FRONTEND.ENABLED' => 'TRUE',
+ 'FRONTEND.MODE' => 'WHITELABEL',
+ 'IDENTIFICATION.SHOPPERID' => $shopperId,
+ 'IDENTIFICATION.TRANSACTIONID' => $timestamp,
+ 'NAME.GIVEN' => $firstName,
+ 'NAME.FAMILY' => $lastName,
+ 'PAYMENT.CODE' => self::PAYMENT_METHOD_SHORT . '.' . TransactionType::INITIALIZE,
+ 'PRESENTATION.AMOUNT' => self::TEST_AMOUNT,
+ 'PRESENTATION.CURRENCY' => $this->currency,
+ 'REQUEST.VERSION' => '1.0',
+ 'SECURITY.SENDER' => $securitySender,
+ 'TRANSACTION.CHANNEL' => $transactionChannel,
+ 'TRANSACTION.MODE' => TransactionMode::CONNECTOR_TEST,
+ 'USER.LOGIN' => $userLogin,
+ 'USER.PWD' => $userPassword,
+ ];
+
+ $this->assertThat($this->paymentObject->getRequest()->toArray(), $this->arraysMatchExactly($expected));
+ }
+
+ //
+}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php b/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php
index 75f01db..e0f7ac1 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/PushTest.php
@@ -2,10 +2,11 @@
namespace Heidelpay\Tests\PhpPaymentApi\Unit;
+use Codeception\TestCase\Test;
use Heidelpay\PhpPaymentApi\Constants\PaymentMethod;
use Heidelpay\PhpPaymentApi\Constants\ProcessingResult;
-use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
use Heidelpay\PhpPaymentApi\Constants\StatusCode;
+use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
use Heidelpay\PhpPaymentApi\Constants\TransactionType;
use Heidelpay\PhpPaymentApi\Exceptions\XmlResponseParserException;
use Heidelpay\PhpPaymentApi\Push;
@@ -14,7 +15,6 @@
use Heidelpay\PhpPaymentApi\PushMapping\Payment;
use Heidelpay\PhpPaymentApi\PushMapping\Processing;
use Heidelpay\PhpPaymentApi\Response;
-use Codeception\TestCase\Test;
use SimpleXMLElement;
/**
@@ -80,6 +80,20 @@ class PushTest extends Test
*/
protected $xmlInvalidResponse;
+ /**
+ * Example response that covers company properties
+ *
+ * @var string
+ */
+ protected $xmlSampleCompanyResponse;
+
+ /**
+ * Example response that contains properties relevant for factoring
+ *
+ * @var string
+ */
+ protected $xmlFactoringResponse;
+
/**
* Sets up the fixture, for example, open a network connection.
*/
@@ -93,6 +107,8 @@ public function _before()
$this->setSampleIvRcResponse();
$this->setSamplePpPaResponse();
$this->setSampleInvalidResponse();
+ $this->setSampleCompanyResponse();
+ $this->setSampleFactoringResponse();
}
/**
@@ -448,6 +464,82 @@ public function hasValidMappedPpPaProperties()
);
}
+ /**
+ * @test
+ *
+ * @throws XmlResponseParserException
+ */
+ public function hasValidMappedCompanyProperties()
+ {
+ $push = new Push($this->xmlSampleCompanyResponse);
+ $response = $push->getResponse();
+
+ if (!($response instanceof Response)) {
+ throw new \RuntimeException('Response is not set!');
+ }
+
+ $company = $response->getCompany();
+ $this->assertEquals('heidelpay GmbH', $company->companyname);
+ $this->assertEquals('REGISTERED', $company->registrationtype);
+ $this->assertEquals('123456789', $company->commercialregisternumber);
+ $this->assertEquals('123456', $company->vatid);
+ $this->assertEquals('AIR_TRANSPORT', $company->commercialsector);
+
+ $this->assertEquals(null, $company->getLocation()->pobox);
+ $this->assertEquals('Vangerowstr. 18', $company->getLocation()->street);
+ $this->assertEquals('69115', $company->getLocation()->zip);
+ $this->assertEquals('Heidelberg', $company->getLocation()->city);
+ $this->assertEquals('DE', $company->getLocation()->country);
+
+ $executive = $company->getExecutive();
+ $this->assertEquals('Testkäufer', $executive[0]->given);
+ $this->assertEquals('Händler', $executive[0]->family);
+ $this->assertEquals('1988-12-12', $executive[0]->birthdate);
+ $this->assertEquals('062216471400', $executive[0]->phone);
+ $this->assertEquals('example@email.de', $executive[0]->email);
+ $this->assertEquals('OWNER', $executive[0]->function);
+
+ $this->assertEquals('Vangerowstr. 18', $executive[0]->getHome()->street);
+ $this->assertEquals('69115', $executive[0]->getHome()->zip);
+ $this->assertEquals('Heidelberg', $executive[0]->getHome()->city);
+ $this->assertEquals('DE', $executive[0]->getHome()->country);
+
+
+ $this->assertEquals('Testkäufer-2', $executive[1]->given);
+ $this->assertEquals('Händler-2', $executive[1]->family);
+ $this->assertEquals('1988-02-02', $executive[1]->birthdate);
+ $this->assertEquals('062216471400', $executive[1]->phone);
+ $this->assertEquals('example@email.de', $executive[1]->email);
+ $this->assertEquals(null, $executive[1]->function);
+
+ $this->assertEquals(null, $executive[1]->getHome()->street);
+ $this->assertEquals(null, $executive[1]->getHome()->zip);
+ $this->assertEquals(null, $executive[1]->getHome()->city);
+ $this->assertEquals(null, $executive[1]->getHome()->country);
+
+ $this->assertNotNull($executive[2]);
+
+ codecept_debug('response: ' . print_r($response, 1));
+ }
+
+ /**
+ * @test
+ */
+ public function hasValidMappedFactoringProperties()
+ {
+ $push = new Push($this->xmlFactoringResponse);
+ $response = $push->getResponse();
+
+
+ $this->assertEquals('1', $response->getIdentification()->getShopperId());
+ $this->assertEquals('123456', $response->getIdentification()->getInvoiceid());
+ $this->assertEquals('CANCEL', $response->getPayment()->getReversaltype());
+
+ if (!($response instanceof Response)) {
+ throw new \RuntimeException('Response is not set!');
+ }
+ }
+
/**
* @test
*/
@@ -889,6 +981,81 @@ private function setSampleInvalidResponse()
+XML;
+ }
+
+ private function setSampleCompanyResponse()
+ {
+ $this->xmlSampleCompanyResponse = <<
+
+
+
+ B2B
+
+ heidelpay GmbH
+
+ Vangerowstr. 18
+ 69115
+ Heidelberg
+ DE
+
+ REGISTERED
+ 123456789
+ 123456
+
+ Testkäufer
+ Händler
+ 1988-12-12
+ 062216471400
+ example@email.de
+ OWNER
+
+ Vangerowstr. 18
+ 69115
+ Heidelberg
+ DE
+
+
+
+ Testkäufer-2
+ Händler-2
+ 1988-02-02
+ 062216471400
+ example@email.de
+
+
+
+
+
+
+
+ AIR_TRANSPORT
+
+
+
+
+XML;
+ }
+
+ public function setSampleFactoringResponse()
+ {
+ $this->xmlFactoringResponse = <<
+
+
+
+ 1
+ 123456
+
+
+ CANCEL
+
+
+
XML;
}
}
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php b/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php
index e4d436a..f1a4eb7 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/RequestTest.php
@@ -2,12 +2,14 @@
namespace Heidelpay\Tests\PhpPaymentApi\Unit;
+use AspectMock\Test as aspectMockTest;
use Codeception\TestCase\Test;
+use Heidelpay\PhpPaymentApi\Constants\ApiConfig;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
use Heidelpay\PhpPaymentApi\Exceptions\JsonParserException;
-use Heidelpay\PhpPaymentApi\Request;
use Heidelpay\PhpPaymentApi\ParameterGroups\CriterionParameterGroup;
-use AspectMock\Test as aspectMockTest;
+use Heidelpay\PhpPaymentApi\Request;
/**
*
@@ -164,7 +166,7 @@ public function compareToArrayWithInputArray()
$referenceVars = array(
'CRITERION.SECRET' => '209022666cd4706e5f451067592b6be1aff4a913d5bb7f8249f7418ee25c91b318ebac66f41a6692539c8923adfdad6aae26138b1b3a7e37a197ab952be57876',
'FRONTEND.ENABLED' => 'TRUE',
- 'FRONTEND.MODE' => 'WHITELABEL',
+ 'FRONTEND.MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'IDENTIFICATION.TRANSACTIONID' => '2843294932',
'PRESENTATION.AMOUNT' => 23.12,
'PRESENTATION.CURRENCY' => 'EUR',
@@ -177,6 +179,50 @@ public function compareToArrayWithInputArray()
$this->assertEquals($referenceVars, $request->toArray());
}
+ /**
+ * @dataProvider FactoringParameterShouldBeSetAsExpectedDataProvider
+ * @test
+ *
+ * @param mixed $invoiceId
+ * @param mixed $shopperId
+ * @param mixed $expectedInvoiceId
+ * @param mixed $expectedShopperId
+ */
+ public function FactoringParameterShouldBeSetAsExpected($invoiceId, $shopperId, $expectedInvoiceId, $expectedShopperId)
+ {
+ $request = new Request();
+
+ $request->getIdentification()->setShopperid('OriginalShopperId');
+ $request->getIdentification()->setInvoiceid('OriginalInvoiceId');
+
+ if ($shopperId) {
+ $request->factoring($invoiceId, $shopperId);
+ } else {
+ $request->factoring($invoiceId);
+ }
+
+ $expectedRequestVars = [
+ 'CRITERION.SDK_NAME' => 'Heidelpay\PhpPaymentApi',
+ 'CRITERION.SDK_VERSION' => ApiConfig::SDK_VERSION,
+ 'FRONTEND.ENABLED' => 'TRUE',
+ 'FRONTEND.MODE' => 'WHITELABEL',
+ 'IDENTIFICATION.INVOICEID' => $expectedInvoiceId,
+ 'IDENTIFICATION.SHOPPERID' => $expectedShopperId,
+ 'REQUEST.VERSION' => '1.0',
+ 'TRANSACTION.MODE' => 'CONNECTOR_TEST',
+ ];
+
+ $this->assertEquals($expectedRequestVars, $request->toArray());
+ }
+
+ public function FactoringParameterShouldBeSetAsExpectedDataProvider()
+ {
+ return [
+ 'shopperid null' => ['invoice01', null, 'invoice01', 'OriginalShopperId'],
+ 'shopperid set separately' => ['invoice01', 'shopper01', 'invoice01', 'shopper01'],
+ ];
+ }
+
/**
* Basket parameter group getter test
*
diff --git a/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php b/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php
index 9f10c1c..ce5af66 100644
--- a/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php
+++ b/vendor/heidelpay/php-payment-api/tests/unit/ResponseTest.php
@@ -11,6 +11,7 @@
use Heidelpay\PhpPaymentApi\Exceptions\HashVerificationException;
use Heidelpay\PhpPaymentApi\Constants\TransactionMode;
use Heidelpay\PhpPaymentApi\Constants\ProcessingResult;
+use Heidelpay\PhpPaymentApi\Constants\FrontendMode;
/**
*
@@ -86,7 +87,7 @@ public function _before()
'IDENTIFICATION_SHOPPERID' => '12344',
'PROCESSING_RETURN_CODE' => '000.100.112',
'PROCESSING_RESULT' => ProcessingResult::ACK,
- 'FRONTEND_MODE' => 'WHITELABEL',
+ 'FRONTEND_MODE' => FrontendMode::FRONTEND_MODE_WHITELABEL,
'IDENTIFICATION_UNIQUEID' => '31HA07BC8108A9126F199F2784552637',
'CRITERION_SECRET' => '209022666cd4706e5f451067592b6be1aff4a913d5bb7f8249f7418ee25c91b3' .
'18ebac66f41a6692539c8923adfdad6aae26138b1b3a7e37a197ab952be57876',
@@ -104,15 +105,17 @@ public function _before()
'FRONTEND_LANGUAGE' => 'DE',
'PAYMENT_CODE' => PaymentMethod::CREDIT_CARD . '.' . TransactionType::REGISTRATION,
'BASKET_ID' => '31HA07BC8129FBB819367B2205CD6FB4',
- 'RISKINFORMATION_SINCE' => '2017-01-01',
- 'RISKINFORMATION_ORDERCOUNT' => '5',
- 'RISKINFORMATION_GUESTCHECKOUT' => 'FALSE',
+ 'RISKINFORMATION_CUSTOMERSINCE' => '2017-01-01',
+ 'RISKINFORMATION_CUSTOMERORDERCOUNT' => '5',
+ 'RISKINFORMATION_CUSTOMERGUESTCHECKOUT' => 'FALSE',
'CONNECTOR_ACCOUNT_HOLDER' => 'Test Account Holder',
'CRITERION_TEST_VALUE' => 'Test Value',
'INVALID_PROP' => 'Invalid',
'lang' => 'de'
);
+ ksort($this->responseArray);
+
$this->responseObject = new Response($this->responseArray);
}
@@ -444,4 +447,84 @@ public function staticFromPostMethodShouldReturnNewResponseInstanceOnEmptyArray(
$reponse = Response::fromPost([]);
$this->assertEquals(Response::class, get_class($reponse));
}
+
+ /**
+ * Assert the object is being updated with the given rawResponseParameters and then returned.
+ *
+ * @test
+ */
+ public function splitArrayShouldUpdateAndReturnTheResponseObjectUsingTheGivenResponseArray()
+ {
+ $this->compareResponseArrayToActualArray($this->responseArray);
+
+ // change all parameters of the response
+ $manipulatedResponseArray = $this->getManipulatedArray();
+ $this->responseObject->splitArray($manipulatedResponseArray);
+
+ $this->compareResponseArrayToActualArray($manipulatedResponseArray);
+ }
+
+ /**
+ * Return a response array with manipulated values.
+ *
+ * @return array
+ */
+ private function getManipulatedArray()
+ {
+ $manipulatedResponseArray = [];
+
+ foreach ($this->responseArray as $key => $item) {
+ switch (true) {
+ case is_float($item):
+ $item = 123.45;
+ break;
+ case is_bool($item):
+ $item = !$item;
+ break;
+ case is_string($item):
+ if ($key !== 'FRONTEND_MODE') {
+ $item .= '--' . $key;
+ }
+ break;
+ default:
+ // do nothing
+ break;
+ }
+
+ $manipulatedResponseArray[$key] = $item;
+ }
+
+ return $manipulatedResponseArray;
+ }
+
+ /**
+ * Replaces the underscore of the raw response with a period to make it comparable.
+ *
+ * @return array
+ */
+ private function getComparableArray(array $responseArray = [])
+ {
+ $comparableResponseArray = [];
+ foreach ($responseArray as $key => $item) {
+ $comparableResponseArray[preg_replace('/_/', '.', $key, 1)] = $item;
+ }
+ return $comparableResponseArray;
+ }
+
+ /**
+ * Compares a given rawResponse with the properties of the response object by converting it back into an array.
+ *
+ * @param $responseArray
+ */
+ private function compareResponseArrayToActualArray($responseArray)
+ {
+ $comparableResponseArray = $this->getComparableArray($responseArray);
+ $responseObjectArray = $this->responseObject->toArray(true);
+
+ foreach ($comparableResponseArray as $key => $item) {
+ if (array_key_exists($key, $responseObjectArray)) {
+ $this->assertEquals($comparableResponseArray[$key], $responseObjectArray[$key]);
+ }
+ }
+ }
}
diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php
index 2798886..0842a4f 100644
--- a/woocommerce-heidelpay.php
+++ b/woocommerce-heidelpay.php
@@ -10,14 +10,17 @@
* Plugin Name: heidelpay WooCommerce
* Plugin URI: https://dev.heidelpay.com
* Description: heidelpay payment integration for WooCommerce
- * Version: 1.6.0
+ * Version: 1.7.0
* Author: heidelpay
- * Author URI: htts://www.heidelpay.com
+ * Author URI: https://www.heidelpay.com
* Developer: heidelpay
* Developer URI: https://dev.heidelpay.com
* Text Domain: woocommerce-heidelpay
* Domain Path: /languages
*
+ * WC requires at least: 3.0
+ * WC tested up to: 4.3
+ *
* Copyright: © 2018-present heidelpay GmbH
* License: see LICENSE.txt
*/
@@ -29,7 +32,7 @@
/**
* Required minimums and constants
*/
- define('WC_HEIDELPAY_VERSION', '1.6.0');
+ define('WC_HEIDELPAY_VERSION', '1.7.0');
define('WC_HEIDELPAY_MIN_PHP_VER', '5.6.0');
define('WC_HEIDELPAY_MIN_WC_VER', '3.0.0');
define('WC_HEIDELPAY_MAIN_FILE', __FILE__);
@@ -40,7 +43,6 @@
class WC_Heidelpay
{
-
/**
* @var Singleton The reference the *Singleton* instance of this class
*/
@@ -298,5 +300,4 @@ public static function log($message)
WC_Heidelpay::get_instance();
endif;
-
}