Skip to content

Commit

Permalink
Release 2.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed May 31, 2023
1 parent ce70732 commit 443ac7d
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 15 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/woo-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release Plugin
on:
push:
tags:
- '*'

jobs:
tag:
name: New release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup
env:
WORDPRESS_ORG_SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}
WHITELABEL: ${{ vars.WHITELABEL_NAME }}
FAQ_ENTRIES: ${{ vars.FAQ_ENTRIES }}
FEATURES: ${{ vars.FEATURES }}
run: |
echo $GITHUB_WORKSPACE
echo $WORDPRESS_ORG_SLUG
ls -ltrh
git clone https://github.com/squizlabs/PHP_CodeSniffer.git phpcs;
git clone -b master https://github.com/WordPress/WordPress-Coding-Standards.git wpcs;
cd phpcs;
./bin/phpcs --config-set installed_paths ../wpcs;
cd ../;
ls -ltrh
pwd
mkdir -p $GITHUB_WORKSPACE/build-woo/src;
rsync -r --exclude 'build-woo' --exclude 'wpcs' --exclude 'phpcs' --exclude '.git' --exclude '.github' --exclude '.travis.yml' --exclude 'README.md' . $GITHUB_WORKSPACE/build-woo/src;
perl -plne 'print "$ENV{'FEATURES'}" if(/== Installation ==/); print "$ENV{'FAQ_ENTRIES'}" if(/== Changelog ==/);' $GITHUB_WORKSPACE/build-woo/src/readme.txt > $GITHUB_WORKSPACE/build-woo/src/readme_mod.txt;
mv build-woo/src/readme_mod.txt build-woo/src/readme.txt;
mkdir build-woo/$WORDPRESS_ORG_SLUG;
rsync -r build-woo/src/ build-woo/$WORDPRESS_ORG_SLUG/;
- name: Zip & Sniff
env:
WORDPRESS_ORG_SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}
WHITELABEL: ${{ vars.WHITELABEL_NAME }}
run: |
ls -ltrh;
cd $GITHUB_WORKSPACE/build-woo/
zip -r $GITHUB_WORKSPACE/$WORDPRESS_ORG_SLUG.zip $WORDPRESS_ORG_SLUG;
rm -rf src/docs;
../phpcs/bin/phpcbf -n --standard=WordPress src/ --ignore=/src/$WHITELABEL-sdk || true;
../phpcs/bin/phpcs -n --standard=WordPress src/ --ignore=/src/$WHITELABEL-sdk || true;
- name: Upload binaries to Github release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ vars.WORDPRESS_ORG_SLUG }}.zip
asset_name: ${{ vars.WORDPRESS_ORG_SLUG }}
tag: ${{ github.ref }}

- name: WordPress Plugin Deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
with:
generate-zip: true
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
ASSETS_DIR: ${{ vars.WORDPRESS_ORG_SLUG }}/build-woo/src
SLUG: ${{ vars.WORDPRESS_ORG_SLUG }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc

## Documentation

* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.16/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html)

## Support

