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

Fix payment in connect mode #9204

Merged
merged 10 commits into from
Sep 2, 2018
Merged

Fix payment in connect mode #9204

merged 10 commits into from
Sep 2, 2018

Conversation

ptibogxiv
Copy link
Contributor

I know that it's not an optimal fix but it's functionnal for dolibarr 8.0.0 release

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
}

$metadata = array(
"dol_id" => "" . $item . "",
"dol_type" => "" . $origin . "",
"dol_thirdparty_id" => "" . $societe->id . "",
"FULLTAG" => $description,
Copy link
Member

@eldy eldy Aug 12, 2018

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.

Copy link
Contributor Author

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.

@@ -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
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done ;-)

"source" => "$source",
"customer" => "$customer"
);
if ($conf->entity>1 && $fee>0)
Copy link
Member

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.

Copy link
Contributor Author

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)

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Aug 12, 2018
@eldy eldy changed the base branch from 8.0 to develop September 2, 2018 15:24
@eldy eldy merged commit e081e84 into Dolibarr:develop Sep 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants