Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error After Upgrade from 6.x to 7.X #823

Closed
starking8b opened this issue Dec 29, 2023 · 2 comments · Fixed by #825
Closed

Error After Upgrade from 6.x to 7.X #823

starking8b opened this issue Dec 29, 2023 · 2 comments · Fixed by #825
Assignees
Labels
duplicate This issue or pull request already exists question Further information is requested upgrade

Comments

@starking8b
Copy link

starking8b commented Dec 29, 2023

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]
@starking8b starking8b added the question Further information is requested label Dec 29, 2023
@rez1dent3
Copy link
Member

@starking8b Hello. Duplicate #531 #500

You need to upgrade to 6.2.4, and then upgrade further.

https://bavix.github.io/laravel-wallet/#/upgrade-guide

@rez1dent3 rez1dent3 added duplicate This issue or pull request already exists upgrade labels Dec 29, 2023
@rez1dent3 rez1dent3 linked a pull request Dec 30, 2023 that will close this issue
@rez1dent3
Copy link
Member

Made changes to the documentation. An important point has been added, as it seems to me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists question Further information is requested upgrade
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants