baibaratsky / php-webmoney

WebMoney API PHP Library
Other
73 stars 32 forks source link

issue on interface x2 #125

Closed sahidul99 closed 10 months ago

sahidul99 commented 4 years ago

`<?Php require_once(DIR . '/vendor/autoload.php'); // Require autoload file generated by composer 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('');//my wmid $request->setTransactionExternalId(1347384738784); // Unique ID of the transaction in your system $request->setPayerPurse('');//z00000.. my purse $request->setPayeePurse('');//z0000.. receiver purse $request->setAmount(0.1); // Payment amount $request->setDescription('Test payment');

$request->sign(new Signer('my wmid', './key.kwm', 'pass'));

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 'issue here Request errors: ' . PHP_EOL; foreach ($request->getErrors() as $error) { echo ' - ' . $error . PHP_EOL; } } ?>`

I used this code and output error is 'Payment error: create error step=14'

arif7576 commented 4 years ago

$request->setTransactionExternalId(“Use random transaction I’d”)); //