コード例 #1
0
ファイル: charge.php プロジェクト: hps/heartland-php
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;
}
コード例 #2
0
ファイル: RecurringTest.php プロジェクト: hps/heartland-php
 /**
  * @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);
 }