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

Amount of credit slip #63

Open
Jorgemgm opened this issue Feb 22, 2023 · 2 comments
Open

Amount of credit slip #63

Jorgemgm opened this issue Feb 22, 2023 · 2 comments
Labels

Comments

@Jorgemgm
Copy link

We made the sale and received £11.93.
image

We made the full refund on Stripe on TB £11.93.
image

Automatically it made the Credit Slip of £5.94 and not £11.93.
image

The credit slip isn’t created with the amount of the full refund, the amount of the product and shipping, but only with the amount of the product.

The Credit Slip can use the amount refunded for a full or a partial refund.

@getdatakick getdatakick transferred this issue from thirtybees/thirtybees Feb 23, 2023
@getdatakick
Copy link
Contributor

Source of the bug is probably on line 491:

stripe/stripe.php

Lines 483 to 492 in 8d5274c

if (is_array($fullProductList) && !empty($fullProductList)) {
$productList = [];
$quantityList = [];
foreach ($fullProductList as $dbOrderDetail) {
$idOrderDetail = (int) $dbOrderDetail['id_order_detail'];
$productList[] = (int) $idOrderDetail;
$quantityList[$idOrderDetail] = (int) $dbOrderDetail['product_quantity'];
}
OrderSlip::createOrderSlip($order, $productList, $quantityList, $order->getShipping());
}

Method $order->geShipping() returns array of shipping records, not total shipping amount.

@getdatakick
Copy link
Contributor

Related to issue thirtybees/thirtybees#1385

On thirty bees 1.4 this issue should not be reproducible, because core now ignores invalid input (array) and uses shipping cost amount from order.

That does not mean this is not a bug in the module. We should pass proper data. In this case, we should probably pass true to indicate total shipping costs should be refunded. And also, we should use method OrderSlip::create instead this deprecated one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants