Example #1
0
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
require_once dirname(__FILE__) . '/killbill-client-php/lib/killbill.php';
include_once dirname(__FILE__) . '/includes/client.php';
session_start();
$account_created = null;
$account_updated = null;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $accountData = new Killbill_Account();
    $accountData->name = $_POST['name'];
    $accountData->email = $_POST['email'];
    $accountData->currency = $_POST['currency'];
    $accountData->paymentMethodId = null;
    $accountData->address1 = $_POST['address1'];
    $accountData->address2 = $_POST['address2'];
    $accountData->state = $_POST['state'];
    $accountData->country = $_POST['country'];
    $accountData->phone = $_POST['phone'];
    $accountData->length = strlen($accountData->name);
    $accountData->timeZone = 'UTC';
    //$_POST['timeZone'];
    if (!isset($_SESSION['accountId'])) {
        // Create the account
        // The external key is not used in this example
Example #2
0
/**
 * Load the user account
 *
 * @return account object
 */
function loadAccount($tenantHeaders)
{
    $account = new Killbill_Account();
    $account->accountId = $_SESSION['accountId'];
    return $account->get($tenantHeaders);
}