Наследование: extends Infusionsoft_InvoiceServiceBase
 public static function chargeInvoiceArbitraryAmount($contactId, $invoiceId, $cardId, $amount, $merchantAccountId, $invoiceNotes = 'API Arbitrary Payment')
 {
     //Create a new order (InvoiceService.blankOrder...
     $dummyInvoiceId = Infusionsoft_InvoiceService::createBlankOrder($contactId, $invoiceNotes . " Invoice: " . $amount, date('Ymd\\TH:i:s'));
     try {
         //Add an order item that is the correct amount you want to charge...
         Infusionsoft_InvoiceService::addOrderItem($dummyInvoiceId, 0, 3, $amount, 1, $invoiceNotes . " order", "");
         //Set orders custom field "_ChargeStatus" to "Pending"
         $invoice = new Infusionsoft_Invoice($dummyInvoiceId);
         $dummyOrder = new Infusionsoft_Job($invoice->JobId);
         $dummyOrder->OrderStatus = "Pending";
         $dummyOrder->save();
         //Try to charge the invoice
         $result = Infusionsoft_InvoiceService::chargeInvoice($dummyInvoiceId, $invoiceNotes . " payment", $cardId, $merchantAccountId, false);
     } catch (Exception $e) {
         Infusionsoft_InvoiceService::deleteInvoice($dummyInvoiceId);
         throw new Exception("Failed to charge partial payment. Infusionsoft says: " . $e->getMessage());
     }
     //Update order status "_ChargeStatus" to "Failed", or "Succeeded"
     if ($result['Successful']) {
         //add a credit to the order
         Infusionsoft_InvoiceService::addManualPayment($invoiceId, $amount, date('Ymd\\TH:i:s'), "Credit Card", $invoiceNotes . " partial payment", false);
         $dummyOrder->OrderStatus = "Successful";
         $dummyOrder->save();
     } else {
         //erase the invoice
         Infusionsoft_InvoiceService::deleteInvoice($dummyInvoiceId);
     }
     return $result;
     //Update order status to "Applied"
 }
 public function save($app = null)
 {
     if ($this->Id == '') {
         $invoiceId = Infusionsoft_InvoiceService::createBlankOrder($this->ContactId, $this->JobNotes, date('Ymd\\TH:i:s', strtotime($this->StartDate)), 0, 0, $app);
         $invoice = new Infusionsoft_Invoice($invoiceId);
         $this->Id = $invoice->JobId;
     }
     $result = parent::save($app);
     return $result;
 }
Пример #3
0
 public function save($app = null)
 {
     if ($this->Id == '') {
         $invoiceId = Infusionsoft_InvoiceService::createBlankOrder($this->ContactId, $this->JobNotes, $this->DateCreated);
         $invoice = new Infusionsoft_Invoice($invoiceId);
         $this->Id = $invoice->JobId;
     }
     $result = parent::save($app);
     return $result;
 }
 /**
  * Copy an existing RecurringOrder to a new date and delete the existing recurring order AND ALL INVOICES/ORDERS ATTACHED
  * @param int $orderId The ID of the RecurringOrder to replicate
  * @param string $newStartDate String date of when to start the new RecurringOrder
  * @param string $nextBillDate Optional, string date of when to set the NextBillingDate on the new RecurringOrder
  * @return bool|Infusionsoft_RecurringOrder The newly created RecurringOrder object, or false if there was a problem.
  */
 public static function rescheduleRecurringOrderWithDelete($orderId, $newStartDate, $nextBillDate = null)
 {
     $newOrder = self::rescheduleRecurringOrder($orderId, $newStartDate, $nextBillDate);
     // Make API call to delete the old subscription, THIS REMOVES ALL INVOICES AND ORDERS AS WELL!
     try {
         Infusionsoft_InvoiceService::deleteSubscription($orderId);
     } catch (Exception $e) {
         CakeLog::write('error', "Problem deleting existing subscription.  Id: {$orderId}, Error: " . $e->getMessage());
     }
     return $newOrder;
 }
 public function save($app = null)
 {
     if ($this->Id == '') {
         $success = Infusionsoft_InvoiceService::addManualPayment($this->InvoiceId, $this->PayAmt, $this->PayDate, $this->PayType, $this->PayNote, false, $app);
         if (!$success) {
             throw new Infusionsoft_Exception("Failed while saving payment: " . json_encode($this->toArray()));
         }
         $this->Id = 'Created, But, Cannot Get Id';
     }
     return true;
 }
 public function save($app = null)
 {
     if ($this->Id == '') {
         $id = Infusionsoft_InvoiceService::addRecurringOrder($this->ContactId, true, $this->SubscriptionPlanId, $this->Qty, $this->BillingAmt, true, $this->MerchantAccountId, $this->CC1, $this->AffiliateId, 0);
         $this->Id = $id;
     }
     $result = parent::save($app);
     Infusionsoft_InvoiceService::updateJobRecurringNextBillDate($this->Id, $this->NextBillDate);
     Infusionsoft_InvoiceService::createInvoiceForRecurring($this->Id);
     return $result;
 }
 public function save($app = null)
 {
     if ($this->Id == '') {
         $invoices = Infusionsoft_DataService::query(new Infusionsoft_Invoice(), array('JobId' => $this->OrderId), 1000, 0, false, $app);
         if (count($invoices) == 0) {
             throw new Infusionsoft_Exception("Could not get invoice for order: " . $this->OrderId . " while creating adding an order item.");
         }
         /** @var Infusionsoft_Invoice $invoice */
         $invoice = array_shift($invoices);
         $result = Infusionsoft_InvoiceService::addOrderItem($invoice->Id, $this->ProductId, $this->ItemType, $this->PPU, $this->Qty, $this->ItemDescription, $this->Notes, $app);
         if (!$result) {
             throw new Infusionsoft_Exception("Couldn't save orderitem: " . json_encode($this->toArray()));
         }
         //Infusionsoft doesn't always use consecutive Ids, but it is very very very rare that the id won't be consecutive if a new record is inserted very quickly after the previous, so even though this isn't ideal, it's what we are doing.
         $newestOrderItems = Infusionsoft_DataService::queryWithOrderBy(new Infusionsoft_OrderItem(), array('OrderId' => $this->OrderId), 'Id', false, 1);
         $newestOrderItem = array_shift($newestOrderItems);
         $this->Id = $newestOrderItem->Id;
     }
     $result = parent::save($app);
     return $result;
 }
<form>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::getAllPaymentOptions();
    var_dump($out);
}
<form>
<input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::hello();
    var_dump($out);
}
<form>
            id: <input type="text" name="id" value="<?php 
if (isset($_REQUEST['id'])) {
    echo htmlspecialchars($_REQUEST['id']);
}
?>
"><br/>
            syncStatus: <input type="text" name="syncStatus" value="<?php 
if (isset($_REQUEST['syncStatus'])) {
    echo htmlspecialchars($_REQUEST['syncStatus']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::setPaymentSyncStatus($_REQUEST['id'], $_REQUEST['syncStatus']);
    var_dump($out);
}
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::getOrderId($_REQUEST['invoiceId']);
    var_dump($out);
}
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::getPayments($_REQUEST['invoiceId']);
    var_dump($out);
}
}
?>
"><br/>
            paymentType: <input type="text" name="paymentType" value="<?php 
if (isset($_REQUEST['paymentType'])) {
    echo htmlspecialchars($_REQUEST['paymentType']);
}
?>
"><br/>
            paymentDescription: <input type="text" name="paymentDescription" value="<?php 
if (isset($_REQUEST['paymentDescription'])) {
    echo htmlspecialchars($_REQUEST['paymentDescription']);
}
?>
"><br/>
            bypassCommissions: <input type="text" name="bypassCommissions" value="<?php 
if (isset($_REQUEST['bypassCommissions'])) {
    echo htmlspecialchars($_REQUEST['bypassCommissions']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::addManualPayment($_REQUEST['invoiceId'], $_REQUEST['amt'], $_REQUEST['paymentDate'], $_REQUEST['paymentType'], $_REQUEST['paymentDescription'], $_REQUEST['bypassCommissions']);
    var_dump($out);
}
 public static function chargeInvoiceArbitraryAmountUsingPayPlan($invoiceId, $cardId, $amount, $merchantAccountId, $paymentNotes = 'API Arbitrary Payment')
 {
     $result = false;
     //Get Invoice info so we can set the temporary PayPlan to match the amount we want to charge
     $invoice = new Infusionsoft_Invoice($invoiceId);
     if ($amount + $invoice->TotalPaid <= $invoice->InvoiceTotal) {
         $temporaryFirstPayment = $amount + $invoice->TotalPaid;
     } else {
         $temporaryFirstPayment = $invoice->InvoiceTotal - $invoice->TotalPaid;
     }
     //Get current PayPlan info so we can set it back after taking the payment
     $payPlan = Infusionsoft_DataService::query(new Infusionsoft_PayPlan(), array('InvoiceId' => $invoiceId));
     if (!empty($payPlan)) {
         $payPlan = reset($payPlan);
         /**
          * @var Infusionsoft_PayPlan $payPlan
          */
         $payPlanItems = Infusionsoft_DataService::queryWithOrderBy(new Infusionsoft_PayPlanItem(), array('PayPlanId' => $payPlan->Id), 'DateDue', true);
         $payPlanStartDate = $payPlan->StartDate;
         $payPlanFirstPaymentAmount = $payPlan->FirstPayAmt;
         $numberOfPayments = count($payPlanItems) - 1;
         $payPlanItemDueDate1 = null;
         $daysBetweenPayments = 1;
         foreach ($payPlanItems as $index => $payPlanItem) {
             if ($index == 0) {
                 continue;
             }
             /**
              * @var Infusionsoft_PayPlanItem $payPlanItem
              */
             if ($payPlanItemDueDate1 == null) {
                 $payPlanItemDueDate1 = $payPlanItem->DateDue;
             } else {
                 $daysBetweenPayments = round((strtotime($payPlanItem->DateDue) - strtotime($payPlanItemDueDate1)) / 60 / 60 / 24);
                 break;
             }
         }
         if ($payPlanItemDueDate1 == null) {
             $payPlanItemDueDate1 = $payPlanStartDate;
         }
     } else {
         //If there is no PayPlan, then just set the order to the default of all due up front
         CakeLog::write('warning', 'PayPlan not found for InvoiceId: ' . $invoiceId . ' PayPlan will be set to the default');
         $payPlanFirstPaymentAmount = $invoice->InvoiceTotal;
         $payPlanStartDate = $invoice->DateCreated;
         $numberOfPayments = 0;
         $payPlanItemDueDate1 = $invoice->DateCreated;
         $daysBetweenPayments = 1;
     }
     try {
         Infusionsoft_InvoiceService::addPaymentPlan($invoiceId, 0, $cardId, $merchantAccountId, 1, 1, $temporaryFirstPayment, Infusionsoft_App::formatDate(date('Y-m-d')), Infusionsoft_App::formatDate(date('Y-m-d', strtotime(' + 1 day'))), 1, 1);
         $result = Infusionsoft_InvoiceService::chargeInvoice($invoiceId, $paymentNotes, $cardId, $merchantAccountId, false);
     } catch (Exception $e) {
         CakeLog::write('error', 'Failed to charge invoice arbitrary amount! InvoiceId: ' . $invoiceId . ' Infusionsoft error: ' . $e->getMessage());
     }
     try {
         Infusionsoft_InvoiceService::addPaymentPlan($invoiceId, 0, $cardId, $merchantAccountId, 1, 3, $payPlanFirstPaymentAmount, $payPlanStartDate, $payPlanItemDueDate1, $numberOfPayments, $daysBetweenPayments);
     } catch (Exception $e) {
         CakeLog::write('error', 'Failed to reset payment plan after chargeInvoiceArbitraryAmount! InvoiceId: ' . $invoiceId . ' PayPlan Details: ' . json_encode(compact('payPlanFirstPaymentAmount', 'payPlanStartDate', 'payPlanItemDueDate1', 'numberOfPayments', 'daysBetweenPayments')));
     }
     return $result;
 }
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::calculateAmountOwed($_REQUEST['invoiceId']);
    var_dump($out);
}
}
?>
"><br/>
            quantity: <input type="text" name="quantity" value="<?php 
if (isset($_REQUEST['quantity'])) {
    echo htmlspecialchars($_REQUEST['quantity']);
}
?>
"><br/>
            description: <input type="text" name="description" value="<?php 
if (isset($_REQUEST['description'])) {
    echo htmlspecialchars($_REQUEST['description']);
}
?>
"><br/>
            notes: <input type="text" name="notes" value="<?php 
