mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add square webhook tests
This commit is contained in:
parent
dfb19f9d4a
commit
fdd9501af6
@ -272,7 +272,7 @@ class SquareWebhook implements ShouldQueue
|
||||
|
||||
}
|
||||
else{
|
||||
nlog("Square Webhook - Payment not found: $payment_reference");
|
||||
nlog("Square Webhook - Payment not found: {$payment_reference}");
|
||||
nlog($apiResponse->getErrors());
|
||||
return null;
|
||||
}
|
||||
|
@ -386,6 +386,27 @@ class SquarePaymentDriver extends BaseDriver
|
||||
|
||||
}
|
||||
|
||||
public function testWebhook()
|
||||
{
|
||||
$this->init();
|
||||
|
||||
$body = new \Square\Models\TestWebhookSubscriptionRequest();
|
||||
$body->setEventType('payment.created');
|
||||
|
||||
//getsubscriptionid here
|
||||
|
||||
$api_response = $this->square->getWebhookSubscriptionsApi()->testWebhookSubscription('subscription_id0', $body);
|
||||
|
||||
if ($api_response->isSuccess()) {
|
||||
$result = $api_response->getResult();
|
||||
nlog($result);
|
||||
} else {
|
||||
$errors = $api_response->getErrors();
|
||||
nlog($errors);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function convertAmount($amount)
|
||||
{
|
||||
$precision = $this->client->currency()->precision;
|
||||
|
Loading…
x
Reference in New Issue
Block a user