mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:37:33 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			29 lines
		
	
	
		
			652 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			652 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php namespace App\Models;
 | 
						|
 | 
						|
class AccountGateway extends EntityModel
 | 
						|
{
 | 
						|
    public function gateway()
 | 
						|
    {
 | 
						|
        return $this->belongsTo('Gateway');
 | 
						|
    }
 | 
						|
 | 
						|
    public function getCreditcardTypes()
 | 
						|
    {
 | 
						|
        $flags = unserialize(CREDIT_CARDS);
 | 
						|
        $arrayOfImages = [];
 | 
						|
 | 
						|
        foreach ($flags as $card => $name) {
 | 
						|
            if (($this->accepted_credit_cards & $card) == $card) {
 | 
						|
                $arrayOfImages[] = ['source' => asset($name['card']), 'alt' => $name['text']];
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        return $arrayOfImages;
 | 
						|
    }
 | 
						|
 | 
						|
    public function isPayPal() {
 | 
						|
        return $this->gateway_id == GATEWAY_PAYPAL_EXPRESS;
 | 
						|
    }
 | 
						|
}
 | 
						|
 |