keithbrink / affiliates-spark

An affiliates package for Laravel Spark that allows you to track referrals from affiliates and pay commission
MIT License
23 stars 7 forks source link

Issue with Currency #13

Closed ricoxor closed 4 years ago

ricoxor commented 4 years ago

Hello, I have an issue when someone try to subscribe through the affiliate link :

Object of class KeithBrink\AffiliatesSpark\Formatters\Currency could not be converted to int {"exception":"[object] (ErrorException(code: 0): Object of class KeithBrink\AffiliatesSpark\Formatters\Currency could not be converted to int at /var/www/vhosts/trafficshield.tools/httpdocs/vendor/keithbrink/affiliates-spark/src/Models/Affiliate.php:94)

The issue is on discountAmount() function.

I don't find a way to fix that. $this->plan->discount_amount is equal to 0.00 return new Currency($this->plan->discount_amount);