Please example of custom or external BOI/ProvideX code to add credit card to existing customer - Vault Sage Exchange

SOLVED

I want to write a little C# app where data entry can quickly add credit cards to existing customers.

This app would reside on a machine that has the Sage 100 client installed - so I would use the client's MAS90 folder to execute BOI/ProvideX methods AND would use the merchant id/key to hook up to the vault / Sage exchange / payment solutions.  I would not see the Sage Exchange POP up window

I know I must utilize customer number, card type, expiration date and the like...

Exactly how do I generate the GUID OR send the data to the vault and return the CreditCardGUID? How do I save a new credit card to Sage 100 AND the vault properly?

Please may I have some clear examples of just this - add a credit card to an EXISTING customer? It would be so wonderful!!

  • 0

    Old function currently in use to encrypt the credit card using BOI.  This works (and is still is in production for our MAS 200 4.5).  The main thing to know is the function name: “nCreditCardEncrypt”  If I did not know that I could never have gotten this to operate.  I need to know the new function names and types for adding a card to the Vault! 

           static int pvxEncryptCard(object oBus, string sCardIn, out string sEncryptOut, out string LastErrorMsg)
            {

                int retVal = 0;
                string sEncryptCard = "";
                System.Reflection.ParameterModifier pmods = new System.Reflection.ParameterModifier(2);
                pmods[0] = true;
                pmods[1] = true;
                System.Reflection.ParameterModifier[] pMods = new System.Reflection.ParameterModifier[] { pmods };
                object[] Params = new object[] { sCardIn, sEncryptCard }; 

                retVal = (int)oBus.GetType().InvokeMember("nCreditCardEncrypt", System.Reflection.BindingFlags.InvokeMethod, null, oBus, Params, pMods, null, null); 

                sEncryOut = Params[1].ToString();
                LastErrorMsg = pvxLastError(oBus, retVal);
                return retVal; 
            }

  • 0 in reply to SageAcolyte

    I decided just to try everything I can to "discover" the function names. My old function of "nCreditCardEncrypt" works fine for MAS 200 4.5 but is not included in the Sage 100 5.4 system. So, I get a COM exception stating unknown name (of the function)

    I can do other functions that are in both 4.5 and 5.4 such as "nSetValue" and it will not fail. So I tried the following (some I found online)  NOTHING I TRIED FOR VAULT/EXCHANGE WORKS.  Please help!

    ProcessVault = COM exception stating unknown name
    nProcessVault = COM exception stating unknown name
    AddCreditCardToVault = COM exception stating unknown name
    nAddCreditCardToVault = COM exception stating unknown name
    VaultBankcardAuthOnly = COM exception stating unknown name
    nVaultBankcardAuthOnly = COM exception stating unknown name
    nSetValue = works in both 4.5 and 5.4
    nSetUser = works in both 4.5 and 5.4
    nSetCompany = works in both 4.5 and 5.4
    nSetDate = works in both 4.5 and 5.4
    nSetModule = works in both 4.5 and 5.4
    nLookupTask = works in both 4.5 and 5.4
    nSetProgram = works in both 4.5 and 5.4
    NewObject = works in both 4.5 and 5.4


    Here is the error but it just means I don't have the "Secret" function names...

    System.Runtime.InteropServices.COMException was caught
    Message=Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))
    Source=mscorlib
    ErrorCode=-2147352570
    StackTrace:
    at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
    at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)

  • 0 in reply to SageAcolyte

    OK so the *.pvc files are used by the Sage BOI to perform functions... I searched for any pvc with "creditCard" but I dont have any documentation.  Would I use AR_CreditCard?  That is what I am currently attempting to use but I dont know its internal functions.  What about CI_CreditCardGUID_val?  I should think that something like AR_CreditCard would USE CI_CreditCardGUID_val in order to talk to the Exchange-Vault utilizing the Virtual Terminal ID (Mecrhant ID) and Merchant Key I have stored in the system (The system can use the SAGE UI to post credit card transactions just fine)

    AR_CreditCardCommonEntry.pvc
    AR_CreditCard.pvc
    AR_CreditCardCommon.pvc
    AR_CreditCardSPS.pvc
    CI_CreditCardConversion.pvc
    CI_CreditCardGUID_val.pvc
    CI_CreditCardIDUI_val.pvc
    CI_CreditCardID_val.pvc

  • +1 in reply to SageAcolyte
    verified answer

    SUCCESS!

    Sage\Common Components\wsVault.dll

    add as reference in your project.  Then in your code, "using wsVault;"

    after adding this library, you can see a list of functions.  Does anyone have any information related to this?  I looked until I found the correct function under "wsVault.net.sagepayments.www" and then inside of "wsVault".  It would be nice to have some documentation

    I was able to successfully submit the credit card number and expiration to the Sage Exchange Vault and return the GUID.

    I was able to to avoid the extra Vault UI. I had to - as our custom UI is highly optimized and this Vault screen throws off the whole data entry flow.

    DataSet vaultReturnDS;
    wsVault.net.sagepayments.www.wsVault sageVault = new wsVault.net.sagepayments.www.wsVault();
    vaultReturnDS = sageVault.INSERT_CREDIT_CARD_DATA(M_ID, M_KEY, CARDNUMBER, EXPIRATION_DATE);

    The below is the return from sagepayments Vault: the GUID, if successful, and message - in a DataSet.  I could not find an answer to this issue online.  I called Sage and Blytheco and there was no answer there.  There are a couple questions posted to this forum.  I will update them with this link. (of course the below information was using a 'fake' credit card and test vault key and id)