Skip to content

Commit 0619f12

Browse files
Release 1.1.10
1 parent f5ae78f commit 0619f12

11 files changed

+120
-70
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ This repository contains the PostFinance Checkout WooCommerce plugin that enable
1313

1414
## Documentation
1515

16-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.9/docs/en/documentation.html)
16+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.10/docs/en/documentation.html)
1717

1818
## License
1919

20-
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/1.1.9/LICENSE) for more information.
20+
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/1.1.10/LICENSE) for more information.
2121

2222

2323

assets/js/frontend/checkout.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ jQuery(function($) {
174174
},
175175

176176
register_method : function(method_id, configuration_id, container_id) {
177+
if (typeof window.IframeCheckoutHandler == 'undefined') {
178+
this.payment_methods[method_id] = {
179+
height : 0
180+
};
181+
return;
182+
}
177183

178184
if (typeof this.payment_methods[method_id] != 'undefined'
179185
&& $('#' + container_id).find("iframe").length > 0) {

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@
7575

7676
* Fix - Issue in Checkout Javascript
7777

78+
= 1.1.10 - September 07, 2018 =
79+
80+
* Tweak - Fall back to payment page, if iframe can not be initialized
81+
7882
= 1.1.2 - May 22, 2018 =
7983

8084
* Fix - Issue with refunds

docs/en/documentation.html

Lines changed: 75 additions & 54 deletions
Large diffs are not rendered by default.

includes/admin/class-wc-postfinancecheckout-admin-settings-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function get_settings(){
145145
$settings = array(
146146
array(
147147
'links' => array(
148-
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.9/docs/en/documentation.html' => __('Documentation', 'woo-postfinancecheckout'),
148+
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.10/docs/en/documentation.html' => __('Documentation', 'woo-postfinancecheckout'),
149149
'https://www.postfinance-checkout.ch/user/signup' => __('Sign Up', 'woo-postfinancecheckout')
150150
),
151151
'type' => 'postfinancecheckout_links',

includes/class-wc-postfinancecheckout-gateway.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public function payment_fields(){
298298
parent::payment_fields();
299299
?>
300300

301-
<div id="payment-form-<?php echo $this->id?>"></div>
301+
<div id="payment-form-<?php echo $this->id?>"><input type="hidden" id="postfinancecheckout-iframe-possible-<?php echo $this->id?>" name="postfinancecheckout-iframe-possible-<?php echo $this->id?>" value="false" /></div>
302302
<div id="postfinancecheckout-method-configuration-<?php echo $this->id?>"
303303
class="postfinancecheckout-method-configuration" style="display: none;"
304304
data-method-id="<?php echo $this->id; ?>"
@@ -336,12 +336,13 @@ public function process_payment($order_id){
336336
$existing = WC_PostFinanceCheckout_Entity_Transaction_Info::load_by_order_id($order_id);
337337
if($existing->get_id() > 0 && $existing->get_state() != \PostFinanceCheckout\Sdk\Model\TransactionState::PENDING){
338338
WooCommerce_PostFinanceCheckout::instance()->add_notice(__('There was an issue, while processing your order. Please try again or use another payment method.', 'woo-postfinancecheckout'), 'error');
339+
$order = wc_get_order($order_id);
339340
$order->update_status( 'failed' );
340341
WC()->session->set('reload_checkout', true);
341342
return array(
342343
'result' => 'failure'
343344
);
344-
}
345+
}
345346
}
346347

347348
$order = wc_get_order($order_id);
@@ -354,11 +355,23 @@ public function process_payment($order_id){
354355
$order->delete_meta_data('_wc_postfinancecheckout_restocked');
355356

356357
$order->save();
358+
357359
$result =array(
358360
'result' => 'success',
359361
'postfinancecheckout' => 'true'
360362
);
363+
$no_iframe = isset($_POST['postfinancecheckout-iframe-possible-'.$this->id]) && $_POST['postfinancecheckout-iframe-possible-'.$this->id] == 'false';
364+
if($no_iframe){
365+
$result = array(
366+
'result' => 'success',
367+
'redirect' => $transaction_service->get_payment_page_url($transaction->getLinkedSpaceId(), $transaction->getId()).'&paymentMethodConfigurationId='.$this->get_payment_method_configuration()->get_configuration_id()
368+
);
369+
}
370+
361371
if($is_order_pay_endpoint){
372+
if($no_iframe){
373+
return $result;
374+
}
362375
wp_send_json( $result );
363376
exit;
364377
}

includes/class-wc-postfinancecheckout-migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ private static function parse_update_notice($content, $new_version){
260260
public static function plugin_row_meta( $links, $file ) {
261261
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
262262
$row_meta = array(
263-
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.9/docs/en/documentation.html" aria-label="' . esc_attr__('View Documentation', 'woo-postfinancecheckout') . '">' . esc_html__('Documentation', 'woo-postfinancecheckout') . '</a>',
263+
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.10/docs/en/documentation.html" aria-label="' . esc_attr__('View Documentation', 'woo-postfinancecheckout') . '">' . esc_html__('Documentation', 'woo-postfinancecheckout') . '</a>',
264264
);
265265

266266
return array_merge( $links, $row_meta );

includes/service/class-wc-postfinancecheckout-service-transaction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ public function get_javascript_url(){
100100
$transaction = $this->get_transaction_from_session();
101101
return $this->get_transaction_service()->buildJavaScriptUrl($transaction->getLinkedSpaceId(), $transaction->getId());
102102
}
103+
104+
/**
105+
* Returns the URL to PostFinance Checkout's JavaScript library that is necessary to display the payment form.
106+
*
107+
* @return string
108+
*/
109+
public function get_payment_page_url($space_id, $transaction_id){
110+
return $this->get_transaction_service()->buildPaymentPageUrl($space_id, $transaction_id);
111+
}
103112

104113
/**
105114
* Returns the transaction with the given id.

includes/webhook/class-wc-postfinancecheckout-webhook-transaction.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ protected function authorize(\PostFinanceCheckout\Sdk\Model\Transaction $transac
8686
$status = apply_filters('wc_postfinancecheckout_authorized_status', 'on-hold', $order);
8787
$order->add_meta_data("_postfinancecheckout_authorized", "true", true);
8888
$order->update_status($status);
89-
9089
if (isset(WC()->cart)) {
9190
WC()->cart->empty_cart();
9291
}
@@ -97,8 +96,7 @@ protected function waiting(\PostFinanceCheckout\Sdk\Model\Transaction $transacti
9796
if (!$order->get_meta('_postfinancecheckout_manual_check', true)) {
9897
do_action('wc_postfinancecheckout_completed', $transaction , $order);
9998
$status = apply_filters('wc_postfinancecheckout_completed_status', 'postf-waiting', $order);
100-
$order->update_status($status);
101-
99+
$order->update_status($status);
102100
}
103101
}
104102

readme.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: customwebgmbh
33
Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing
44
Requires at least: 4.7
55
Tested up to: 4.9
6-
Stable tag: 1.1.9
6+
Stable tag: 1.1.10
77
License: Apache 2
88
License URI: http://www.apache.org/licenses/LICENSE-2.0
99

@@ -23,7 +23,7 @@ To use this extension, a PostFinance Checkout account is required. Sign up on [P
2323

2424
== Documentation ==
2525

26-
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.9/docs/en/documentation.html).
26+
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/1.1.10/docs/en/documentation.html).
2727

2828
== Installation ==
2929

@@ -52,7 +52,6 @@ Additional documentation for this plugin is available [here](https://plugin-docu
5252
== Changelog ==
5353

5454

55-
= 1.1.9 - August 30, 2018 =
55+
= 1.1.10 - September 07, 2018 =
5656

57-
* Tweak - Settings descriptions
58-
* Doc - Improved documentation
57+
* Tweak - Fall back to payment page, if iframe can not be initialized

0 commit comments

Comments
 (0)