# MTCreditCardAccount

This object supports ConferenceExpress. It can also be used outside the context of ConferenceExpress to add MetraTech and Payment Server accounts.

## Program ID

MTCreditCardAccount.CreditCardAccount.1

## MTCreditCardAccount Methods

AddAccounts | This method meters AccountCreation to Billing Server and AddAccount to Payment Server. It meters AccountCreation first to retrieve an account identifier. Subsequently, it includes the account identifier in the session metered to Payment Server. DTC ensures transactional integrity.
AddGenericAccounts | AddGenericAccounts has the same functionality as AddAccounts, except it accepts more parameters which AddAccounts hard-codes internally.
FindAccount | This method searches for an existing account in the Payment Server.
GetEmailAddress | ConferenceExpress invokes this method to retrieve the email address for existing subscribers.
HashString | The MetraTech account username for ConferenceExpress users is a hash of the account identifier, the last four digits of the credit card number, and the credit card type.
Initialize | The initialization steps this method performs.
PreAuthConference | This method meters a pre-authorization request to Payment Server. ConferenceExpress invokes this method from Screen 3 after a new account has been added.

## MTCreditCardAccount Enumerated Types

MTCreditCardType | List of available credit card types (e.g. Mastercard and Visa).

## Example

Example to be provided in a future release of this online help system.

# Method Detail

## FindAccount

This method searches for an existing account in Payment Server. ConferenceExpress uses the result of this lookup to determine whether to prompt the subscriber for new account information. ConferenceExpress invokes this method from Screen 1.

### Visual Basic Syntax

Function FindAccount(CreditCardType As MTCreditCardType, CreditCardNumber As String, ExpirationDateMonth As Long, ExpirationDateYear As Long) As Long

### C++ Syntax

HRESULT FindAccount([in] MTCreditCardType CreditCardType,
[in] BSTR CreditCardNumber,
[in] long ExpirationDateMonth,
[in] long ExpirationDateYear,
[out,retval] long* lAccID);

### Arguments

CreditCardType

The type of the card. For example, MasterCard, Visa, American Express, etc. The legal values are listed in the enumerated type, MTCreditCardType.

CreditCardNumber

ExpirationDateMonth

ExpirationDateYear

### Return Value

This method returns the account identifier. A value of -1 indicates an error.

### Errors Raised

CREDITCARDACCOUNT_ERR_SESS_INIT_PROPERTY_FAILED (0xE18F0002L)

Error occurred adding properties to the session.

CREDITCARDACCOUNT_ERR_SESS_CLOSE_FAILED (0xE18F0003L)

Metering error.

## Hashstring

The MetraTech account username for ConferenceExpress users is a hash of the account identifier, the last four digits of the credit card number, and the credit card type.

### Visual Basic Syntax

Function HashString(StringToBeHashed As String) As String

### C++ Syntax

HRESULT HashString([in] BSTR StringToBeHashed, [out,retval] BSTR* HashedString);

### Arguments

StringToBeHashed

This string is the concatenation of the account identifier, last four digits of the credit card number, and the credit card type.

### Return Value

Returns the MD5 hash value.

### Errors Raised

CREDITCARDACCOUNT_ERR_HASHING_FAILED (0xE18F0004L)

Unable to hash the concatenated string.

## Initialize

The initialization this method performs:

- Retrieves the location of the Billing and Payment Servers.

- Initializes the metering objects

- Retrieves GetWhereAbouts information when configured to use DTC.

### Visual Basic Syntax

Sub Initialize()

### C++ Syntax

HRESULT Initialize();

### Return Value

Returns an HRESULT. The values are defined in creditcardaccount_err.mc1.

### Errors Raised

This method does not raise exceptions. However, it does catch exceptions and then reraises the exception to the caller.

## PreAuthConference

This method meters a pre-authorization request to Payment Server. ConferenceExpress invokes this method from Screen 3 after a new account has been added.

### Visual Basic Syntax

Function PreAuthConference(NumParticipants As Long, ConferenceName As String, AccountID As Long, CreditCardType As MTCreditCardType, CreditCardLast4 As String, Currency As String, ScheduledDuration As Long) As Double

### C++ Syntax

HRESULT PreAuthConference([in] long NumParticipants,
[in] BSTR ConferenceName,
[in] long AccountID,
[in] MTCreditCardType CreditCardType,
[in] BSTR CreditCardLast4,
[in] BSTR Currency,
[in] long ScheduledDuration,
[out,retval] double* PreAuthAmount);

### Arguments

NumParticipants

Number of participants in the conference call.

ConferenceName

This is the name entered by the subscriber setting up the call.

AccountID

The account identifier is a numeric value that represents a subscriber.

CreditCardType

The type of the card. For example, MasterCard, Visa, American Express, etc. The legal values are listed in the enumerated type, MTCreditCardType.

CreditCardLast4

The last four digits of the credit card number. This is a card identifying attribute. The purpose is to identify the card while protecting the card number.

Currency

The amount qualifier.

ScheduledDuration

