home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-11 | 4.8 KB | 131 lines | [TEXT/KAHL] |
- // *******************************************************************
- // Copyright 1995 Digital Money, Inc.
- // You may use this source code in your own applications.
- //
- // This is a sample Digital Money Control Block (DMCB) initialization
- // for use in version 4.8 of the Digital Money AutoPay software.
- // See AutoPay manual for more information.
- // This code released April 5, 1995.
- // *******************************************************************
-
-
- #include "DMIdeveloper.h.c"
-
- void initDigitalMoney (digiMonBlock *myDMCB)
- {
- short i;
-
- // General settings
-
- strcpy(myDMCB->programName,"Guy Friday 1.22");
- myDMCB->returnSerialNum=1; // 1=true; 0=false
- myDMCB->areAdditionalItemsForSale=1; // 1=true; 0=false
- strcpy(myDMCB->programPassword,"cecil");
- strcpy(myDMCB->programID,"100");
- strcpy(myDMCB->programSource,"AOL");
-
-
- // Security
-
- // This is a secret string of ascii characters used for encryption.
- // You should keep this key confidential, even among your own employees.
- // The string is comprised of visible ASCII characters - i.e. don't
- // use control characters. But punctuation is okay.
-
- strcpy(myDMCB->encodeMeth,"GuyFridayEncodeMeth2");
-
- // Screen Text
-
- // You can alter the text that appears on the top of each dialog box displayed
- // by Digital Money. Normally, Digital Money reads "styled text" resources
- // from your resource file, but if you want to change the text on the fly, so
- // to speak, you can just pass a pointer leading to the appropriate
- // text and style handle. Note that you must first initialize all 10 text pointers
- // to zero so that Digital Money can tell the difference between a zero pointer
- // (i.e. you don't want to replace the default text in the resource file) and a
- // non-zero pointer (you *do* want to change the text). See below for an example.
-
- for (i=0; i<=9; i++)
- {
- myDMCB->screenText[i]=0;
- }
-
- // Next be sure to allocate memory for any pointer that you want Digital Money
- // to use. For instance, to change the text that appears on the opening screen,
- // set the screenText[0] pointer, like this:
-
-
-
- // ...for a complete list of which array item corresponds to which dialog,
- // see printed docs.
-
- // The users name
-
- // If you already know the users name for some reason, you should send it
- // to the DM Module, so that DM doesn't have to ask the user for it. If you
- // don't know it, then **be sure** to set the usersName string to null. In
- // any case, if the user successfully completes enough of the DM transaction,
- // his name will be returned to you in this string, should you want to use it,
- // for registration splash screens or whatever.
-
- strcpy(myDMCB->usersName,""); // I don't know it, so it to null!
-
- // Your Product Catalog
-
- myDMCB->numItemsInCatalog=2;
-
- // first, initialize pointers for each item in catalog
-
- for (i=0; i<=myDMCB->numItemsInCatalog-1; i++) // notice first item is item #0
- {
- myDMCB->catalogItem[i]=(catalogItemType *)NewPtr(sizeof(catalogItemType));
- }
-
- strcpy(myDMCB->catalogItem[0]->name,"Register Guy Friday 1.2");
- strcpy(myDMCB->catalogItem[0]->prodCode,"910001");
- myDMCB->catalogItem[0]->minPurchase=1;
- myDMCB->catalogItem[0]->maxPurchase=1;
- myDMCB->catalogItem[0]->price=24.00;
- myDMCB->catalogItem[0]->numVarCodes=0;
- myDMCB->catalogItem[0]->shUSA=0;
- myDMCB->catalogItem[0]->shFOR=0;
-
- strcpy(myDMCB->catalogItem[1]->name,"Digital Money tee-shirt");
- strcpy(myDMCB->catalogItem[1]->prodCode,"710002");
- myDMCB->catalogItem[1]->minPurchase=1;
- myDMCB->catalogItem[1]->maxPurchase=10;
- myDMCB->catalogItem[1]->price=15;
- myDMCB->catalogItem[1]->numVarCodes=2;
- strcpy(myDMCB->catalogItem[1]->varCode1,"LARGE");
- strcpy(myDMCB->catalogItem[1]->varCode2,"X-LARGE");
- myDMCB->catalogItem[1]->shUSA=3;
- myDMCB->catalogItem[1]->shFOR=7;
-
-
- // preselect items to be purchased
- // explanation: when the Digital Money module takes control of
- // the user interface, what items do you want to be preselected
- // for purchase by the user? If nothing, then set the following to 0.
-
- myDMCB->numItemsPrepurchased=1;
-
- // Notice how the description of the preselected item precisely matches
- // the associated item in the product catalog. Please be careful and do
- // the same!
-
- // The only exception is the "editable" flag, which can be set to false
- // on a pre-selected item, even if the catalog doesn't match this. This
- // means the user won't be able to remove or edit this preselected item.
-
- strcpy(myDMCB->prepurchaseItem[0].name,"Register Guy Friday 1.2");
- strcpy(myDMCB->prepurchaseItem[0].prodCode,"910001");
- strcpy(myDMCB->prepurchaseItem[0].varCode,"");
- myDMCB->prepurchaseItem[0].price=24.00;
- myDMCB->prepurchaseItem[0].quantity=1;
- myDMCB->prepurchaseItem[0].editable=1; // 1=true; 0=false
- myDMCB->prepurchaseItem[0].minPurchase=1;
- myDMCB->prepurchaseItem[0].maxPurchase=1;
- myDMCB->prepurchaseItem[0].shUSA=0;
- myDMCB->prepurchaseItem[0].shFOR=0;
-
- }