baibaratsky / php-wmsigner Goto Github PK
View Code? Open in Web Editor NEWWebMoney Signer
License: Other
WebMoney Signer
License: Other
Hi. I am getting this warning when running my composer install command
Class baibaratsky\WebMoney\SignerTest located in ./vendor/baibaratsky/php-wmsigner/tests/SignerTest.php does not comply with psr-4 autoloading standard. Skipping.
Решено!
Hello,
Thank you for this amazing library,
Every few days (not always) I have something like this logged into error_logs:
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and body /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): </body> /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 7: parser error : Opening and ending tag mismatch: body line 3 and html /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): </html> /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 8: parser error : Premature end of data in tag html line 1 /path/w_money/Api/X/X9/Response.php 24
ERROR - 2016-11-26 02:48:02 --> Severity: error --> Exception: String could not be parsed as XML /path/w_money/Api/X/X9/Response.php 24
Another Example
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 1: parser error : Space required after the Public Identifier /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/str /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 3: parser error : Opening and ending tag mismatch: META line 3 and HEAD /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD> /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 6: parser error : Opening and ending tag mismatch: hr line 5 and BODY /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): </BODY></HTML> /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 6: parser error : Opening and ending tag mismatch: BODY line 4 and HTML /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): </BODY></HTML> /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): ^ /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 7: parser error : Premature end of data in tag HEAD line 2 /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: Warning --> SimpleXMLElement::__construct(): Entity: line 7: parser error : Premature end of data in tag HTML line 2 /path/w_money/Api/X/X2/Response.php 63
ERROR - 2016-11-22 15:28:24 --> Severity: error --> Exception: String could not be parsed as XML /path/w_money/Api/X/X2/Response.php 63
Is this an issue I should be worried about?
Запустил php-wmsigner по примеру в описании и получил следующую ошибку:
Hash check failed. Key file seems corrupted.
Но файл ключей точно не поврежден, WebMoney Keeper WinPro принимает его без ошибок.
Может ли проблема заключаться в среде запуска?
Пример запускался на Win7 + OpenServer
If you have your key not in a file, it is possible to provide a key as a string:
$signer = new Signer('wmid', $yourKeyData, 'password');
Подскажите как правильно преобразовать key.kwm в строку для $yourKeyData ? Пытаюсь через base64 - ошибка Key file not found
Hi
there is no documentation on how to create key or keyfile in webmoney
Hash check failed. Key file seems to be corrupted.
`use baibaratsky\WebMoney\WebMoney;
use Illuminate\Database\Eloquent\Model;
use baibaratsky\WebMoney\Api\X\X2\Request;
use baibaratsky\WebMoney\Request\Requester\CurlRequester;
use baibaratsky\WebMoney\Signer;
use baibaratsky\WebMoney\Api\X\X2;
class WebMoneyService extends Model
{
private $service;
public function __construct()
{
}
public function payment()
{
$webMoney = new WebMoney(new CurlRequester);
$request = new Request;
$request->setSignerWmid('wmid');
$request->setTransactionExternalId(1); // Unique ID of the transaction in your system
$request->setPayerPurse('YOUR PURSE');
$request->setPayeePurse('PAYEE PURSE');
$request->setAmount(10.23); // Payment amount
$request->setDescription('Test payment');
$request->sign(new Signer('wmid', app_path() . '/certs/certificate.p12', 'pass'));
return $request;
}`
Using Laravel 5.4, Homestead on Vagrant, Ubuntu x64.
Tryied to reissue certeficate, no luck.
Как можно получить строку из файла key.kwm?
Сделай возможность указывать не путь до файла, а уже саму строку чтобы в конфиге можно было хранить всю нужную инфу по wmid, а не доп. файлы держать.
my mode is webpro and the code is:
$request->lightAuth('certificate.p12', str_random(5), '');
what does this error mean?
Error while performing request (could not load PEM client certificate, OpenSSL error error:0909006C:PEM routines:get_name:no start line, (no key found, wrong pass phrase, or wrong file format?))
Ошибка при проверке key-файла.
Signer.php xorStrings:149
$modifierLength = mb_strlen($modifier, 'windows-1251'); //strlen($modifier);
Signer.php xorStrings:152
while ($i < mb_strlen($subject, 'windows-1251')) { //while ($i < strlen($subject)) {
Не работало в кодировке utf-8 при mbstring.func_overload, возможно нужно добавить в master явное указание кодировки/переписать все строковые функции через mb_*
Сделал полное восстановление kwm-файла, но проверка суммы безуспешная.
В чем может быть проблема?
Help me this is my code. key file same folder with index.php
""""""""""""
require 'vendor/autoload.php';
use baibaratsky\WebMoney\Signer;
Flight::route('/', function(){
$test = file_get_contents('test.kwm');
$signer = new Signer('wmid', $test, '12345678');
$data = 'Data to be signed';
$signature = $signer->sign($data);
echo "hello world! $signature";
});
Flight::start();
Если нет GMP, возникает ошибка:
PHP Fatal error: Maximum function nesting level of '100' reached, aborting! in /home/a/projects/webmon/php-wmsigner/Signer.php on line 193
PHP Stack trace:
PHP 1. {main}() /home/a/projects/webmon/sign.php:0
PHP 2. baibaratsky\WebMoney\Signer->__construct() /home/a/projects/webmon/sign.php:4
PHP 3. baibaratsky\WebMoney\Signer->initSignVariables() /home/a/projects/webmon/php-wmsigner/Signer.php:41
PHP 4. baibaratsky\WebMoney\Signer::reverseToDecimal() /home/a/projects/webmon/php-wmsigner/Signer.php:93
PHP 5. baibaratsky\WebMoney\Signer::hex2dec() /home/a/projects/webmon/php-wmsigner/Signer.php:166
PHP 6. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:182
PHP 7. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
PHP 8. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
PHP 9. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
.....
PHP 97. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
PHP 98. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
PHP 99. baibaratsky\WebMoney\Signer::hex2decBC() /home/a/projects/webmon/php-wmsigner/Signer.php:202
Hello. In the example there is a line which says:
$data = 'Data to be signed';
What is 'Data to be signed'? How should I make it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.