Conference call estimation time in minutes. Used in generating the quotation amount.

### Return Value

The quotation amount. This is the amount used in the pre-authorization credit card transaction.

### Errors Raised

CREDITCARDACCOUNT_INVALID_CREDIT_CARD_TYPE (0xE18F0005L)

Preliminary card validation failed. For example, card number does not match the card type or invalid number of digits in the entered card number.

CREDITCARDACCOUNT_ERR_SESS_INIT_PROPERTY_FAILED (0xE18F0002L)

Error occurred adding properties to the session.

CREDITCARDACCOUNT_ERR_SESS_CLOSE_FAILED (0xE18F0003L)

Metering error.

## AddGenericAccounts

This method meters AccountCreation to the Billing Server and AddAccount to the Payment Server. This method meters AccountCreation first to retrieve an account identifier. Subsequently, it includes the account identifier in the session metered to Payment Server. DTC ensures transactional integrity.

This method has the same functionality as AddAccounts, except it accepts more parameters which AddAccounts hard-codes internally.

### Visual Basic Syntax

Function AddGenericAccounts(Email As String, HashedUserName As String, TelephoneNumber As String, Address1 As String, Address2 As String, Address3 As String, City As String, State As String, Zip As String, Country As String, TimezoneID As Long, Name_Space As String, CreditCardType As MTCreditCardType, CreditCardNumber As String, ExpirationDateMonth As Long, ExpirationDateYear As Long, StartDateIssueNumber As String, Password As String, FullName As String, BoolAddContact As Boolean, BoolAddPayment As Boolean, ActionType As String, Language As String, DayOfMonth As Long, AccountType As String, TaxExemptFlag As String, TariffID As String, TimezoneOffset As Double, Company As String, Fax As String, MiddleInitial As String, UsageCycleType As String, PaymentMethod As Long) As Long

### C++ Syntax

HRESULT AddGenericAccounts([in] BSTR Email,
[in] BSTR HashedUserName,
[in] BSTR TelephoneNumber,
[in] BSTR Address1,
[in] BSTR Address2,
[in] BSTR Address3,
[in] BSTR City,
[in] BSTR State,
[in] BSTR Zip,
[in] BSTR Country,
[in] long TimezoneID,
[in] BSTR Name_Space,
[in] MTCreditCardType CreditCardType,
[in] BSTR CreditCardNumber,
[in] long ExpirationDateMonth,
[in] long ExpirationDateYear,
[in] BSTR StartDateIssueNumber,
[in] BSTR Password,
[in] BSTR FullName,
[in] VARIANT_BOOL BoolAddContact,
[in] VARIANT_BOOL BoolAddPayment,
[in] BSTR ActionType,
[in] BSTR Language,
[in] long DayOfMonth,
[in] BSTR AccountType,
[in] BSTR TaxExemptFlag,
[in] BSTR TariffID,
[in] double TimezoneOffset,
[in] BSTR Company,
[in] BSTR Fax,
[in] BSTR MiddleInitial,
[in] BSTR UsageCycleType,
[in] long PaymentMethod,
[out,retval] long* lAccountID);

### Arguments

HashedUserName

The username for ConferenceExpress subscribers is a hash of the concatenation of account identifier, last four digits of credit card number, and the credit card type.

PhoneNumber

The subscriber's phone number.

Address1

The billing address the cardholder specified during the credit card application process. AVS uses this field to authenticate the cardholder.

Address2

Continuation of address.

Address3

Continuation of address.

City, State, Zip, Country

The city, state, zip code, and country the cardholder specified during the credit card application process. AVS uses this field to authenticate the cardholder.

TimezoneID

Bridge location.

Name_space

MetraTech account namespace.

CreditCardType

The type of the card. For example, MasterCard, Visa, American Express, etc. The legal values are listed in the enumerated type, MTCreditCardType.

CreditCardNumber

ExpirationDateMonth

ExpirationDateYear

StartDateIssueNumber

Date in addition to the embossed expiration date that appears on the front of UK domestic cards.

Password

MetraTech account password.

Fullname

The name as it appears on the card.

BoolAddContact

Indicates whether to add a MetraTech account.

BoolAddPayment

Indicates whether to add a Payment Server account.

ActionType

Used to indicate if you want to create an account, contact, or both.

Language

The language associated with the account.

DayOfMonth

The day of the month the user wants to be billed on.

AccountType

Account type integer value:
1 = Bill-To
2 = Ship-To

TaxExemptFlag

Flag indicating whether the account is tax exempt.

TariffID

The tariff identifier.

TimezoneOffset

Timezone offset for the account; usually corresponds to the timezone ID.

Company

Company name (if any) associated with the account.

Fax

Fax number (if any) for the account.

MiddleInitial

The user's middle initial as it appears on the card.

UsageCycleType

The usage cycle type (for example Monthly) associated with the account.

PaymentMethod

Payment method associated with the account; CreditOrACH or CashOrCheck

### Return Value

This method returns the account identifier. A value of -1 indicates an error.

### Errors Raised

