Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from immersivelabs/feature/manager

Feature/manager
  • Loading branch information...
commit 4094a77b3c9f5dfab1303d4ab17a10d688f526e7 2 parents c0f0dc8 + c2c8668
@iampersistent iampersistent authored
View
35 lib/Vespolina/Billing/Manager/BillingManager.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * (c) 2013 Vespolina Project http://www.vespolina-project.org
+ *
+ * This source file is subject to the MIT license that is bundled
+ * with this source code in the file LICENSE.
+ */
+
+namespace Vespolina\Billing\Manager;
+
+use Vespolina\Entity\Order\OrderInterface;
+use Vespolina\Entity\Partner\PartnerInterface;
+
+class BillingManager implements BillingManagerInterface
+{
+ public function processOrder(OrderInterface $order)
+ {
+ // order should already be processed, todo: add a flag to make sure?
+ $items = $order->getItems();
+ foreach ($items as $item) {
+
+ }
+ }
+
+
+ public function createBillingAgreement(OrderInterface $order)
+ {
+
+ }
+
+ function createBillingRequest(PartnerInterface $partner)
+ {
+
+ }
+}
View
8 ...anager/BillingRequestManagerInterface.php → ...lling/Manager/BillingManagerInterface.php
@@ -1,6 +1,6 @@
<?php
/**
- * (c) 2012 Vespolina Project http://www.vespolina-project.org
+ * (c) 2012-2013 Vespolina Project http://www.vespolina-project.org
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
@@ -8,6 +8,7 @@
namespace Vespolina\Billing\Manager;
+use Vespolina\Entity\Order\OrderInterface;
use Vespolina\Entity\Partner\PartnerInterface;
/**
@@ -15,8 +16,11 @@
*
* @author Daniel Kucharski <daniel-xerias.be>
*/
-interface BillingRequestManagerInterface
+interface BillingManagerInterface
{
+
+ function createBillingAgreement(OrderInterface $order);
+
/**
* Create a new billing request
*
View
17 tests/Manager/BillingManagerTest.php
@@ -0,0 +1,17 @@
+<?php
+
+class BillingManagerTest extends \PHPUnit_Framework_TestCase
+{
+ public function test()
+ {
+ // track states in processing
+
+ /** current needs */
+ // get order
+ // create current bill
+ // create recurring bill
+ // get CC
+ // submit current bill to CC
+ // create licenses when CC is approved
+ }
+}
View
12 tests/bootstrap.php
@@ -0,0 +1,12 @@
+<?php
+
+$loader = @include __DIR__ . '/../vendor/autoload.php';
+
+if (!$loader) {
+ die(<<<'EOT'
+You must set up the project dependencies, run the following commands:
+wget http://getcomposer.org/composer.phar
+php composer.phar install
+EOT
+ );
+}
Please sign in to comment.
Something went wrong with that request. Please try again.