Permalink
Browse files

expand billing gateway to work with billing requests also

  • Loading branch information...
1 parent e20fa10 commit 6f56760a55bd5fbd8a59c939575799fe06d5a385 @iampersistent iampersistent committed Jan 25, 2013
@@ -7,7 +7,7 @@
use Vespolina\Entity\Billing\BillingAgreementInterface;
use Vespolina\Exception\InvalidInterfaceException;
-class BillingAgreementGateway implements BillingAgreementGatewayInterface
+class BillingGateway implements BillingGatewayInterface
{
protected $molino;
protected $billingAgreementClass;
@@ -81,4 +81,46 @@ public function updateBillingAgreement(BillingAgreementInterface $billingAgreeme
{
$this->molino->save($billingAgreement);
}
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ public function deleteBillingRequest(BillingRequestInterface $billingRequest)
+ {
+ $this->molino->delete($billingRequest);
+ }
+
+ /**
+ * @param \Molino\SelectQueryInterface $query
+ * @return \Vespolina\Entity\Billing\BillingRequestInterface
+ */
+ public function findBillingRequest(SelectQueryInterface $query)
+ {
+ return $query->one();
+ }
+
+ /**
+ * @param \Molino\SelectQueryInterface $query
+ * @return \Vespolina\Entity\Billing\BillingRequestInterface
+ */
+ public function findBillingRequests(SelectQueryInterface $query)
+ {
+ return $query->all();
+ }
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ public function persistBillingRequest(BillingRequestInterface $billingRequest)
+ {
+ $this->molino->save($billingRequest);
+ }
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ public function updateBillingRequest(BillingRequestInterface $billingRequest)
+ {
+ $this->molino->save($billingRequest);
+ }
}
@@ -7,7 +7,7 @@
use Vespolina\Entity\Billing\BillingAgreementInterface;
use Vespolina\Exception\InvalidInterfaceException;
-interface BillingAgreementGatewayInterface
+interface BillingGatewayInterface
{
/**
* @param string $type
@@ -43,4 +43,31 @@ function persistBillingAgreement(BillingAgreementInterface $billingAgreement);
* @param \Vespolina\Entity\Billing\BillingAgreementInterface $billingAgreement
*/
function updateBillingAgreement(BillingAgreementInterface $billingAgreement);
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ function deleteBillingRequest(BillingRequestInterface $billingRequest);
+
+ /**
+ * @param \Molino\SelectQueryInterface $query
+ * @return \Vespolina\Entity\Billing\BillingRequestInterface
+ */
+ function findBillingRequest(SelectQueryInterface $query);
+
+ /**
+ * @param \Molino\SelectQueryInterface $query
+ * @return \Vespolina\Entity\Billing\BillingRequestInterface
+ */
+ function findBillingRequests(SelectQueryInterface $query);
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ function persistBillingRequest(BillingRequestInterface $billingRequest);
+
+ /**
+ * @param \Vespolina\Entity\Billing\BillingRequestInterface $billingRequest
+ */
+ function updateBillingRequest(BillingRequestInterface $billingRequest);
}

0 comments on commit 6f56760

Please sign in to comment.