CREDITCARDACCOUNT_ERR_ACCOUNT_ADDITION_FAILED (0xE18F0008L)

Unable to add to DTC transaction.

CREDITCARDACCOUNT_INVALID_CREDIT_CARD_TYPE (0xE18F0005L)

This credit card type is not supported at this time.

CREDITCARDACCOUNT_ERR_SESS_INIT_PROPERTY_FAILED (0xE18F0002L)

Error occurred adding properties to the session.

CREDITCARDACCOUNT_ERR_SESS_CLOSE_FAILED (0xE18F0003L)

Metering error.

## AddAccounts

This method meters AccountCreation to the Billing Server and AddAccount to the Payment Server. This method meters AccountCreation first to retrieve an account identifier. Subsequently, it includes the account identifier in the session metered to Payment Server. DTC ensures transactional integrity.

### Visual Basic Syntax

Function AddAccounts(Email As String, HashedUserName As String, TelephoneNumber As String, Address1 As String, Address2 As String, Address3 As String, City As String, State As String, Zip As String, Country As String, TimezoneID As Long, Name_Space As String, CreditCardType As MTCreditCardType, CreditCardNumber As String, ExpirationDateMonth As Long, ExpirationDateYear As Long, StartDateIssueNumber As String, Password As String, FullName As String, BoolAddContact As Boolean, BoolAddPayment As Boolean) As Long

### C++ Syntax

HRESULT AddAccounts([in] BSTR Email,
[in] BSTR HashedUserName,
[in] BSTR TelephoneNumber,
[in] BSTR Address1,
[in] BSTR Address2,
[in] BSTR Address3,
[in] BSTR City,
[in] BSTR State,
[in] BSTR Zip,
[in] BSTR Country,
[in] long TimezoneID,
[in] BSTR Name_Space,
[in] MTCreditCardType CreditCardType,
[in] BSTR CreditCardNumber,
[in] long ExpirationDateMonth,
[in] long ExpirationDateYear,
[in] BSTR StartDateIssueNumber,
[in] BSTR Password,
[in] BSTR FullName,
[in] VARIANT_BOOL BoolAddContact,
[in] VARIANT_BOOL BoolAddPayment,
[out,retval] long* lAccountID);

### Arguments

HashedUserName

The username for ConferenceExpress subscribers is a hash of the concatenation of account identifier, last four digits of credit card number, and the credit card type.

PhoneNumber

The subscriber's phone number.

Address1

The billing address the cardholder specified during the credit card application process. AVS uses this field to authenticate the cardholder.

Address2

Continuation of address.

Address3

Continuation of address.

City, State, Zip, Country

The city, state, zip code, and country the cardholder specified during the credit card application process. AVS uses this field to authenticate the cardholder.

TimezoneID

Bridge location.

Name_space

MetraTech account namespace.

CreditCardType

The type of the card. For example, MasterCard, Visa, American Express, etc. The legal values are listed in the enumerated type, MTCreditCardType.

CreditCardNumber

ExpirationDateMonth

ExpirationDateYear

StartDateIssueNumber

Date in addition to the embossed expiration date that appears on the front of UK domestic cards.

Password

MetraTech account password.

Fullname

The name as it appears on the card.

BoolAddContact

Indicates whether to add a MetraTech account.

BoolAddPayment

Indicates whether to add a Payment Server account.

### Return Value

This method returns the account identifier. A value of -1 indicates an error.

### Errors Raised

CREDITCARDACCOUNT_ERR_ACCOUNT_ADDITION_FAILED (0xE18F0008L)

Unable to add to DTC transaction.

CREDITCARDACCOUNT_INVALID_CREDIT_CARD_TYPE (0xE18F0005L)

This credit card type is not supported at this time.

CREDITCARDACCOUNT_ERR_SESS_INIT_PROPERTY_FAILED (0xE18F0002L)

Error occurred adding properties to the session.

CREDITCARDACCOUNT_ERR_SESS_CLOSE_FAILED (0xE18F0003L)

Metering error.

## GetEmailAddress

ConferenceExpress invokes this method to retrieve the email address for existing subscribers. This is not necessary for new customers because the email address is input in Screen 2. ConferenceExpress sends confirmation information to the subscriber after scheduling the conference.

### Visual Basic Syntax

Function GetEmailAddress(AccountID As Long) As String

### C++ Syntax

HRESULT GetEmailAddress([in] long AccountID, [out,retval] BSTR* Email);

### Arguments

aingAccountId

The account identifier is a numeric value that represents a subscriber.

### Return Value

Returns a _bstr_t containing the email address.

#

# Enumerated Types Detail

## MTCreditCardType

MT_NOTSELECTED = 0
MT_VISA = 1
MT_MASTERCARD = 2
MT_AMERICAN_EXPRESS = 3
MT_DISCOVER = 4
MT_JCB = 5
MT_CARTEBLANCHE = 6
MT_DINERS = 7
MT_VISA_PCARD = 8
MT_MASTERCARD_PCARD = 9
MT_AMERICAN_EXPRESS_PCARD = 10