Merge pull request #6450 from beganovich/v5-626

(v5) Mollie improvements
This commit is contained in:
Benjamin Beganović 2021-08-15 19:13:23 +02:00 committed by GitHub
commit b7f8485c53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class CreditCard
'transaction_reference' => $payment->id,
];
$payment_record = $this->mollie->createPayment($data, Payment::STATUS_COMPLETED);
$payment_record = $this->mollie->createPayment($data, $payment->status === 'paid' ? Payment::STATUS_COMPLETED : Payment::STATUS_PENDING);
SystemLogger::dispatch(
['response' => $payment, 'data' => $data],

View File

@ -273,6 +273,9 @@ class MolliePaymentDriver extends BaseDriver
public function processWebhookRequest(PaymentWebhookRequest $request)
{
// Allow app to catch up with webhook request.
sleep(2);
$validator = Validator::make($request->all(), [
'id' => ['required', 'starts_with:tr'],
]);

View File

@ -395,6 +395,9 @@ class StripePaymentDriver extends BaseDriver
public function processWebhookRequest(PaymentWebhookRequest $request)
{
// Allow app to catch up with webhook request.
sleep(2);
if ($request->type === 'charge.succeeded' || $request->type === 'source.chargeable') {
foreach ($request->data as $transaction) {
$payment = Payment::query()