protected function getReference(array $response)
    {
        $payments = Arr::get($response, 'payments');

        if (!$payments) {
            return Arr::get($response, 'preference_id');
        }

        $lastPayment = Arr::last($payments);

        return Arr::get($lastPayment, 'id');
    }
protected function getReference(array $response)
    {
        $payments = Arr::get($response, 'payments');

        if (!$payments) {
            return Arr::get($response, 'preference_id');
        }

        $lastPayment = Arr::last($payments);

        return Arr::get($lastPayment, 'id');
    }
protected function getReference ( array $ response ) { $ payments = Arr :: get ( $ response , 'payments' ) ; if ( ! $ payments ) { return Arr :: get ( $ response , 'preference_id' ) ; } $ lastPayment = Arr :: last ( $ payments ) ; return Arr :: get ( $ lastPayment , 'id' ) ; }
Get MercadoPago authorization.

@param array $response

@return string|null
Get MercadoPago authorization .