/**
  * Perform a new query that retrieves you the Recurring Bill Information from a Customer Id.
  *
  * @param String customerId: the ID of a particular Customer.
  * @return a RecurringBillingInformation object.
  * @see {@link com.payhub.ws.api.RecurringBillResponseInformation};
  */
 public function findRecurringBillInformationByCustomer($customerId)
 {
     if (is_null($customerId) || $customerId == "") {
         return null;
     }
     $url = $this->getUrl() . RecurringBill::$RECURRENT_BILL_ID_LINK . "search/findByCustomerRef?customerId=" . $customerId;
     $request = $this->setHeadersGet($url, $this->_oauthToken);
     $result = $this->doGet($request);
     if (array_key_exists('_embedded', $result)) {
         foreach ($result['_embedded']['recurringbills'] as $recurringBill) {
             $response_tmp = RecurringBillResponseInformation::fromArray($recurringBill);
             $response_tmp->setTransactionManager($this);
             $response[] = $response_tmp;
         }
     } else {
         $errors_tmp = new Errors();
         foreach ($result as $errorData) {
             $errors_tmp = Errors::fromArray($errorData);
         }
         $errors[] = $errors_tmp;
         return $errors;
     }
 }
Example #2
0
 public function performRecurringBill($request)
 {
     $json = json_encode($this->object_unset_nulls(null));
     curl_setopt($request, CURLOPT_POSTFIELDS, $json);
     $result = $this->doPost($request, $this->getUrl());
     $response = RecurringBillResponseInformation::fromArray($result);
     return $response;
 }
 /**
  * Perform a new query that retrieves you the Recurring Bill Information from a Customer Id.
  *
  * @param String customerId: the ID of a particular Customer.
  * @return a RecurringBillingInformation object.
  * @see {@link com.payhub.ws.api.RecurringBillResponseInformation};
  */
 public function findRecurringBillInformationByCustomer($customerId)
 {
     if (is_null($customerId) || $customerId == "") {
         return null;
     }
     $url = $this->getUrl() . RecurringBill::$RECURRENT_BILL_ID_LINK . "search/findByCustomerRef?customerId=" . $customerId;
     $request = $this->setHeadersGet($url, $this->_oauthToken);
     $result = $this->doGet($request);
     foreach ($result['_embedded']['recurring-bills'] as $recurringBill) {
         $response_tmp = RecurringBillResponseInformation::fromArray($recurringBill);
         $response_tmp->setTransactionManager($this);
         $response[] = $response_tmp;
     }
     return $response;
 }