Skip to content

Commit

Permalink
Revert "Merge branch '1.1.1-RC1' into dev"
Browse files Browse the repository at this point in the history
This reverts commit fd7b2e1, reversing
changes made to ecc89d1.
  • Loading branch information
IvanPetakNeuralab committed Apr 29, 2024
1 parent fd7b2e1 commit cc14067
Show file tree
Hide file tree
Showing 98 changed files with 4,084 additions and 1,723 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"php": "^8.0",
"chillerlan/php-qrcode": "^4.4"
"php": "^7.2",
"chillerlan/php-qrcode": "^3.4"
}
}
81 changes: 22 additions & 59 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions includes/core/class-kekspay-connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@
*/
class Kekspay_Connector {

/**
* Class constructor.
*/
public function __construct() {
}

/**
* Return an array for default args or false if failed to JSON encode.
*
* @param array $body
* @return array|false
*/
private static function get_default_args( $body ) {
private function get_default_args( $body ) {
$encoded_body = wp_json_encode( $body );

if ( ! $encoded_body ) {
Expand Down Expand Up @@ -46,7 +52,7 @@ private static function get_default_args( $body ) {
*
* @return array [ 'success' => bool, 'message' => string ]
*/
public static function refund( $order, $amount ) {
public function refund( $order, $amount ) {
if ( 'erste-kekspay-woocommerce' !== $order->get_payment_method() ) {
return;
}
Expand Down Expand Up @@ -81,7 +87,7 @@ public static function refund( $order, $amount ) {

$wc_price = wc_price( $amount, array( 'currency' => $currency ) );

$response = wp_safe_remote_post( Kekspay_Data::get_kekspay_api_base() . 'keksrefund', self::get_default_args( $body ) );
$response = wp_safe_remote_post( Kekspay_Data::get_kekspay_api_base() . 'keksrefund', $this->get_default_args( $body ) );
Kekspay_Logger::log( 'Request sent to refund order ' . $order->get_id() . ' (' . $amount . $order->get_currency() . ') via KEKS Pay.', 'info' );

if ( is_wp_error( $response ) ) {
Expand Down
5 changes: 3 additions & 2 deletions includes/core/class-kekspay-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public function __construct() {

$this->supports = array( 'products', 'refunds' );

$this->sell = new Kekspay_Sell();
$this->connector = new Kekspay_Connector();
$this->sell = new Kekspay_Sell();

$this->title = esc_attr( Kekspay_Data::get_settings( 'title' ) );

Expand Down Expand Up @@ -216,7 +217,7 @@ public function process_refund( $order_id, $amount = null, $reason = '' ) {
return false;
}

return Kekspay_Connector::refund( $order, $amount );
return $this->connector->refund( $order, $amount );
}

}
Expand Down
1 change: 0 additions & 1 deletion includes/core/class-kekspay-sell.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function get_sell_url( $order ) {
*/
public function get_sell_qr( $order ) {
$data = Kekspay_Data::get_sell_data( $order );

try {
$options = new QROptions(
array(
Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "keks-pay-for-woocommerce",
"name": "KEKS Pay for WooCommerce",
"version": "1.0.0",
"description": "KEKS Pay assets build",
"description": "KEKS Pay build",
"private": true,
"devDependencies": {
"copy-webpack-plugin": "^11.0.0",
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: erstebank
Tags: kekspay, woocommerce, gateway, payment
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 7.4
Stable tag: 1.1.0-alpha1
Requires PHP: 7.2
Stable tag: 1.1.0
License: GPL v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
1 change: 1 addition & 0 deletions vendor/chillerlan/php-qrcode/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ko_fi: codemasher
55 changes: 55 additions & 0 deletions vendor/chillerlan/php-qrcode/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
# https://github.com/localheinz/php-library-template/blob/master/.github/workflows/continuous-integration.yml
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml

on:
- pull_request
- push

name: "Continuous Integration"

jobs:

tests:
name: "Unit Tests"
runs-on: ubuntu-latest

strategy:
matrix:
php-binary:
- php7.2
- php7.3
- php7.4

steps:
- name: "Checkout"
uses: actions/checkout@v1.1.0

- name: "Install dependencies with composer"
run: ${{ matrix.php-binary }} $(which composer) update --no-interaction --no-progress --no-suggest

- name: "Run unit tests with phpunit"
run: ${{ matrix.php-binary }} vendor/bin/phpunit --configuration=phpunit.xml --no-coverage


code-coverage:
name: "Code Coverage"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: actions/checkout@v1.1.0

- name: "Install locked dependencies with composer"
run: php7.4 $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Dump Xdebug filter with phpunit/phpunit"
run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --dump-xdebug-filter=.build/phpunit/xdebug-filter.php

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: php7.4 vendor/bin/phpunit --configuration=phpunit.xml --prepend=.build/phpunit/xdebug-filter.php

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: bash <(curl -s https://codecov.io/bash)
5 changes: 5 additions & 0 deletions vendor/chillerlan/php-qrcode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.build/*
.idea/*
vendor/*
composer.lock
*.phpunit.result.cache

This file was deleted.

5 changes: 5 additions & 0 deletions vendor/chillerlan/php-qrcode/.scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
filter:
excluded_paths:
- examples/*
- tests/*
- vendor/*

0 comments on commit cc14067

Please sign in to comment.