Skip to content

Commit

Permalink
Merge branch '1.1.1-RC1' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanPetakNeuralab committed Mar 26, 2024
2 parents ecc89d1 + 8010398 commit fd7b2e1
Show file tree
Hide file tree
Showing 98 changed files with 1,723 additions and 4,084 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": "^7.2",
"chillerlan/php-qrcode": "^3.4"
"php": "^8.0",
"chillerlan/php-qrcode": "^4.4"
}
}
81 changes: 59 additions & 22 deletions composer.lock

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

12 changes: 3 additions & 9 deletions includes/core/class-kekspay-connector.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@
*/
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 function get_default_args( $body ) {
private static function get_default_args( $body ) {
$encoded_body = wp_json_encode( $body );

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

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

$response = wp_safe_remote_post( Kekspay_Data::get_kekspay_api_base() . 'keksrefund', $this->get_default_args( $body ) );
$response = wp_safe_remote_post( Kekspay_Data::get_kekspay_api_base() . 'keksrefund', self::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: 2 additions & 3 deletions includes/core/class-kekspay-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public function __construct() {

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

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

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

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

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

}
Expand Down
1 change: 1 addition & 0 deletions includes/core/class-kekspay-sell.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ 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 build",
"description": "KEKS Pay assets 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.2
Stable tag: 1.1.0
Requires PHP: 7.4
Stable tag: 1.1.0-alpha1
License: GPL v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down
1 change: 0 additions & 1 deletion vendor/chillerlan/php-qrcode/.github/FUNDING.yml

This file was deleted.

55 changes: 0 additions & 55 deletions vendor/chillerlan/php-qrcode/.github/workflows/tests.yml

This file was deleted.

5 changes: 0 additions & 5 deletions vendor/chillerlan/php-qrcode/.gitignore

This file was deleted.

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

5 changes: 0 additions & 5 deletions vendor/chillerlan/php-qrcode/.scrutinizer.yml

This file was deleted.

0 comments on commit fd7b2e1

Please sign in to comment.