Fix payment in connect mode

I know that it's not an optimal fix but it's functionnal for dolibarr 8.0.0 release
This commit is contained in:
ptibogxiv 2018-08-04 14:30:52 +02:00 committed by GitHub
parent e1877625a0
commit 3c15da9dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -425,19 +425,25 @@ class Stripe extends CommonObject
$fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
}
$charge = \Stripe\Charge::create(array(
"amount" => "$stripeamount",
"currency" => "$currency",
// "statement_descriptor" => " ",
"description" => "$description",
"metadata" => $metadata,
"source" => "$source",
"customer" => "$customer",
"application_fee" => "$fee"
), array(
"idempotency_key" => "$ref",
"stripe_account" => "$account"
));
$paymentarray = array(
"amount" => "$stripeamount",
"currency" => "$currency",
// "statement_descriptor" => " ",
"description" => "$description",
"metadata" => $metadata,
"source" => "$source",
"customer" => "$customer"
);
if ($conf->entity>1 && $fee>0)
{
$paymentarray["application_fee"] = $fee;
}
if ($societe->email && $usethirdpartyemailforreceiptemail)
{
$paymentarray["receipt_email"] = $societe->email;
}
$charge = \Stripe\Charge::create($paymentarray, array("idempotency_key" => "$ref","stripe_account" => "$account"));
}
if (isset($charge->id)) {}