-
Notifications
You must be signed in to change notification settings - Fork 32
Andrei Baibaratsky edited this page Jan 27, 2015
·
6 revisions
require_once(__DIR__ . '/vendor/autoload.php'); // Require autoload file generated by composer
use baibaratsky\WebMoney;
$webMoney = new WebMoney\WebMoney(new WebMoney\Request\Requester\CurlRequester);
$request = new WebMoney\Api\X\X9\Request;
$request->setSignerWmid('YOUR WMID');
$request->setRequestedWmid('REQUESTED WMID');
$request->sign(new Signer('YOUR WMID', 'FULL PATH TO KEY FILE', 'KEY FILE PASSWORD'));
if ($request->validate()) {
/** @var WebMoney\Api\X\X9\Response $response */
$response = $webMoney->request($request);
if ($response->getReturnCode() === 0) {
echo $response->getPurseByName('Z000000000000')->getAmount();
}
}