$montly_s->monthly_each_days = array(15); $start = new DateTime("2016-1-29"); $start = $start->format('Y-m-d'); $type = "O"; $endDate = new DateTime("2016-8-29"); $endDate = $endDate->format('Y-m-d'); $scheduleSandE = new ScheduleSartAndEnd(); $scheduleSandE->start_date = $start; $scheduleSandE->end_date_type = $type; $scheduleSandE->end_date = $endDate; $schedule = new Schedule($scheduleSandE, $montly_s); $schedule->schedule_type = "M"; $schedule->bill_generation_interval = 1; $recurringBill = new RecurringBill($merchant, $customer, $bill, $card_data, $schedule); $transaction = new TransactionManager($merchant, $WsURL, $oauth_token); $response = $transaction->doRecurringBill($recurringBill); if ($response->getErrors() == null) { $transactionId = $response->getLastRecurringBillResponse()->getRecurringBillId(); $statusInfo = $response->getStatusInformation(); var_dump($statusInfo); echo "Updating..."; $canUpdate = $transaction->updateRecurringBillStatus($transactionId); if ($canUpdate) { $statusUpdated = $transaction->getRecurringBillInformation($transactionId); if ($statusUpdated->getErrors() == null) { var_dump($statusUpdated->getStatusInformation()); } } } else { var_dump($response->getErrors()); }
<?php /** * Created by PhpStorm. * User: agustin * Date: 29/07/2015 * Time: 11:16 */ $path_to_IncludeClases = "../com/payhub/ws/extra/includeClasses.php"; include_once $path_to_IncludeClases; //Defining the Web Service URL $WsURL = "https://staging-api.payhub.com/api/v2/"; $oauth_token = "107d74ab-4a18-4713-88ff-69bd05710086"; //Defining data for the SALE transaction // Merchant data (obtained from the payHub Virtual Terminal (3rd party integration) $merchant = new Merchant(); $merchant->setOrganizationId(10127); $merchant->setTerminalId(215); $transaction = new TransactionManager($merchant, $WsURL, $oauth_token); $response = $transaction->getRecurringBillInformation("1186"); var_dump($response);