#Stripe Configuration

1 messages · Page 1 of 1 (latest)

split carbon
#

Hi, today i start my stripe configuration, but i have an issue, whats the endpoint url in the ctrl?Like this:

#

Ohh, succesfuly done, nothing

#

but, i have a new problem, 1 package work nice, but the more package no, have a 500 Server Error

cyan edgeBOT
split carbon
neat schooner
#

Hmm

#

A non-numeric value encountered

#

Can you please show product configuration

split carbon
neat schooner
#

I'll send you one change that will need to be made to the code to fix this error.

#

Wait a bit. I'm trying to find a change that needs to be made

neat schooner
#

I fixed this bug in the dev branch, but I can't find where exactly, lol

#

😅

split carbon
#

Thx

neat schooner
#

Do I understand correctly, the price of the product is more than 999?

neat schooner
#

If so, then my fix should fix your problem

split carbon
neat schooner
#
  1. Go to <ctrlpanel_root>/app/Models/ShopProduct.php
  2. Find
    public function getPriceAfterDiscount()
    {
        return number_format($this->price - ($this->price * PartnerDiscount::getDiscount() / 100), 2);
    }```
and replace it with
```php
    public function getPriceAfterDiscount()
    {
        $discountRate = PartnerDiscount::getDiscount() / 100;
        $discountedPrice = $this->price * (1 - $discountRate);
        return round($discountedPrice, 2);
    }```
3. Find
```php
    public function getTaxValue()
    {
        return number_format($this->getPriceAfterDiscount() * $this->getTaxPercent() / 100, 2);
    }```
and replace with
```php
    public function getTaxValue()
    {
        $taxValue = $this->getPriceAfterDiscount() * $this->getTaxPercent() / 100;
        return round($taxValue, 2);
    }```
4. Find
```php
    public function getTotalPrice()
    {
        return number_format($this->getPriceAfterDiscount() + $this->getTaxValue(), 2);
    }```
and replace with
```php
    public function getTotalPrice()
    {
        $total = $this->getPriceAfterDiscount() + $this->getTaxValue();
        return round($total, 2);
    }```
5. Save filу and test
split carbon
#

Daom

#

thanks, I'll test it tomorrow

neat schooner
#

OK, let me know if it helps or not

split carbon
neat schooner
#

Full file will look like this:

split carbon
#

Hmm, okey

neat schooner
#

This change will already be in 0.10, but for now it has to be added manually :(

split carbon
#

Ohh

#

Okey, np

neat schooner
#

👍

split carbon
#

Hi

#

Work, thx