spacejewel-ipn-communication/public/index.php

75 lines
1.8 KiB
PHP
Raw Permalink Normal View History

2018-06-07 10:56:13 +00:00
<?php
require $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
2018-06-07 10:56:13 +00:00
$App = new \Slim\App([
"settings" =>
[
"displayErrorDetails" => true
]
]);
2018-06-07 10:56:13 +00:00
//TODO: rearrange endpoints
// detects the intent on the app's post load
$App->post
(
"/api/woocommerce/{authkey}/detectIntent",
Hookmanager::class, ':detectPayloadIntent'
);
// hooks into the EventSubscriptionCreated class, so that stuff can be done with it.
// the request is redirected by the detectIntent endpoint.
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionCreatead",
Hookmanager::class, ':EventSubscriptionCreatead'
2018-06-08 14:48:18 +00:00
);
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionCancelled",
Hookmanager::class, ':EventSubscriptionCancelled'
);
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionUpdated",
Hookmanager::class, ':EventSubscriptionUpdated'
);
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionPaymentSuccess",
Hookmanager::class, ':EventSubscriptionPaymentSuccess'
);
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionPaymentFailed",
Hookmanager::class, ':EventSubscriptionPaymentFailed'
);
$App->post
(
"/api/woocommerce/{authkey}/hooks/SubscriptionPaymentRefunded",
Hookmanager::class, ':EventSubscriptionPaymentRefunded'
);
// TODO: deploy route
$App->post
(
"/api/wocommerce/{authkey}/requests/customer/{customerID}",
Hookmanager::class, ':GetCustomerByID'
);
2018-06-08 14:48:18 +00:00
$App->run();