From 6d967066e73c179a556afbcaebe7f43b39017154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20J=C3=B3=C5=BAwiak?= Date: Tue, 4 Apr 2017 17:10:49 +0200 Subject: [PATCH] Blik one click fixes Fixed register checkbox Updated composer version Changed sample seller data --- composer.json | 2 +- src/common/_js/blikHandler.js | 9 +++++++-- tests/initBlik.php | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 4a7c550..9cd9e91 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "library", "license": "LGPL-3.0", "description": "tpay.com library", - "version": "1.0.2", + "version": "1.0.3", "extra": [ { "engine": "PHP SDK" diff --git a/src/common/_js/blikHandler.js b/src/common/_js/blikHandler.js index 288a54e..b4c721e 100644 --- a/src/common/_js/blikHandler.js +++ b/src/common/_js/blikHandler.js @@ -10,7 +10,13 @@ function showT6() { document.getElementById("alias").style.visibility = "hidden"; } function checkRegister() { - register = document.getElementById("register").value; + var checkbox = document.getElementById("register"); + if (checkbox.checked = true) { + checkbox.value = 1; + } else { + checkbox.value = 0; + } + register = checkbox.value; } function showAliases() { var x = document.getElementById("blikSwitch"); @@ -51,7 +57,6 @@ function blikHandler() { } else if (attempt === 1) { var e = document.getElementById("blikSwitch"); var key = e.options[e.selectedIndex].value; - alert(key); ajax('aliasKey=' + key + '&title=' + title); setTimeout(function () { checkResponse(); diff --git a/tests/initBlik.php b/tests/initBlik.php index c375e4b..a9c967e 100644 --- a/tests/initBlik.php +++ b/tests/initBlik.php @@ -24,7 +24,7 @@ public function __construct() $this->tpayApi = new \tpay\TransactionAPI ( '158ae0714578f5ab76bf6c0374cb1508b98ece5d', - 'nvidia8800', + 'testtpay123', 25223, 'testtpay' ); @@ -61,10 +61,10 @@ public function create() $config = array( 'opis' => 'transakcja testowa api', 'kwota' => 1.00, - 'crc' => 'piotr', + 'crc' => 'test', 'kanal' => 64, 'nazwisko' => 'kowalski', - 'email' => 'piotr123.jozwiak@tpay.com', + 'email' => 'test@tpay.com', 'akceptuje_regulamin' => 1, ); $params['title'] = $this->tpayApi->create($config)['title']; @@ -111,4 +111,4 @@ private function getAlias() } -new OneClick(); \ No newline at end of file +new OneClick();