Permalink
Browse files

fixes in manager concerning the partner

  • Loading branch information...
1 parent b0d6092 commit c8b55cc831de42b59b1536c2ee1ae6cd96fe491a @iampersistent iampersistent committed Feb 1, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Vespolina/Billing/Manager/BillingManager.php
@@ -154,7 +154,8 @@ function createBillingRequest(BillingAgreementInterface $billingAgreement)
$paymentType = $billingAgreement->getPaymentProfile()->getType();
$context = $this->context['billingRequest'][$paymentType];
- // todo: find everything in the context then process ....
+ $partner = $billingAgreement->getPartner();
+ $context['partner'] = $partner;
$relatedAgreements = $this->findBillingAgreements($context);
$billingRequest = new $this->billingRequestClass();
@@ -165,6 +166,7 @@ function createBillingRequest(BillingAgreementInterface $billingAgreement)
}
$billingRequest->setPricing($requestPricingSet);
$billingRequest->setDueDate($agreement->getNextBillingDate());
+ $billingRequest->setPartner($partner);
$this->gateway->persistBillingRequest($billingRequest);
@@ -199,6 +201,9 @@ public function findBillingAgreements(PricingContextInterface $context, $limit =
$startDate = new \DateTime($context['startDate']);
$query->filterGreater('nextBillingDate', $startDate);
}
+ if ($context['partner']) {
+ $query->filterEqual('partner', $context['partner']);
+ }
$query->filterEqual('active', 1);
if ($limit) {
$query->limit($limit);

0 comments on commit c8b55cc

Please sign in to comment.