class PaymentController extends Controller
{
public function index()
{
try {
$client = new Client();
$client->setAuth('__', 'test___s');
$payment = $client->createPayment(
array(
'amount' => array(
'value' => 100.0,
'currency' => 'RUB',
),
'confirmation' => array(
'type' => 'redirect',
'return_url' => 'http://bossphp.x:8080/#/',
),
'capture' => true,
'description' => 'Заказ №1',
'metadata' => array(
'order_id' => '37',
)
),
uniqid('', true)
);
} catch (\Exception $exception) {
// $payment->status = Payment::STATUS['error'];
// $payment->details = $exception->getMessage();
return [
'status' => 'error',
'message' => $exception->getMessage(),
];
}
}
}