-
| I'm using version "bavix/laravel-wallet": "^7.3" I'm using code like this to purchase product  | 
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            rez1dent3
          
      
      
        Apr 1, 2024 
      
    
    Replies: 1 comment 1 reply
-
| Hello. The package architecture is built around integer. Non-float methods are called inside payments. This means that in this method you must specify the cost in int depending on your business processes. For example, if you are sure that all wallets will have decimal places =2, then you can multiply the amount by 100. Example: public function getAmountProduct(Customer $customer): float
{
//    return 5; // 0.05
//    return 50; // 0.5 
//    return 500; // 5  
    return 555; // 5.55 
} | 
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        amit-eps
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Hello. The package architecture is built around integer. Non-float methods are called inside payments. This means that in this method you must specify the cost in int depending on your business processes. For example, if you are sure that all wallets will have decimal places =2, then you can multiply the amount by 100.
Example: