-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Fix payment in connect mode #9204
Conversation
I know that it's not an optimal fix but it's functionnal for dolibarr 8.0.0 release
fix for V8 release and optimal functionnality with connect mode
htdocs/stripe/class/stripe.class.php
Outdated
} | ||
|
||
$metadata = array( | ||
"dol_id" => "" . $item . "", | ||
"dol_type" => "" . $origin . "", | ||
"dol_thirdparty_id" => "" . $societe->id . "", | ||
"FULLTAG" => $description, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding FULLTAG ? We already have "dol_type" (saying it is order or invoice) and "dol_id" giving id of order or invoice.
FULLTAG was introduced for payment mode that manage only 1 param to be able to provide several data in 1 string, but with stripe, we already have structured data that we can manage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because page with list of payment use it but we can change this other page and pass.
htdocs/stripe/class/stripe.class.php
Outdated
@@ -396,16 +398,19 @@ public function createPaymentStripe($amount, $currency, $origin, $item, $source, | |||
$charge = \Stripe\Charge::create(array( | |||
"amount" => "$stripeamount", | |||
"currency" => "$currency", | |||
// "statement_descriptor" => " ", | |||
"capture" => true, | |||
"statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($customer->name), 6, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1), // 22 chars that appears on bank receipt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is recommended by Stripe to add the seller business name so customer know who he paid. Otherwise, customer has no chance to know which companies he paid and he complain to its bank to be refunded, and this make Stripe to not refund moneys to seller.
So i suggest to put instead
"statement_descriptor" => dol_trunc(dol_trunc(dol_string_unaccent($mysoc->name), 6, 'right', 'UTF-8', 1).' '.$description, 22, 'right', 'UTF-8', 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done ;-)
htdocs/stripe/class/stripe.class.php
Outdated
"source" => "$source", | ||
"customer" => "$customer" | ||
); | ||
if ($conf->entity>1 && $fee>0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why using conf->entity > 1 ?
When using multicompany, company 1 is a company like other so like the company 2 or 3, so we should not have code that differs if we are company 1 or 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I define a new constant for define principal entity (principal entity can't have application fee without error of API)
define which entity must be use as principal with no fee and everything else (cf stripe API)
I know that it's not an optimal fix but it's functionnal for dolibarr 8.0.0 release