if (isset($_REQUEST['notes'])) {
    echo htmlspecialchars($_REQUEST['notes']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::addOrderItem($_REQUEST['invoiceId'], $_REQUEST['productId'], $_REQUEST['type'], $_REQUEST['price'], $_REQUEST['quantity'], $_REQUEST['description'], $_REQUEST['notes']);
    var_dump($out);
}
<form>
            recurringOrderId: <input type="text" name="recurringOrderId" value="<?php 
if (isset($_REQUEST['recurringOrderId'])) {
    echo htmlspecialchars($_REQUEST['recurringOrderId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::createInvoiceForRecurring($_REQUEST['recurringOrderId']);
    var_dump($out);
}
}
?>
"><br/>
            creditCardId: <input type="text" name="creditCardId" value="<?php 
if (isset($_REQUEST['creditCardId'])) {
    echo htmlspecialchars($_REQUEST['creditCardId']);
}
?>
"><br/>
            merchantAccountId: <input type="text" name="merchantAccountId" value="<?php 
if (isset($_REQUEST['merchantAccountId'])) {
    echo htmlspecialchars($_REQUEST['merchantAccountId']);
}
?>
"><br/>
            bypassCommissions: <input type="text" name="bypassCommissions" value="<?php 
if (isset($_REQUEST['bypassCommissions'])) {
    echo htmlspecialchars($_REQUEST['bypassCommissions']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::chargeInvoice($_REQUEST['invoiceId'], $_REQUEST['notes'], $_REQUEST['creditCardId'], $_REQUEST['merchantAccountId'], $_REQUEST['bypassCommissions']);
    var_dump($out);
}
<form>
            fullyQualifiedClassName: <input type="text" name="fullyQualifiedClassName" value="<?php 
if (isset($_REQUEST['fullyQualifiedClassName'])) {
    echo htmlspecialchars($_REQUEST['fullyQualifiedClassName']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::getPluginStatus($_REQUEST['fullyQualifiedClassName']);
    var_dump($out);
}
<form>
            jobRecurringId: <input type="text" name="jobRecurringId" value="<?php 
if (isset($_REQUEST['jobRecurringId'])) {
    echo htmlspecialchars($_REQUEST['jobRecurringId']);
}
?>
"><br/>
            newNextBillDate: <input type="text" name="newNextBillDate" value="<?php 
if (isset($_REQUEST['newNextBillDate'])) {
    echo htmlspecialchars($_REQUEST['newNextBillDate']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::updateJobRecurringNextBillDate($_REQUEST['jobRecurringId'], $_REQUEST['newNextBillDate']);
    var_dump($out);
}
}
?>
"><br/>
            orderDate: <input type="text" name="orderDate" value="<?php 
if (isset($_REQUEST['orderDate'])) {
    echo htmlspecialchars($_REQUEST['orderDate']);
}
?>
"><br/>
            leadAffiliateId: <input type="text" name="leadAffiliateId" value="<?php 
if (isset($_REQUEST['leadAffiliateId'])) {
    echo htmlspecialchars($_REQUEST['leadAffiliateId']);
}
?>
"><br/>
            saleAffiliateId: <input type="text" name="saleAffiliateId" value="<?php 
if (isset($_REQUEST['saleAffiliateId'])) {
    echo htmlspecialchars($_REQUEST['saleAffiliateId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::createBlankOrder($_REQUEST['contactId'], $_REQUEST['description'], $_REQUEST['orderDate'], $_REQUEST['leadAffiliateId'], $_REQUEST['saleAffiliateId']);
    var_dump($out);
}
<form>
            contactId: <input type="text" name="contactId" value="<?php 
if (isset($_REQUEST['contactId'])) {
    echo htmlspecialchars($_REQUEST['contactId']);
}
?>
"><br/>
            last4: <input type="text" name="last4" value="<?php 
if (isset($_REQUEST['last4'])) {
    echo htmlspecialchars($_REQUEST['last4']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::locateExistingCard($_REQUEST['contactId'], $_REQUEST['last4']);
    var_dump($out);
}
<?php

include '../infusionsoft.php';
include 'object_editor_all_tables.php';
include '../tests/testUtils.php';
if (isset($_POST['contactid'])) {
    $recurring_order_id = Infusionsoft_InvoiceService::addRecurringOrder($_POST['contactid'], true, $_POST['subscriptionplanid'], 0, 0.01, false, 0, 0, 0, 0);
    $recurringOrder = new Infusionsoft_RecurringOrder($recurring_order_id);
    $recurringOrder->StartDate = date('Y-m-d H:i:s', strtotime("-1 month"));
    $recurringOrder->PaidThruDate = date('Y-m-d H:i:s', strtotime("-1 month"));
    $recurringOrder->save();
    echo "<h1>Subscription Created: {$recurring_order_id}</h1>";
}
?>
<h1>Create Subscription</h1>
<form method="post">
        Contact Id: <input type="text" name="contactid" value="1459" placeholder="Contact Id"/><br/>
        SubscriptionPlanId: <input type="text" name="subscriptionplanid" value="33" placeholder="Subscription Plan / CProgram Id"/><br/>
        <input type="submit">
</form>
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::deleteInvoice($_REQUEST['invoiceId']);
    var_dump($out);
}
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::getInvoiceQuickbooksIIF($_REQUEST['invoiceId']);
    var_dump($out);
}
}
?>
"><br/>
            amount: <input type="text" name="amount" value="<?php 
if (isset($_REQUEST['amount'])) {
    echo htmlspecialchars($_REQUEST['amount']);
}
?>
"><br/>
            payoutType: <input type="text" name="payoutType" value="<?php 
if (isset($_REQUEST['payoutType'])) {
    echo htmlspecialchars($_REQUEST['payoutType']);
}
?>
"><br/>
            description: <input type="text" name="description" value="<?php 
if (isset($_REQUEST['description'])) {
    echo htmlspecialchars($_REQUEST['description']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::addRecurringCommissionOverride($_REQUEST['recurringinvoiceId'], $_REQUEST['affiliateId'], $_REQUEST['amount'], $_REQUEST['payoutType'], $_REQUEST['description']);
    var_dump($out);
}
}
?>
"><br/>
            planStartDate: <input type="text" name="planStartDate" value="<?php 
if (isset($_REQUEST['planStartDate'])) {
    echo htmlspecialchars($_REQUEST['planStartDate']);
}
?>
"><br/>
            numPmts: <input type="text" name="numPmts" value="<?php 
if (isset($_REQUEST['numPmts'])) {
    echo htmlspecialchars($_REQUEST['numPmts']);
}
?>
"><br/>
            daysBetweenPmts: <input type="text" name="daysBetweenPmts" value="<?php 
if (isset($_REQUEST['daysBetweenPmts'])) {
    echo htmlspecialchars($_REQUEST['daysBetweenPmts']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::addPaymentPlan($_REQUEST['invoiceId'], $_REQUEST['autoCharge'], $_REQUEST['creditCardId'], $_REQUEST['merchantAccountId'], $_REQUEST['daysBetweenRetry'], $_REQUEST['maxRetry'], $_REQUEST['initialPmtAmt'], $_REQUEST['initialPmtDate'], $_REQUEST['planStartDate'], $_REQUEST['numPmts'], $_REQUEST['daysBetweenPmts']);
    var_dump($out);
}
}
?>
"><br/>
            creditCardId: <input type="text" name="creditCardId" value="<?php 
if (isset($_REQUEST['creditCardId'])) {
    echo htmlspecialchars($_REQUEST['creditCardId']);
}
?>
"><br/>
            affiliateId: <input type="text" name="affiliateId" value="<?php 
if (isset($_REQUEST['affiliateId'])) {
    echo htmlspecialchars($_REQUEST['affiliateId']);
}
?>
"><br/>
            daysTillCharge: <input type="text" name="daysTillCharge" value="<?php 
if (isset($_REQUEST['daysTillCharge'])) {
    echo htmlspecialchars($_REQUEST['daysTillCharge']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::addRecurringOrder($_REQUEST['contactId'], $_REQUEST['allowDuplicate'], $_REQUEST['cProgramId'], $_REQUEST['qty'], $_REQUEST['price'], $_REQUEST['allowTax'], $_REQUEST['merchantAccountId'], $_REQUEST['creditCardId'], $_REQUEST['affiliateId'], $_REQUEST['daysTillCharge']);
    var_dump($out);
}
<form>
            invoiceId: <input type="text" name="invoiceId" value="<?php 
if (isset($_REQUEST['invoiceId'])) {
    echo htmlspecialchars($_REQUEST['invoiceId']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::recalculateTax($_REQUEST['invoiceId']);
    var_dump($out);
}
<form>
            creditCard: <input type="text" name="creditCard" value="<?php 
if (isset($_REQUEST['creditCard'])) {
    echo htmlspecialchars($_REQUEST['creditCard']);
}
?>
"><br/>
    <input type="submit">
<input type="hidden" name="go">
</form>
<?php 
include '../infusionsoft.php';
include 'testUtils.php';
if (isset($_REQUEST['go'])) {
    $out = Infusionsoft_InvoiceService::validateCreditCard($_REQUEST['creditCard']);
    var_dump($out);
}