Esempio n. 1
0
 public function payFinish()
 {
     $api = new Api();
     $saveCard = false;
     $autopay = false;
     $message = '';
     if (Input::has('save_card')) {
         $saveCard = true;
     }
     if (Input::has('autopay')) {
         $autopay = true;
     }
     $lastPay = PaymentCloud::finishPay($api->id(), $saveCard, $autopay);
     if ($lastPay && $autopay) {
         $message = 'autopay_success';
     } elseif ($lastPay && $saveCard) {
         $message = 'card_saved';
     }
     return Response::json(['message' => $message]);
 }