1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #7383 from beganovich/square-idempotency-key

Fixes for Square idempotency
This commit is contained in:
David Bomba 2022-04-22 11:32:43 +10:00 committed by GitHub
commit 917e846598
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -105,7 +105,7 @@ class CreditCard implements MethodInterface
$amount_money->setAmount($amount);
$amount_money->setCurrency($this->square_driver->client->currency()->code);
$body = new \Square\Models\CreatePaymentRequest($token, Str::random(32), $amount_money);
$body = new \Square\Models\CreatePaymentRequest($token, $request->idempotencyKey, $amount_money);
$body->setAutocomplete(true);
$body->setLocationId($this->square_driver->company_gateway->getConfigField('locationId'));

View File

@ -22,6 +22,7 @@
<input type="hidden" name="token">
<input type="hidden" name="sourceId" id="sourceId">
<input type="hidden" name="verificationToken" id="verificationToken">
<input type="hidden" name="idempotencyKey" value="{{ \Illuminate\Support\Str::uuid() }}">
</form>
<div class="alert alert-failure mb-4" hidden id="errors"></div>