You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I upgraded the package from 6.x to 7.3.2 and did all the required changes that described in the documentation I get this error while apply forcetransfer function TypeError: Bavix\Wallet\Services\CastService::getModel(): Argument #1 ($object) must be of type object, null given, called in /var/www/html/NewISPCRM/ispcrm/vendor/bavix/laravel-wallet/src/Services/CastService.php on line 57
this is my code
current_company->forceTransfer($company, $limit, ['method' => $method, 'description' => 'Add limit', 'action' => 'Add limit', 'old_balance' => $current_company->balance, "to_company_old_balance" => $to_company_old_balance, 'payment_method' => $method, 'reference_no' => $reference_no, 'comment' => $comment, 'type' => 'balance', "payment_status" => $payment_collected, "added_by" => auth()->user()->id]);
this code was working fine with the last version and this is my company models looks like
class Company extends Model implements Wallet,Customer,HasMedia
{ use BelongsToTenants;
use InteractsWithMedia;
use CanPay ;
use SoftDeletes;
use \RecursiveRelationships\Traits\HasRecursiveRelationships;
use HasAddress;
use HasContact;
use HasRazorpay;
use HasWallet;
}
if I changed the code in vendor/bavix/laravel-wallet/src/Services/CastService.php in getholder function and added return $object it working and the transaction is done
public function getHolder($object): Model
{ return $object;
return $this->getModel($object instanceof WalletModel ? $object->holder : $object);
}
Server:
php version: [ 8.1]
database: [ mysql 8.0]
wallet version [7.3.2]
cache lock: [redis]
cache wallets: [redis]
The text was updated successfully, but these errors were encountered:
After I upgraded the package from 6.x to 7.3.2 and did all the required changes that described in the documentation I get this error while apply forcetransfer function
TypeError: Bavix\Wallet\Services\CastService::getModel(): Argument #1 ($object) must be of type object, null given, called in /var/www/html/NewISPCRM/ispcrm/vendor/bavix/laravel-wallet/src/Services/CastService.php on line 57
this is my code
current_company->forceTransfer($company, $limit, ['method' => $method, 'description' => 'Add limit', 'action' => 'Add limit', 'old_balance' => $current_company->balance, "to_company_old_balance" => $to_company_old_balance, 'payment_method' => $method, 'reference_no' => $reference_no, 'comment' => $comment, 'type' => 'balance', "payment_status" => $payment_collected, "added_by" => auth()->user()->id]);
this code was working fine with the last version and this is my company models looks like
if I changed the code in vendor/bavix/laravel-wallet/src/Services/CastService.php in getholder function and added return $object it working and the transaction is done
Server:
The text was updated successfully, but these errors were encountered: