public function approve()
	{

		$id = Input::get('id');
		$terminal = Terminal::whereUserId($this->userId())->first();
		$payment = Payment::find($id);
		if ($payment->term == $terminal->id) {

			$status = $payment->getPossibleStatus();

			if ($status) {
				$payment->status = $status;
				$payment->save();

				if ($payment->getPossibleStatus()) {
					return array(
						'next'  => true,
						'value' => 'Move to [' . $payment->getPossibleStatus() . ']',
						'status' => $payment->status,
					);
				}

			}

		}

		return array(
			'next' => false,
			'status' => $payment? $payment->status: null,
		);

	}
public function approve()
	{

		$id = Input::get('id');
		$terminal = Terminal::whereUserId($this->userId())->first();
		$payment = Payment::find($id);
		if ($payment->term == $terminal->id) {

			$status = $payment->getPossibleStatus();

			if ($status) {
				$payment->status = $status;
				$payment->save();

				if ($payment->getPossibleStatus()) {
					return array(
						'next'  => true,
						'value' => 'Move to [' . $payment->getPossibleStatus() . ']',
						'status' => $payment->status,
					);
				}

			}

		}

		return array(
			'next' => false,
			'status' => $payment? $payment->status: null,
		);

	}
public function approve ( ) { $ id = Input :: get ( 'id' ) ; $ terminal = Terminal :: whereUserId ( $ this -> userId ( ) ) -> first ( ) ; $ payment = Payment :: find ( $ id ) ; if ( $ payment -> term == $ terminal -> id ) { $ status = $ payment -> getPossibleStatus ( ) ; if ( $ status ) { $ payment -> status = $ status ; $ payment -> save ( ) ; if ( $ payment -> getPossibleStatus ( ) ) { return array ( 'next' => true , 'value' => 'Move to [' . $ payment -> getPossibleStatus ( ) . ']' , 'status' => $ payment -> status , ) ; } } } return array ( 'next' => false , 'status' => $ payment ? $ payment -> status : null , ) ; }
Approve one payment
Approve one payment