Skip to content

Instantly share code, notes, and snippets.

View kosatyi's full-sized avatar
🎯
Focusing

Stepan Kosatyi kosatyi

🎯
Focusing
View GitHub Profile
define('FONDY_MERCHANT_ID',0000000000);
define('FONDY_SECRET_KEY','1829381923919023918239819238');
add_action( 'rest_api_init', function () {
register_rest_route( 'v1', '/checkout', [
'methods' => 'POST',
'callback' => 'coreicon_v1_checkout',
]);
});
function $ipspReady(success, failure) {
var win = window, doc = document, name = '$ipsp', tag = '$ipspScriptTag', head, script,
url = 'https://api.fondy.eu/static_common/v1/checkout/ipsp.js';
if (name in win) return success(win[name]);
if (tag in win) {
script = win[tag];
} else {
head = doc.querySelector('head');
script = doc.createElement('script');
script.async = true;
@kosatyi
kosatyi / adsense.fallback.js
Last active January 11, 2021 14:18
Adsense fallback
(function(callback){
var findParent = function (elem, selector) {
if( !elem ) return null;
var parent = elem.parentNode;
if (parent.matches(selector)) return parent;
return findParent(parent, selector);
}
var findQueryFrame = function(id){
var selector = '[data-google-query-id="'+id+'"]';
var frame = document.querySelector(selector);
@kosatyi
kosatyi / checkout.css
Last active November 10, 2017 12:09
Fondy Checkout Example #1
.checkout-form {
max-width:325px;
margin:0 auto;
}
.checkout-form-container{
border:1px solid #ccc;
}
.checkout-form .error-wrapper{
padding:.7em;
color:#000000;
@kosatyi
kosatyi / Signature.php
Created August 4, 2017 11:32
Helper class to generate Fondy signature and validate signed response parameters.
<?php
namespace Ipsp;
/**
* Class Signature
* @package Ipsp
*/
class Signature {
/**
* @var
*/