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); $fee = round($conf->global->STRIPE_APPLICATION_FEE_MINIMAL * 100);
} }
$charge = \Stripe\Charge::create(array( $paymentarray = array(
"amount" => "$stripeamount", "amount" => "$stripeamount",
"currency" => "$currency", "currency" => "$currency",
// "statement_descriptor" => " ", // "statement_descriptor" => " ",
"description" => "$description", "description" => "$description",
"metadata" => $metadata, "metadata" => $metadata,
"source" => "$source", "source" => "$source",
"customer" => "$customer", "customer" => "$customer"
"application_fee" => "$fee" );
), array( if ($conf->entity>1 && $fee>0)
"idempotency_key" => "$ref", {
"stripe_account" => "$account" $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)) {} if (isset($charge->id)) {}