Пример #1
0
 /**
  * Creates and fills a subscriptionmodel
  *
  * @param array $response
  * @return \Paymill\Models\Response\Subscription
  */
 private function _createSubscription($response)
 {
     $model = new Models\Subscription();
     $model->setId($response['id']);
     $model->setOffer($this->_convertResponseToModel($response['offer'], 'offer'));
     $model->setLivemode($response['livemode']);
     $model->setCancelAtPeriodEnd($response['cancel_at_period_end']);
     $model->setTrialStart($response['trial_start']);
     $model->setTrialEnd($response['trial_end']);
     $model->setNextCaptureAt($response['next_capture_at']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     $model->setCanceledAt($response['canceled_at']);
     $model->setPayment($this->_convertResponseToModel($response['payment'], "payment"));
     $model->setClient($this->_convertResponseToModel($response['client'], "client"));
     $model->setAppId($response['app_id']);
     return $model;
 }
Пример #2
0
 /**
  * Creates and fills a subscription model
  *
  * @param array $response
  * @return Subscription
  */
 private function _createSubscription(array $response)
 {
     $model = new Subscription();
     $model->setId($response['id']);
     $model->setOffer($this->_convertResponseToModel($response['offer'], 'offer'));
     $model->setLivemode($response['livemode']);
     $model->setTrialStart($response['trial_start']);
     $model->setTrialEnd($response['trial_end']);
     $model->setNextCaptureAt($response['next_capture_at']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     $model->setCanceledAt($response['canceled_at']);
     $model->setPayment($this->_convertResponseToModel($response['payment'], "payment"));
     $model->setClient($this->_convertResponseToModel($response['client'], "client"));
     $model->setAppId($response['app_id']);
     $model->setIsCanceled($response['is_canceled']);
     $model->setIsDeleted($response['is_deleted']);
     $model->setStatus($response['status']);
     $model->setAmount($response['amount']);
     $model->setTempAmount($response['temp_amount']);
     return $model;
 }