and / liqpay-api
LiqPay API
Installs: 2 378
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.3
- lib-libxml: >=2.7.0
This package is auto-updated.
Last update: 2024-10-09 04:08:05 UTC
README
try { $api = $this->getAPI(); $xml = $api->getPaymentForCallback($request->request->all()); switch ($xml->status) { case 'success': $this->updateInvoice($xml->order_id, InvoiceDetail::STATUS_PAID); break; case 'wait_secure': $this->updateInvoice($xml->order_id, InvoiceDetail::STATUS_PROCESSING); break; default: $this->updateInvoice($xml->order_id, InvoiceDetail::STATUS_FAILURE); } } catch (\ErrorException $e) { /** @noinspection PhpUndefinedVariableInspection */ $xml = $api->lastXml; switch ($e->getCode()) { case API::ERROR_BAD_REQUEST: throw new NotFoundHttpException(); case API::ERROR_SIGNATURE_MISMATCH: if ($xml->order_id) { $this->getLogger()->warn('Signature mismatch for OrderDetail#id ' . $xml->order_id); } throw new BadRequestHttpException($e->getMessage()); default: throw $e; } }
$fields = $this->getAPI()->getFieldsForPayment( 100, API::CURRENCY_USD, $redirect, $callback, $orderDetail->getId(), 'Perevod polzovately "' . $orderDetail->getUserToPay()->getEmail() . '" ot polzovatelya "' . $orderDetail->getInvoice()->getUser()->getEmail() . '"', API::PAYWAY_LIQPAY | API::PAYWAY_CARD )
$api->sendToPhone('ORDER_1', '380661234567', '10', 'UAH', 'Payment description'); $balance = $api->viewBalance();