mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-16 18:34: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");
|
nlog("Searching by payment hash");
|
||||||
|
|
||||||
$payment_hash_id = $apiResponse->getPayment()->getReferenceId() ?? false;
|
$body = json_decode($apiResponse->getBody());
|
||||||
$square_payment = $apiResponse->getPayment()->jsonSerialize();
|
|
||||||
|
$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 = PaymentHash::query()->where('hash', $payment_hash_id)->firstOrFail();
|
||||||
|
|
||||||
$payment_hash->data = array_merge((array) $payment_hash->data, (array)$square_payment);
|
$payment_hash->data = array_merge((array) $payment_hash->data, (array)$square_payment);
|
||||||
|
@ -120,7 +120,7 @@ class AutoBillInvoice extends AbstractService
|
|||||||
/* Build payment hash */
|
/* Build payment hash */
|
||||||
|
|
||||||
$payment_hash = PaymentHash::create([
|
$payment_hash = PaymentHash::create([
|
||||||
'hash' => Str::random(64),
|
'hash' => Str::random(32),
|
||||||
'data' => [
|
'data' => [
|
||||||
'amount_with_fee' => $amount + $fee,
|
'amount_with_fee' => $amount + $fee,
|
||||||
'invoices' => [
|
'invoices' => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user