Expand All @@ -24,4 +24,4 @@ Support queries can be issued on the [PostFinance Checkout support site](https:/

## License

Please see the [license file](https://github.com/pfpayments/woocommerce/blob/2.1.16/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/2.1.17/LICENSE) for more information.
11 changes: 11 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -606,3 +606,14 @@ Tested against:
* [Tested Against] Woocommerce 7.7.0
* [Tested Against] PHP SDK 3.2.0

* [Features] Support of Wordpress 6.2.1
* [Features] Support of Wordpress 6.2.2
* [Features] Support of Woocommerce 7.7.1
* [BugFix] Fix the fatal error raised when using non-whitelabel payment method
* [BugFix] Fix the error raised when using the Coupon *Sign Up Fee % Discount*

* [Tested Against] PHP 8.0.28
* [Tested Against] Wordpress 6.2.0
* [Tested Against] Woocommerce 7.7.0
* [Tested Against] PHP SDK 3.2.0

2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/woocommerce/releases/tag/2.1.16/">
<a href="https://github.com/pfpayments/woocommerce/releases/tag/2.1.17/">
Source
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function get_settings() {
$settings = array(
array(
'links' => array(
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.16/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
'https://checkout.postfinance.ch/en-ch/user/signup' => __( 'Sign Up', 'woo-postfinancecheckout' ),
),
'type' => 'postfinancecheckout_links',
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-postfinancecheckout-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public static function check_version() {
public static function plugin_row_meta( $links, $file ) {
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
$row_meta = array(
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.16/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
);

return array_merge( $links, $row_meta );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ protected function create_product_line_items_from_order( WC_Order $order ) {
if ( $coupon_discount > 0 ) {
//there is some coupon discount applied
$amount = $amount_including_tax;
$discount = $amount_including_tax - $discount_including_tax - $coupon_discount;
$discount = abs($amount_including_tax - $discount_including_tax - $coupon_discount);
}

$line_item->setAmountIncludingTax( $this->round_amount( $amount, $currency ) );
Expand Down
10 changes: 7 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: customwebgmbh
Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing
Requires at least: 4.7
Tested up to: 6.2
Stable tag: 2.1.16
Stable tag: 2.1.17
License: Apache 2
License URI: http://www.apache.org/licenses/LICENSE-2.0

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

== Documentation ==

Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.16/docs/en/documentation.html).
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html).

== Support ==

Expand Down Expand Up @@ -56,7 +56,11 @@ Support queries can be issued on the [PostFinance Checkout support site](https:/
== Changelog ==


* [BugFix] Fix the thankyou page redirection issue
* [Features] Support of Wordpress 6.2.1
* [Features] Support of Wordpress 6.2.2
* [Features] Support of Woocommerce 7.7.1
* [BugFix] Fix the fatal error raised when using non-whitelabel payment method
* [BugFix] Fix the error raised when using the Coupon *Sign Up Fee % Discount*

* [Tested Against] PHP 8.0.28
* [Tested Against] Wordpress 6.2.0
Expand Down
14 changes: 8 additions & 6 deletions woocommerce-postfinancecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: PostFinance Checkout
* Plugin URI: https://wordpress.org/plugins/woo-postfinancecheckout
* Description: Process WooCommerce payments with PostFinance Checkout.
* Version: 2.1.16
* Version: 2.1.17
* License: Apache2
* License URI: http://www.apache.org/licenses/LICENSE-2.0
* Author: wallee AG
Expand Down Expand Up @@ -46,7 +46,7 @@ final class WooCommerce_PostFinanceCheckout {
*
* @var string
*/
private $version = '2.1.16';
private $version = '2.1.17';

/**
* The single instance of the class.
Expand Down Expand Up @@ -226,11 +226,13 @@ public function secure_redirect_order_confirmed($order_id) {
$wc_service_transaction = WC_PostFinanceCheckout_Service_Transaction::instance();
$sdk_service_transaction = new \PostFinanceCheckout\Sdk\Service\TransactionService(WC_PostFinanceCheckout_Helper::instance()->get_api_client());
$wc_transaction_info = WC_PostFinanceCheckout_Entity_Transaction_Info::load_by_order_id($order_id);
$state = $sdk_service_transaction->read(get_option(self::CK_SPACE_ID), $wc_transaction_info->get_transaction_id())->getState();

if ($state == \PostFinanceCheckout\Sdk\Model\TransactionState::CONFIRMED) {
wp_redirect($wc_service_transaction->get_payment_page_url(get_option(self::CK_SPACE_ID), $wc_transaction_info->get_transaction_id()));
exit;
if (property_exists($wc_transaction_info,'get_transaction_id')) {
$state = $sdk_service_transaction->read(get_option(self::CK_SPACE_ID), $wc_transaction_info->get_transaction_id())->getState();
if ($state == \PostFinanceCheckout\Sdk\Model\TransactionState::CONFIRMED) {
wp_redirect($wc_service_transaction->get_payment_page_url(get_option(self::CK_SPACE_ID), $wc_transaction_info->get_transaction_id()));
exit;
}
}
}

Expand Down

0 comments on commit 443ac7d

Please sign in to comment.