-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the php-webmoney dependency error #63
Comments
Could you show your composer.json? |
|
I just downloaded and uploaded to my server, did not change anythings. |
It's my composer.json. Please show me one from your project root directory. |
sorry, I have not anything, I justed downloaed php-webmoney-master.zip file and uploaded to my server :( |
If you want to use Composer, you don’t have to upload any files from this repository. Please read the Composer docs to discover how to use it. To use the library without Composer, add |
thank you, I have added require calls for all the library files and tested X2 (transfer fund), I got the error: Request errors: - Array Can you help me ? I just want to using X2 to transfer fund to other purse. |
Could you attach your code please? |
yes, how to attach ? This form accept image file only. |
Just put your code in the message here. Please use markdown to highlight the code. |
<?
require_once('WebMoney.php');
require_once('Signer.php');
require_once('Request/Requester/CurlRequester.php');
require_once('Request/Requester/AbstractRequester.php');
require_once('Api/X/X2/Request.php');
require_once('Api/X/X2/Response.php');
use baibaratsky\WebMoney\WebMoney;
use baibaratsky\WebMoney\Signer;
use baibaratsky\WebMoney\Request\Requester\CurlRequester;
use baibaratsky\WebMoney\Api\X\X2;
$webMoney = new WebMoney(new CurlRequester);
$request = new X2\Request;
$request->setSignerWmid('removed');
$request->setPayerPurse('removed');
$request->setPayeePurse('removed');
$request->setAmount(0.01); // Payment amount
$request->setDescription('Test payment');
$request->setInvoiceId(0);
$request->sign(new Signer('removed', 'removed.kwm', 'removed'));
if ($request->validate()) {
/** @var X2\Response $response */
$response = $webMoney->request($request);
if ($response->getReturnCode() === 0) {
echo 'Successful payment, transaction id: ' . $response->getTransactionId();
} else {
echo 'Payment error: ' . $response->getReturnDescription();
}
} else {
echo 'Request errors: ' . PHP_EOL;
print_r ($request->getErrors());
foreach ($request->getErrors() as $error) {
echo ' - ' . $error . PHP_EOL;
}
}
?> |
the result is |
You have to set a required parameter $request->setTransactionExternalId($myTransactionId); // Unique ID of the transaction in your system
|
thank you for your support, I got new error: |
Does |
yes, payerPurse belong to signerWmid, I have tested X9 and it working file (show Purse's balance), but got error with X2 :(, the code is below
|
There was a small bug with the signature in the X2 request class. Please update the library and try again. |
yahoooooooooooo !!!!!!!!!!!!!!!!!! thank you very much, |
You’re welcome! |
Hic, it not working more, got the below error |
/**
* Set ID of the transaction in your system
*
* @param int $transactionExternalId should be a positive integer, unique for the WMID that signs the request
* It’s not allowed to perform two transactions with the same ID.
* The uniqueness of ID is verified at least for one year.
*/
public function setTransactionExternalId($transactionExternalId) |
what's your mean ? |
same problem here https://translate.google.com.vn/translate?hl=vi&sl=ru&tl=en&u=http%3A%2F%2Fcafe.owebmoney.ru%2Findex.php%3Fshowtopic%3D6206 it working if |
I thought you use the same value for |
I got error when Adding the php-webmoney dependency:
The text was updated successfully, but these errors were encountered: