Beispiel #1
0
 /**
  * Creates and fills a offermodel
  *
  * @param array $response
  * @return \Paymill\Models\Response\Offer
  */
 private function _createOffer($response)
 {
     $model = new Models\Offer();
     $model->setId($response['id']);
     $model->setName($response['name']);
     $model->setAmount($response['amount']);
     $model->setCurrency($response['currency']);
     $model->setInterval($response['interval']);
     $model->setTrialPeriodDays($response['trial_period_days']);
     $model->setCreatedAt($response['created_at']);
     $model->setUpdatedAt($response['updated_at']);
     $model->setSubscriptionCount($response['subscription_count']['active'], $response['subscription_count']['inactive']);
     $model->setAppId($response['app_id']);
     return $model;
 }