mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:04:30 -04:00
Merge pull request #6643 from beganovich/v5-sofort-fixes
Fixes for webhook accepting
This commit is contained in:
commit
d6e8c66f1c
@ -85,7 +85,7 @@ class SOFORT
|
|||||||
'gateway_type_id' => GatewayType::SOFORT,
|
'gateway_type_id' => GatewayType::SOFORT,
|
||||||
];
|
];
|
||||||
|
|
||||||
// $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
$this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||||
|
|
||||||
SystemLogger::dispatch(
|
SystemLogger::dispatch(
|
||||||
['response' => $this->stripe->payment_hash->data, 'data' => $data],
|
['response' => $this->stripe->payment_hash->data, 'data' => $data],
|
||||||
|
@ -436,33 +436,28 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
$payment->save();
|
$payment->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} elseif ($request->type === 'source.chargeable') {
|
||||||
elseif($request->type === 'source.chargeable'){
|
|
||||||
|
|
||||||
$this->init();
|
$this->init();
|
||||||
|
|
||||||
|
foreach ($request->data as $transaction) {
|
||||||
$charge = \Stripe\Charge::create([
|
$charge = \Stripe\Charge::create([
|
||||||
'amount' => $request->amount,
|
'amount' => $request->data['object']['amount'],
|
||||||
'currency' => $request->currency,
|
'currency' => $request->data['object']['currency'],
|
||||||
'source' => $request->id,
|
'source' => $request->data['object']['id'],
|
||||||
], $this->stripe_connect_auth);
|
], $this->stripe_connect_auth);
|
||||||
|
|
||||||
if($charge->captured)
|
if ($charge->captured) {
|
||||||
{
|
$payment = Payment::query()
|
||||||
$this->setClientFromCustomer($request->customer);
|
->where('transaction_reference', $transaction['id'])
|
||||||
|
->where('company_id', $request->getCompany()->id)
|
||||||
$data = [
|
->first();
|
||||||
'payment_method' => $request->id,
|
|
||||||
'payment_type' => PaymentType::SOFORT,
|
|
||||||
'amount' => $this->convertFromStripeAmount($request->amount, $this->client->currency()->precision, $this->client->currency()),
|
|
||||||
'transaction_reference' => $charge->id,
|
|
||||||
'gateway_type_id' => GatewayType::SOFORT,
|
|
||||||
];
|
|
||||||
|
|
||||||
$payment = $this->createPayment($data, Payment::STATUS_COMPLETED);
|
|
||||||
|
|
||||||
|
if ($payment) {
|
||||||
|
$payment->status_id = Payment::STATUS_COMPLETED;
|
||||||
|
$payment->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json([], 200);
|
return response()->json([], 200);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user