function get_current_active_nonrecurring_autobill($merchantAutobillId) { $autoBill = new AutoBill(); $response = $autoBill->fetchByMerchantAutoBillId($merchantAutobillId); logCall($response, 'Autobill::FetchByMerchantAutoBillId', $merchantAutobillId); if ($response['returnCode'] == 200) { return $response['data']->autobill; } }
<?php ini_set('include_path', '/usr/local'); ini_set('display_errors', 1); error_reporting(E_ALL | E_STRICT); require_once 'Vindicia/Soap/Vindicia.php'; require_once 'Vindicia/Soap/Const.php'; $abId = $argv[1]; $bpId = $argv[2]; $effectiveDate = 'today'; $prorate = $argv[3]; $dryrun = $argv[4]; print "Modifying to use billing plan {$bpId} \n"; print "dryrun is {$dryrun} \n"; $autobill = new AutoBill(); $return = $autobill->fetchByMerchantAutoBillId($abId); $autobillVID = $return['data']->autobill->VID; print "VID is {$autobillVID} \n"; $modAutoBill = new AutoBill(); $modAutoBill->setVID($autobillVID); $changeBillingPlanTo = new BillingPlan(); $changeBillingPlanTo->setMerchantBillingPlanId($bpId); $response = $modAutoBill->modify('', $prorate, $effectiveDate, $changeBillingPlanTo, NULL, $dryrun, ''); print_r($response);
$abID = $argv[1]; $remID = $argv[2]; $addID = $argv[3]; $effectiveDate = $argv[4]; $prorate = $argv[5]; $dryrun = $argv[6]; $newBillingPlanId = $argv[7]; print "Replacing product {$remID} with product {$addID} on autobill {$abID} \n"; print "dryrun is {$dryrun} \n"; if (!empty($newBillingPlanId)) { print "Changing billing plan to {$newBillingPlanId} \n"; $changeBillingPlanTo = new BillingPlan(); $changeBillingPlanTo->setMerchantBillingPlanId($newBillingPlanId); } $autobill = new AutoBill(); $return = $autobill->fetchByMerchantAutoBillId('', $abID); $autobillVID = $return['data']->autobill->VID; print "VID is {$autobillVID} \n"; $modAutoBill = new AutoBill(); $modAutoBill->setVID($autobillVID); $remProduct = new Product(); $remProduct->setMerchantProductId($remID); $remItem = new AutoBillItem(); $remItem->setProduct($remProduct); $addProduct = new Product(); $addProduct->setMerchantProductId($addID); $addItem = new AutoBillItem(); $addItem->setProduct($addProduct); //$addItem->setCampaignCode('promo10'); $replaceModification = new AutoBillItemModification(); $replaceModification->setRemoveAutoBillItem($remItem);