/**
  * Creates an search transaction through the HpsPayPlanCustomerService
  */
 public function execute()
 {
     parent::execute();
     $service = new HpsPayPlanCustomerService($this->service->servicesConfig());
     $usableData = array_intersect_key($this->data, array_flip(HpsPayPlanCustomer::getSearchableFields()));
     return $service->search($usableData);
 }
コード例 #2
0
 protected function setUp()
 {
     $config = new HpsServicesConfig();
     $config->secretApiKey = 'skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A';
     $this->service = new HpsPayPlanPaymentMethodService($config);
     $customerService = new HpsPayPlanCustomerService($config);
     $this->customer = $customerService->page(1, 0)->findAll()->results[0];
 }
 /**
  * Creates an get transaction through the HpsPayPlanCustomerService
  */
 public function execute()
 {
     parent::execute();
     if ($this->customer != null) {
         $this->customerKey = $this->customer->customerKey;
     }
     $service = new HpsPayPlanCustomerService($this->service->servicesConfig());
     return $service->get($this->customerKey);
 }
 /**
  * Creates an add transaction through the HpsPayPlanCustomerService
  */
 public function execute()
 {
     parent::execute();
     $service = new HpsPayPlanCustomerService($this->service->servicesConfig());
     $obj = new HpsPayPlanCustomer();
     foreach ($this->data as $k => $v) {
         $obj->{$k} = $v;
     }
     unset($usableData, $k, $v);
     return $service->add($obj);
 }
 /**
  * Creates an edit transaction through the HpsPayPlanCustomerService
  */
 public function execute()
 {
     parent::execute();
     if ($this->customer != null) {
         $this->customerKey = $this->customer->customerKey;
     }
     $service = new HpsPayPlanCustomerService($this->service->servicesConfig());
     $obj = new HpsPayPlanCustomer();
     $obj->customerKey = $this->customerKey;
     $usableData = array_intersect_key($this->data, array_flip(HpsPayPlanCustomer::getEditableFields()));
     foreach ($usableData as $k => $v) {
         $obj->{$k} = $v;
     }
     unset($usableData, $k, $v);
     return $service->edit($obj);
 }
コード例 #6
0
 protected function setup()
 {
     $config = new HpsServicesConfig();
     $config->secretApiKey = 'skapi_cert_MTyMAQBiHVEAewvIzXVFcmUd2UcyBge_eCpaASUp0A';
     $config->developerId = '002914';
     $config->versionNumber = '1510';
     $scheduleService = new HpsPayPlanScheduleService($config);
     $results = $scheduleService->page(1, 0)->findAll(array('scheduleStatus' => HpsPayPlanScheduleStatus::ACTIVE, 'scheduleIdentifier' => 'SecureSubmit'));
     $this->schedule = isset($results->results[0]) ? $results->results[0] : null;
     if ($this->schedule == null) {
         $customerService = new HpsPayPlanCustomerService($config);
         $id = date('Ymd') . '-SecureSubmit-' . substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'), 0, 10);
         $newCustomer = new HpsPayPlanCustomer();
         $newCustomer->customerIdentifier = $id;
         $newCustomer->firstName = 'Bill';
         $newCustomer->lastName = 'Johnson';
         $newCustomer->company = 'Heartland Payment Systems';
         $newCustomer->country = 'USA';
         $newCustomer->customerStatus = HpsPayPlanCustomerStatus::ACTIVE;
         $customer = $customerService->add($newCustomer);
         $paymentMethodService = new HpsPayPlanPaymentMethodService($config);
         $newPaymentMethod = new HpsPayPlanPaymentMethod();
         $newPaymentMethod->customerKey = $customer->customerKey;
         $newPaymentMethod->nameOnAccount = 'Bill Johnson';
         $newPaymentMethod->accountNumber = 4111111111111111;
         $newPaymentMethod->expirationDate = '0120';
         $newPaymentMethod->country = 'USA';
         $paymentMethod = $paymentMethodService->add($newPaymentMethod);
         $id = date('Ymd') . '-SecureSubmit-' . substr(str_shuffle('abcdefghijklmnopqrstuvwxyz'), 0, 10);
         $date = date('m30Y', strtotime(date('Y-m-d', strtotime(date('Y-m-d'))) . '+1 month'));
         $newPaymentSchedule = new HpsPayPlanSchedule();
         $newPaymentSchedule->scheduleIdentifier = $id;
         $newPaymentSchedule->customerKey = $paymentMethod->customerKey;
         $newPaymentSchedule->paymentMethodKey = $paymentMethod->paymentMethodKey;
         $newPaymentSchedule->subtotalAmount = array('value' => 100);
         $newPaymentSchedule->startDate = $date;
         $newPaymentSchedule->frequency = HpsPayPlanScheduleFrequency::WEEKLY;
         $newPaymentSchedule->duration = HpsPayPlanScheduleDuration::LIMITED_NUMBER;
         $newPaymentSchedule->numberOfPayments = 3;
         $newPaymentSchedule->reprocessingCount = 2;
         $newPaymentSchedule->emailReceipt = 'Never';
         $newPaymentSchedule->emailAdvanceNotice = 'No';
         $newPaymentSchedule->scheduleStatus = HpsPayPlanScheduleStatus::ACTIVE;
         $this->schedule = $scheduleService->add($newPaymentSchedule);
     }
     $this->service = new HpsCreditService($config);
 }