mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-04 08:04:37 -04:00
Fixes for square autobill
This commit is contained in:
parent
bf93589607
commit
55f71a27c7
@ -134,8 +134,14 @@ class SquareWebhook implements ShouldQueue
|
||||
|
||||
nlog("Searching by payment hash");
|
||||
|
||||
$payment_hash_id = $apiResponse->getPayment()->getReferenceId() ?? false;
|
||||
$square_payment = $apiResponse->getPayment()->jsonSerialize();
|
||||
$body = json_decode($apiResponse->getBody());
|
||||
|
||||
$payment_hash_id = $body->payment->reference_id ?? false;
|
||||
$square_payment = $body->payment ?? false;
|
||||
|
||||
if(!$payment_hash_id)
|
||||
return;
|
||||
|
||||
$payment_hash = PaymentHash::query()->where('hash', $payment_hash_id)->firstOrFail();
|
||||
|
||||
$payment_hash->data = array_merge((array) $payment_hash->data, (array)$square_payment);
|
||||
|
@ -120,7 +120,7 @@ class AutoBillInvoice extends AbstractService
|
||||
/* Build payment hash */
|
||||
|
||||
$payment_hash = PaymentHash::create([
|
||||
'hash' => Str::random(64),
|
||||
'hash' => Str::random(32),
|
||||
'data' => [
|
||||
'amount_with_fee' => $amount + $fee,
|
||||
'invoices' => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user