/** * @expectedException HpsException */ public function test013AddScheduleCheckPpd() { $schedule = new HpsPayPlanSchedule(); $schedule->scheduleIdentifier = $this->getIdentifier('CheckPPD'); $schedule->customerKey = self::$customerPersonKey; $schedule->scheduleStatus = HpsPayPlanScheduleStatus::ACTIVE; $schedule->paymentMethodKey = self::$paymentMethodKeyCheckPpd; $schedule->subtotalAmount = new HpsPayPlanAmount(2501); $schedule->startDate = '02012027'; $schedule->frequency = HpsPayPlanScheduleFrequency::WEEKLY; $schedule->duration = HpsPayPlanScheduleDuration::LIMITED_NUMBER; $schedule->reprocessingCount = 1; $schedule->numberOfPayments = 2; $schedule->processingDateInfo = '1'; $this->service->addSchedule($schedule); }
function createSchedule(HpsPayPlanService $service, $customerKey, $paymentMethodKey, $amount) { $schedule = new HpsPayPlanSchedule(); $schedule->scheduleIdentifier = getIdentifier('CreditV'); $schedule->customerKey = $customerKey; $schedule->scheduleStatus = HpsPayPlanScheduleStatus::ACTIVE; $schedule->paymentMethodKey = $paymentMethodKey; $schedule->subtotalAmount = new HpsPayPlanAmount($amount); $schedule->startDate = date('m30Y', strtotime(date('Y-m-d', strtotime(date('Y-m-d'))) . '+1 month')); $schedule->processingDateInfo = '31'; $schedule->frequency = HpsPayPlanScheduleFrequency::MONTHLY; $schedule->duration = HpsPayPlanScheduleDuration::ONGOING; $schedule->reprocessingCount = 1; $response = $service->addSchedule($schedule); return $response->scheduleKey; }