Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #39 from heidelpay/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Ryouzanpaku authored Oct 13, 2020
2 parents 9d56020 + 0478495 commit 780b3bb
Show file tree
Hide file tree
Showing 133 changed files with 6,886 additions and 810 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
[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
22 changes: 10 additions & 12 deletions assets/js/creditCardFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,25 @@ 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
*/
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];
}
Expand All @@ -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);
}
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@
"authors": [
{
"name": "Daniel Kraut",
"email": "[email protected]"
"role": "Developer"
},
{
"name": "Florian Evertz",
"email": "[email protected]"
"role": "Developer"
},
{
"name": "David Owusu"
"name": "David Owusu",
"role": "Developer"
}
]
],
"support": {
"email": "[email protected]"
}
}
17 changes: 4 additions & 13 deletions includes/abstracts/abstract-wc-heidelpay-iframe-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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 . __(
Expand All @@ -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
*/
Expand Down
Loading

0 comments on commit 780b3bb

Please sign in to comment.