From 4911a8890e54797deb96f3825356922b432d6d37 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 15 Nov 2018 12:44:05 +0100 Subject: [PATCH 01/12] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 95e0a10..0240719 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![PHP 7.0](https://img.shields.io/badge/php-7.0-blue.svg)](http://www.php.net) [![PHP 7.1](https://img.shields.io/badge/php-7.1-blue.svg)](http://www.php.net) -![Logo](https://dev.heidelpay.de/devHeidelpay_400_180.jpg) +![Logo](https://dev.heidelpay.com/devHeidelpay_400_180.jpg) # heidelpay WooCommerce plug-in Payment extension for WooCommerce @@ -20,6 +20,7 @@ To use this extension please paste the contents of the folder "woocommerce"" int * iDEAL * Paypal * Sofort +* invoice b2c * secured invoice b2c ### SYSTEM REQUIREMENTS From 681750133003f5bd57ea97be6b9c12b4c1f8a495 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 29 Nov 2018 15:37:32 +0100 Subject: [PATCH 02/12] [feature] (WOO-50) add meta to order containing uid and sid --- .../abstracts/abstract-wc-heidelpay-payment-gateway.php | 2 +- includes/class-wc-heidelpay-response.php | 7 +++++-- includes/gateways/class-wc-heidelpay-gateway-va.php | 7 +++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 0dd7152..ab9b410 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -315,7 +315,7 @@ protected function setBasket($order_id) /** * @global string $wp_version */ - protected function setCriterions() + protected function setCriterions($orderID = null) { global $wp_version; diff --git a/includes/class-wc-heidelpay-response.php b/includes/class-wc-heidelpay-response.php index 2614dc0..2e6210b 100644 --- a/includes/class-wc-heidelpay-response.php +++ b/includes/class-wc-heidelpay-response.php @@ -70,6 +70,7 @@ public function init(array $post_data, $secret) public function handleResult($post_data, WC_Order $order) { $uid = self::$response->getIdentification()->getUniqueId(); + $sid = self::$response->getIdentification()->getShortId(); if (self::$response->isSuccess()) { $payCode = explode('.', strtoupper($post_data['PAYMENT_CODE'])); @@ -103,7 +104,9 @@ public function handleResult($post_data, WC_Order $order) __('Awaiting payment.', 'woocommerce-heidelpay') . ' ' . $note ); } else { - $order->payment_complete(); + $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(); @@ -123,7 +126,7 @@ public function handleResult($post_data, WC_Order $order) //empty cart wc()->cart->empty_cart(); -//show thank you page + //show thank you page echo $order->get_checkout_order_received_url(); } } diff --git a/includes/gateways/class-wc-heidelpay-gateway-va.php b/includes/gateways/class-wc-heidelpay-gateway-va.php index d63748b..696c8b8 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-va.php +++ b/includes/gateways/class-wc-heidelpay-gateway-va.php @@ -81,4 +81,11 @@ public function getBookingAction() { return (string)$this->bookingModes[$this->get_option('bookingmode')]; } + + public function setCriterions($orderID) + { + parent::setCriterions(); + + $this->payMethod->getRequest()->getCriterion()->set('PAYPAL_PAYMENTREQUEST_0_INVNUM', $orderID); + } } From 5ba8b092b56cee63f0581df2317c9335f6b1e972 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Thu, 29 Nov 2018 15:44:08 +0100 Subject: [PATCH 03/12] [refactor] (WOO-50) add missing throw tags --- .../abstract-wc-heidelpay-payment-gateway.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index ab9b410..e485f6f 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -208,7 +208,7 @@ public function enqueue_assets() * * @param int $order_id * @return array|mixed - * @throws \Heidelpay\PhpPaymentApi\Exceptions\PaymentFormUrlException + * @throws Exception */ public function process_payment($order_id) { @@ -220,6 +220,7 @@ public function process_payment($order_id) /** * @param $order WC_Order + * @throws Exception */ public function prepareRequest(WC_Order $order) { @@ -300,6 +301,7 @@ protected function setCustomer(WC_Order $order) /** * @param $order_id + * @throws Exception */ protected function setBasket($order_id) { @@ -339,7 +341,7 @@ protected function setCriterions($orderID = null) public function performRequest($order, $uid = null) { if (!empty($_POST)) { - try{ + try { $this->handleFormPost($_POST); } catch (\Exception $e) { wc_get_logger()->log(WC_Log_Levels::DEBUG, htmlspecialchars(print_r($e->getMessage(), 1))); @@ -461,6 +463,7 @@ protected function paymentLog($logData) /** * @param $order * @param $uid + * @throws WC_Data_Exception */ public function performNoGuiRequest($order, $uid) { @@ -470,6 +473,7 @@ public function performNoGuiRequest($order, $uid) /** * @param WC_Order $order * @param $uid + * @throws WC_Data_Exception */ public function performAfterRegistrationRequest($order, $uid) { @@ -532,6 +536,7 @@ public function setAvailability($available_gateways) * payment. * @param $orderReceivedText * @return string + * @throws Exception */ public function addPayInfo($orderReceivedText) { @@ -556,6 +561,7 @@ public function addPayInfo($orderReceivedText) /** * Get the order using the Get parameter 'key' * @return bool|WC_Order|WC_Refund + * @throws Exception */ public function getOrderFromKey() { From d5b0dcb3306241822e639fa8e5b43dbcfb971f82 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Fri, 30 Nov 2018 11:09:29 +0100 Subject: [PATCH 04/12] [refactor] (WOO-50) solve php warning & set Beta-Version --- includes/gateways/class-wc-heidelpay-gateway-va.php | 2 +- woocommerce-heidelpay.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/gateways/class-wc-heidelpay-gateway-va.php b/includes/gateways/class-wc-heidelpay-gateway-va.php index 696c8b8..11fc8ca 100644 --- a/includes/gateways/class-wc-heidelpay-gateway-va.php +++ b/includes/gateways/class-wc-heidelpay-gateway-va.php @@ -82,7 +82,7 @@ public function getBookingAction() return (string)$this->bookingModes[$this->get_option('bookingmode')]; } - public function setCriterions($orderID) + public function setCriterions($orderID = null) { parent::setCriterions(); diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php index f66d3cc..922d5d9 100644 --- a/woocommerce-heidelpay.php +++ b/woocommerce-heidelpay.php @@ -10,7 +10,7 @@ * Plugin Name: heidelpay WooCommerce * Plugin URI: https://dev.heidelpay.com * Description: heidelpay payment integration for WooCommerce - * Version: 1.5.0 + * Version: 1.6.0-Beta * Author: heidelpay * Author URI: htts://www.heidelpay.com * Developer: heidelpay @@ -29,7 +29,7 @@ /** * Required minimums and constants */ - define('WC_HEIDELPAY_VERSION', '1.5.0'); + define('WC_HEIDELPAY_VERSION', '1.6.0-Beta'); define('WC_HEIDELPAY_MIN_PHP_VER', '5.6.0'); define('WC_HEIDELPAY_MIN_WC_VER', '3.0.0'); define('WC_HEIDELPAY_MAIN_FILE', __FILE__); From ca2fa2ed79f79a9350c92e9f9276f1cc57509283 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Wed, 5 Dec 2018 11:25:39 +0100 Subject: [PATCH 05/12] [refactor] (TPHP-42) update readme and changelog - add support information - add compare links to Version header --- CHANGELOG.md | 24 ++++++++++++++++-------- README.md | 17 ++++++++++++++++- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b314e7a..21c2dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,20 @@ # Release Notes - heidelpay Payment Gateway for WooCommerce -## 1.5.0 +## [1.5.0][1.5.0] ### Added: - Payment method: Invoice ### Fixed: - Date input for secured invoice not working on Safari browser. -## 1.4.0 +## [1.4.0][1.4.0] ### Added: #### Features: - Supports WooCommerce Subscriptions - Add Prepayment Payment Method -## 1.3.0 +## [1.3.0][1.3.0] ### Fixed: - Credit Card iFrame not working in Safari Browsers @@ -23,7 +23,7 @@ #### Features: - Add GiroPay Payment Method -## 1.2.0 +## [1.2.0][1.2.0] ### Fixed: - Missing payment information for secured invoice and direct debit on success page and notification mail. @@ -35,12 +35,12 @@ - Support for push notifications - A checkbox to decide whether payment information should be added to the notification mail or not. -## 1.1.1 +## [1.1.1][1.1.1] ### Fixed: - a bug that caused the payment requests to fail in some shops due to an invalid url. -## 1.1.0 +## [1.1.0][1.1.0] ### Added @@ -59,7 +59,15 @@ ### Changed - payment methods will be deactivated by default. -## 1.0.1 +## [1.0.1][1.0.1] ### Fixed -- A bug which caused that the sandbox mode was activated regardless of the state of the switch. \ No newline at end of file +- A bug which caused that the sandbox mode was activated regardless of the state of the switch. + +[1.0.1]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.0.0..1.0.1 +[1.1.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.0.1..1.1.0 +[1.1.1]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.1.0..1.1.1 +[1.2.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.1.1..1.2.0 +[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 \ No newline at end of file diff --git a/README.md b/README.md index 0240719..5492ce9 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,19 @@ latest stable PHP version whenever possible. ## LICENSE -You can find a copy of the license in [LICENSE.txt](LICENSE.txt). \ No newline at end of file +You can find a copy of the 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 \ No newline at end of file From 34c234f363c083cf982f2a53e0ddb99ad078e99b Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 2 Jan 2019 10:11:55 +0100 Subject: [PATCH 06/12] [fix](Woo-51) frame origin: Use a wordpress function to get the host url. --- includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php index a9eafcc..eb768fd 100644 --- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php @@ -134,10 +134,10 @@ protected function getIFrame(WC_Order $order) wp_enqueue_script('heidelpay-iFrame'); $this->prepareRequest($order); - // build host url and css path - $protocol = $_SERVER['HTTPS'] ? 'https' : 'http'; - $host = $protocol . '://' . $_SERVER['SERVER_NAME']; + $urlArray = explode('/', get_home_url()); + $host = $urlArray[0] . '//' . $urlArray[2]; + $cssPath = WC_HEIDELPAY_PLUGIN_URL . '/assets/css/creditCardFrame.css'; $bookingAction = $this->getBookingAction(); From 1a9f2459d8a035389fd603a6484783f1e0934408 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 2 Jan 2019 10:15:03 +0100 Subject: [PATCH 07/12] [fix](Woo-51) Send the correct customer ip address. --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 0dd7152..cfb2f84 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -228,6 +228,7 @@ public function prepareRequest(WC_Order $order) $this->setCustomer($order); $this->setBasket($order->get_id()); $this->setCriterions(); + $this->payMethod->getRequest()->getContact()->setIp(WC_Geolocation::get_ip_address()); } /** @@ -310,6 +311,7 @@ protected function setBasket($order_id) 'EUR', // Currency code of this request $this->get_option('secret') // A secret passphrase from your application ); + } /** From 8d5a794b5fea26c280f700369caf63cfe32c9490 Mon Sep 17 00:00:00 2001 From: Florian Evertz Date: Wed, 2 Jan 2019 10:15:56 +0100 Subject: [PATCH 08/12] Update version & changelog --- CHANGELOG.md | 8 +++++++- woocommerce-heidelpay.php | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21c2dbc..e1bbeee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Release Notes - heidelpay Payment Gateway for WooCommerce +## [1.6.0][1.6.0] + +### Added: +- Unique ID and Short ID now show up in Order Meta + ## [1.5.0][1.5.0] ### Added: @@ -70,4 +75,5 @@ [1.2.0]: https://github.com/heidelpay/woocommerce-heidelpay/compare/1.1.1..1.2.0 [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 \ No newline at end of file +[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 diff --git a/woocommerce-heidelpay.php b/woocommerce-heidelpay.php index 922d5d9..2798886 100644 --- a/woocommerce-heidelpay.php +++ b/woocommerce-heidelpay.php @@ -10,7 +10,7 @@ * Plugin Name: heidelpay WooCommerce * Plugin URI: https://dev.heidelpay.com * Description: heidelpay payment integration for WooCommerce - * Version: 1.6.0-Beta + * Version: 1.6.0 * Author: heidelpay * Author URI: htts://www.heidelpay.com * Developer: heidelpay @@ -29,7 +29,7 @@ /** * Required minimums and constants */ - define('WC_HEIDELPAY_VERSION', '1.6.0-Beta'); + define('WC_HEIDELPAY_VERSION', '1.6.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__); From 200d28cce7df1afaf78321fe3a562ff04c26fdd7 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 2 Jan 2019 10:31:27 +0100 Subject: [PATCH 09/12] [fix](Woo-51) Submit total price with only 2 decimal (rounded) places if it has more. --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index cfb2f84..2b323cc 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -307,7 +307,7 @@ protected function setBasket($order_id) $order = wc_get_order($order_id); $this->payMethod->getRequest()->basketData( $order_id, //order id - $order->get_total(), //cart amount + round($order->get_total(), 2), //cart amount 'EUR', // Currency code of this request $this->get_option('secret') // A secret passphrase from your application ); From e78b29a6c68f3b5b908750e15e63ebf8b8abed77 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Wed, 2 Jan 2019 10:52:17 +0100 Subject: [PATCH 10/12] [change](Woo-51) update Changelog. --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1bbeee..da6cc24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ ### Added: - Unique ID and Short ID now show up in Order Meta +### Change: +- Use different way to get the host url to ensure better compatibility +- Ensure that total price is only submitted with 2 decimal digits + +### Fixed: +- Set the correct customer ip for payment request + ## [1.5.0][1.5.0] ### Added: From 303a6aa6301068a427d8be0c4cc12f09956c04c3 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Tue, 29 Jan 2019 16:24:59 +0100 Subject: [PATCH 11/12] [fix](Woo-58/59) set currency dynamically. Improve behaviour for response error caused by missing redirect url. Adjust display of error msg in case of cc/dc. --- .../abstract-wc-heidelpay-iframe-gateway.php | 22 +++++++----- .../abstract-wc-heidelpay-payment-gateway.php | 35 +++++++++++++++++-- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php index eb768fd..ca6223a 100644 --- a/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php @@ -152,17 +152,21 @@ protected function getIFrame(WC_Order $order) $cssPath ); - $iFrame = '
'; - if ($this->payMethod->getResponse()->isSuccess()) { - $iFrame .= '
'; + $iFrame = ''; + + $response = $this->payMethod->getResponse(); + if ($response->isSuccess()) { + $iFrame = '' + . '
' + . '' + . '
'; } else { - $iFrame .= '
' . print_r($this->getErrorMessage(), 1) . '
'; - $this->paymentLog($this->payMethod->getResponse()->getError()); + $paymentError = $response->getError(); + $this->paymentLog($paymentError); + wc_print_notice($this->getErrorMessage(), 'error'); } - $iFrame .= ''; - $iFrame .= ''; return $iFrame; } diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 9f0b3e2..6fb5e83 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -27,9 +27,24 @@ abstract class WC_Heidelpay_Payment_Gateway extends WC_Payment_Gateway { + /** + * @var \Heidelpay\PhpPaymentApi\PaymentMethods\BasicPaymentMethodTrait $payMethod + */ public $payMethod; + + /** + * @var string $bookingAction + */ public $bookingAction; + + /** + * @var string $name + */ protected $name; + + /** + * @var MessageCodeMapper $messageMapper + */ protected $messageMapper; public function __construct() @@ -264,7 +279,7 @@ protected function setAsync() { $this->payMethod->getRequest()->async( $this->getLanguage(), // Language code for the Frame - get_home_url() . '/wc-api/' . strtolower(get_class($this)) + $this->getResponeUrl() ); } @@ -310,10 +325,9 @@ protected function setBasket($order_id) $this->payMethod->getRequest()->basketData( $order_id, //order id round($order->get_total(), 2), //cart amount - 'EUR', // Currency code of this request + $order->get_currency(), // Currency code of this request $this->get_option('secret') // A secret passphrase from your application ); - } /** @@ -518,6 +532,13 @@ public function callback_handler() if (!empty($_POST)) { $response = new WC_Heidelpay_Response(); $response->init($_POST, $this->get_option('secret')); + } else { + // Add Error Msg, debug log and redirect to cart. + $this->addPaymentError($this->getErrorMessage()); + 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.'); + wp_redirect(wc_get_cart_url()); } exit(); } @@ -622,4 +643,12 @@ protected function getBookingSelection() 'default' => 'DB' ); } + + /** + * @return string + */ + protected function getResponeUrl() + { + return get_home_url() . '/wc-api/' . strtolower(get_class($this)); + } } From ae862f1b9075fd54adab258466dc512eeeaab811 Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Thu, 31 Jan 2019 13:03:22 +0100 Subject: [PATCH 12/12] [fix](Woo-58/59) set context for callback log to heidelpay. --- includes/abstracts/abstract-wc-heidelpay-payment-gateway.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php index 6fb5e83..e82cb2f 100644 --- a/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php +++ b/includes/abstracts/abstract-wc-heidelpay-payment-gateway.php @@ -536,8 +536,9 @@ public function callback_handler() // Add Error Msg, debug log and redirect to cart. $this->addPaymentError($this->getErrorMessage()); 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.'); + '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')); wp_redirect(wc_get_cart_url()); } exit();