コード例 #1
0
ファイル: signup.php プロジェクト: SonomaJack/Wellbeing
 // Successful account create
 if ($result2->result->Success) {
     $CreateStatus = "Account created for " . $gFullName . "<br>";
     // If we have the id to the account then build a paymentmethod object
     $PaymentMethod[0] = makePaymentMethod($gFullName, $creditCardType, $gCreditCardNumber, $gCreditCardExpirationMonth, $gCreditCardExpirationYear, $result2->result->Id);
     // $gCreditCardNumber
     // Now create the PaymentMethod in Zuora and attach it to the account
     // the call returns the id of the paymentMethod to be passed to the account create
     $result = $instance->create($PaymentMethod);
     if (isset($result)) {
         // Sccessful payment method create
         if ($result->result->Success) {
             $CreateStatus = $CreateStatus . "Payment Method created for " . $gFullName . "<br>";
             // Now create a contact so we can make the account active
             //function makeContact($            firstName,$lastName,$address1,$address2,$city,$state,$country,$postalCode,$workMail,$workPhone,$accountId=null,$WorkEmail){
             $RetContact[0] = makeContact($gFirstName, $gLastName, $fieldsValue['Address1'], '', $fieldsValue['City'], $fieldsValue['State'], 'USA', $fieldsValue['PostalCode'], '', '', $result2->result->Id, $fieldsValue[$WorkEmail]);
             $resultCreateContact = $instance->create($RetContact);
             if ($resultCreateContact->result->Success) {
                 // createMessage($resultCreateContact);
                 // Now update the account to active
                 $RetAcct[0] = makeUpdateAccount($result2->result->Id, 'Active', $resultCreateContact->result->Id);
                 $CreateStatus = $CreateStatus . "ID: " . $RetAcct[0]->Id . "<br>";
                 $resultUpdate = $instance->update($RetAcct);
                 // Now create a Subscription
                 $subscriptionName = "New Signup - From Wellbeing(" . date('m/d/Y h:i:s') . ")";
                 // print $_SESSION['PhysicianPassedIn'] . " - " . $_SESSION['URLLoc'];
                 $subscription = makeSubscription($subscriptionName, null, $Name, date('m/d/Y'), $_POST['Docs'], $_SESSION['URLLoc'], $_POST['SalesRep'], $_POST['StartDate'], 3);
                 $gsubscriptionID = $subscription->Id;
                 $CreateStatus = $CreateStatus . "number of items in chargeIds: " . sizeof($chargeIds) . "<br>";
                 foreach ($chargeIds as $cid) {
                     $CreateStatus = $CreateStatus . "cid-" . $cid . "-<br>";
コード例 #2
0
function subscribedata($instance, $chargeIds, $rateplancharges, $rateplanId)
{
    global $Name;
    global $FirstName;
    global $LastName;
    global $WorkEmail;
    global $WorkPhone;
    global $Address1;
    global $Address2;
    global $City;
    global $State;
    global $Country;
    global $PostalCode;
    global $CreditCardHolderName;
    global $CreditCardNumber;
    global $CreditCardExpirationMonth;
    global $CreditCardExpirationYear;
    global $CreditCardType;
    global $CreditCardPostalCode;
    $subscriptionName = getPostValue($Name) . " New Signup (" . time() . ")";
    $account = makeAccount(getPostValue($Name), 'USD', 'Draft');
    $contact = makeContact(getPostValue($FirstName), getPostValue($LastName), getPostValue($Address1), getPostValue($Address2), getPostValue($City), getPostValue($State), getPostValue($Country), getPostValue($PostalCode), getPostValue($WorkMail), getPostValue($WorkPhone));
    $paymentmethod = makePaymentMethod(getPostValue($CreditCardHolderName), getPostValue($Address1), getPostValue($Address2), getPostValue($City), getPostValue($State), getPostValue($Country), getPostValue($PostalCode), getPostValue($CreditCardType), getPostValue($CreditCardNumber), getPostValue($CreditCardExpirationMonth), getPostValue($CreditCardExpirationYear));
    $subscription = makeSubscription($subscriptionName, null);
    $zSubscriptionData = makeSubscriptionData($subscription, $chargeIds, $rateplancharges, $rateplanId);
    $zSubscribeOptions = new Zuora\Soap\SubscribeOptions(false, false);
    $result = $instance->subscribe($account, $contact, $paymentmethod, $zSubscriptionData, $zSubscribeOptions);
    createMessage($result);
}
コード例 #3
0
 if (isset($result2)) {
     // Successful account create
     if ($result2->result->Success) {
         $CreateStatus = "Account created for " . $gFullName . "<br>";
         // If we have the id to the account then build a paymentmethod object
         $PaymentMethod[0] = makePaymentMethod($gFullName, $creditCardType, $gCreditCardNumber, $gCreditCardExpirationMonth, $gCreditCardExpirationYear, $result2->result->Id);
         // $gCreditCardNumber
         // Now create the PaymentMethod in Zuora and attach it to the account
         // the call returns the id of the paymentMethod to be passed to the account create
         $result = $instance->create($PaymentMethod);
         if (isset($result)) {
             // Sccessful payment method create
             if ($result->result->Success) {
                 $CreateStatus = $CreateStatus . "Payment Method created for " . $gFullName . "<br>";
                 // Now create a contact so we can make the account active
                 $RetContact[0] = makeContact($gFirstName, $gLastName, '', '', '', '', 'USA', '', '', '', $result2->result->Id, $fieldsValue[$WorkEmail]);
                 $resultCreateContact = $instance->create($RetContact);
                 if ($resultCreateContact->result->Success) {
                     // createMessage($resultCreateContact);
                     // Now update the account to active
                     $RetAcct[0] = makeUpdateAccount($result2->result->Id, 'Active', $resultCreateContact->result->Id);
                     $CreateStatus = $CreateStatus . "ID: " . $RetAcct[0]->Id . "<br>";
                     $resultUpdate = $instance->update($RetAcct);
                     // Now create a Subscription
                     $subscriptionName = "New Signup - From Wellbeing(" . date('m/d/Y h:i:s') . ")";
                     // print $_SESSION['PhysicianPassedIn'] . " - " . $_SESSION['URLLoc'];
                     $subscription = makeSubscription($subscriptionName, null, $gFullName, date('m/d/Y'), $_POST['Docs'], $_SESSION['URLLoc'], $_POST['SalesRep'], $_POST['StartDate'], 3);
                     $gsubscriptionID = $subscription->Id;
                     $zSubscriptionData = makeSubscriptionData($subscription, $chargeIds, $rateplancharges, $rateplanId);
                     $zSubscribeOptions = new Zuora_SubscribeOptions(false, false);
                     // $result = $instance->PMD_CreateAcct($account, $zSubscriptionData);
コード例 #4
0
ファイル: main.php プロジェクト: SonomaJack/Wellbeing
function subscribe($instance, $ProductRatePlan, $GeneratePayments = true, $GenerateInvoice = true, $accountName = null, $subscriptionName = null)
{
    $ProductRatePlanId = $ProductRatePlan->Id;
    # SUBSCRIBE
    $zAccount = makeAccount(isset($accountName) ? $accountName : 'Robert Smith', 'USD', 'Active');
    $zPaymentMethod = makePaymentMethod('Firstly Lastly', '52 Vexford Lane', null, 'Anaheim', 'California', 'United States', '22042', 'Visa', '5105105105105100', '12', '2012');
    $zBillToContact = makeContact('Robert', 'Smith', '4901 Morena Blvd', null, 'San Diego', 'Virginia', 'United States', '92117', '*****@*****.**', null);
    $zSubscription = makeSubscription(isset($subscriptionName) ? $subscriptionName : "Name" . time(), null);
    $zSubscriptionData = makeSubscriptionData($zSubscription, array(), array(), $ProductRatePlanId);
    $zSubscribeOptions = new Zuora_SubscribeOptions($GenerateInvoice, $GeneratePayments);
    $result = $instance->subscribe($zAccount, $zSubscriptionData, $zBillToContact, $zPaymentMethod, $zSubscribeOptions);
    return $result;
}
コード例 #5
0
ファイル: signup.php プロジェクト: SonomaJack/Wellbeing
 if (isset($result2)) {
     //Successful account create
     if ($result2->result->Success) {
         $CreateStatus = "Account created for " . $gFullName . "<br>";
         //If we have the id to the account then build a paymentmethod object
         $PaymentMethod[0] = makePaymentMethod($gFullName, $creditCardType, "4444111144441111", $gCreditCardExpirationMonth, $gCreditCardExpirationYear, $result2->result->Id);
         // $gCreditCardNumber
         // Now create the PaymentMethod in Zuora and attach it to the account
         //   the call returns the id of the paymentMethod to be passed to the account create
         $result = $instance->create($PaymentMethod);
         if (isset($result)) {
             //Sccessful payment method create
             if ($result->result->Success) {
                 $CreateStatus = $CreateStatus . "Payment Method created for " . $gFullName . "<br>";
                 // Now create a contact so we can make the account active
                 $RetContact[0] = makeContact($gFirstName, $gLastName, '', '', '', '', 'USA', '', '', '', $result2->result->Id);
                 $resultCreateContact = $instance->create($RetContact);
                 if ($resultCreateContact->result->Success) {
                     //createMessage($resultCreateContact);
                     //Now update the account to active
                     $RetAcct[0] = makeUpdateAccount($result2->result->Id, 'Active', $resultCreateContact->result->Id);
                     $CreateStatus = $CreateStatus . "ID: " . $RetAcct[0]->Id . "<br>";
                     $resultUpdate = $instance->update($RetAcct);
                     //Now create a Subscription
                     $subscriptionName = "New Signup - From Wellbeing(" . date('m/d/Y h:i:s') . ")";
                     //print $_SESSION['PhysicianPassedIn']  . " - " . $_SESSION['URLLoc'];
                     $subscription = makeSubscription($subscriptionName, null, $gFullName, date('m/d/Y'), $_POST['Docs'], $_SESSION['URLLoc'], $_POST['SalesRep'], $_POST['StartDate']);
                     $gsubscriptionID = $subscription->Id;
                     $zSubscriptionData = makeSubscriptionData($subscription, $chargeIds, $rateplancharges, $rateplanId);
                     $zSubscribeOptions = new Zuora_SubscribeOptions(false, false);
                     // $result = $instance->PMD_CreateAcct($account, $zSubscriptionData);