mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Fixes for webhook accepting
This commit is contained in:
parent
99382a55b4
commit
69662cd4f7
@ -85,7 +85,7 @@ class SOFORT
|
||||
'gateway_type_id' => GatewayType::SOFORT,
|
||||
];
|
||||
|
||||
// $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||
$this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||
|
||||
SystemLogger::dispatch(
|
||||
['response' => $this->stripe->payment_hash->data, 'data' => $data],
|
||||
|
@ -436,33 +436,28 @@ class StripePaymentDriver extends BaseDriver
|
||||
$payment->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif($request->type === 'source.chargeable'){
|
||||
|
||||
} elseif ($request->type === 'source.chargeable') {
|
||||
$this->init();
|
||||
|
||||
$charge = \Stripe\Charge::create([
|
||||
'amount' => $request->amount,
|
||||
'currency' => $request->currency,
|
||||
'source' => $request->id,
|
||||
], $this->stripe_connect_auth);
|
||||
foreach ($request->data as $transaction) {
|
||||
$charge = \Stripe\Charge::create([
|
||||
'amount' => $request->data['object']['amount'],
|
||||
'currency' => $request->data['object']['currency'],
|
||||
'source' => $request->data['object']['id'],
|
||||
], $this->stripe_connect_auth);
|
||||
|
||||
if($charge->captured)
|
||||
{
|
||||
$this->setClientFromCustomer($request->customer);
|
||||
|
||||
$data = [
|
||||
'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 ($charge->captured) {
|
||||
$payment = Payment::query()
|
||||
->where('transaction_reference', $transaction['id'])
|
||||
->where('company_id', $request->getCompany()->id)
|
||||
->first();
|
||||
|
||||
if ($payment) {
|
||||
$payment->status_id = Payment::STATUS_COMPLETED;
|
||||
$payment->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return response()->json([], 200);
|
||||
|
Loading…
Reference in New Issue
Block a user