/** * Включение/отключение автооплаты. */ public function autopay() { $api = new Api(); $currentCard = ''; if (Input::has('autopay')) { $paymentId = Input::has('payment_id') ? Input::get('payment_id') : null; $card = PaymentCloud::autopayEnable($api->id(), $paymentId); if ($card) { $currentCard = '<i class="fa fa-credit-card"></i> ' . $card['card_type'] . ' ***' . substr($card['card_pan'], -4); } } else { PaymentCloud::autopayDisable($api->id()); $currentCard = ''; } return Response::json(['currentCard' => $currentCard]); }