-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from reepay/pre-1.7.6
Update version to 1.7.6
- Loading branch information
Showing
8 changed files
with
184 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
/** | ||
* PE Santander gateway | ||
* | ||
* @package Reepay\Checkout\Gateways | ||
*/ | ||
|
||
namespace Reepay\Checkout\Gateways; | ||
|
||
use Reepay\Checkout\Frontend\Assets; | ||
|
||
defined( 'ABSPATH' ) || exit(); | ||
|
||
/** | ||
* Class PESantander | ||
* | ||
* @package Reepay\Checkout\Gateways | ||
*/ | ||
class PESantander extends ReepayGateway { | ||
/** | ||
* Logos | ||
* | ||
* @var array | ||
*/ | ||
public array $logos = array( | ||
'santander', | ||
); | ||
|
||
/** | ||
* Payment methods. | ||
* | ||
* @var array | ||
*/ | ||
public array $payment_methods = array( | ||
'pe_santander', | ||
); | ||
|
||
/** | ||
* PESantander constructor. | ||
*/ | ||
public function __construct() { | ||
$this->id = 'reepay_pe_santander'; | ||
$this->has_fields = true; | ||
$this->method_title = __( 'Billwerk+ Pay - Santander', 'reepay-checkout-gateway' ); | ||
$this->supports = array( | ||
'products', | ||
'refunds', | ||
); | ||
|
||
parent::__construct(); | ||
|
||
$this->apply_parent_settings(); | ||
|
||
if ( 'yes' === $this->enabled ) { | ||
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_additional_assets' ), 10000 ); | ||
} | ||
} | ||
|
||
/** | ||
* Additional gateway assets | ||
*/ | ||
public function enqueue_additional_assets() { | ||
wp_add_inline_script( | ||
Assets::SLUG_CHECKOUT_JS, | ||
" | ||
(function($) { | ||
$(document).ready(function() { | ||
let payment_type = WC_Gateway_Reepay_Checkout.payment_type; | ||
setTimeout(function() { | ||
$('[name=radio-control-wc-payment-method-options], [name=payment_method]').each(function() { | ||
if( '" . $this->id . "' === $(this).val() && $(this).is(':checked') ){ | ||
WC_Gateway_Reepay_Checkout.payment_type = 'WINDOW'; | ||
} | ||
}); | ||
}, 3000); | ||
// Script for WC Block | ||
$('body').on('click', '[name=radio-control-wc-payment-method-options]', function() { | ||
let option_value = $(this).val(); | ||
if( '" . $this->id . "' === option_value ){ | ||
WC_Gateway_Reepay_Checkout.payment_type = 'WINDOW'; | ||
}else{ | ||
WC_Gateway_Reepay_Checkout.payment_type = payment_type; | ||
} | ||
}); | ||
// Script for short code check out | ||
$('body').on('click', '.wc_payment_method', function() { | ||
let option_value = $(this).find('.input-radio').val(); | ||
if( '" . $this->id . "' === option_value ){ | ||
WC_Gateway_Reepay_Checkout.payment_type = 'WINDOW'; | ||
}else{ | ||
WC_Gateway_Reepay_Checkout.payment_type = payment_type; | ||
} | ||
}); | ||
}); | ||
})(jQuery); | ||
" | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters