Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    zaid_86
    Guest

    Exclamation Account opening API / PHP

    Hello,
    I am integrating to integrate the vertex API to open real account in PHP,
    here is part of my code:

    PHP Code:
            $ret_client $api_obj->CreateClient($parent_username$first_name$second_name$third_name$last_name$username$password$phone$fax$mobile$tel_pass$pob,$country$email$address$show_as_demo$read_only);        
            
            if(
    $ret_client == self::CREATE_CLIENT_SUCCESSFULL){ //successfull, works
            
                
    $account_id = (int)$account_id//input from the user
                
    $account_type 1;
                
    $init_margin  100.00//margin is double
                
    $is_DemoAccount false;
                
    $is_LockedAccount false;
                
    $DontLiquidate false;
                        
                
    $ret $api_obj->CreateAccount($username$account_id$account_type$init_margin$is_DemoAccount$is_LockedAccount$DontLiquidate);

                if(
    $ret==self::CREATE_ACCOUNT_RESULT_SUCCESS){
                    return array(
    'success'=>true'login'=>$account_id'password'=>$password);
                }else{
                    return array(
    'success'=>false'error_reason'=>self::$create_account_results_arr[$ret]);   
                }
            }else{
                return array(
    'success'=>false'error_reason'=>self::$create_client_results_arr[$ret_client]);   
            } 
    as shown in the code, I am trying to do the following:

    1- create client using
    PHP Code:
            $ret_client $api_obj->CreateClient($parent_username,  $first_name$second_name$third_name$last_name$username,  $password$phone$fax$mobile$tel_pass$pob,$country$email,  $address$show_as_demo$read_only); 
    and it returns "3" which is successfull code as I read in the API

    2- create account with the same username and account Id (account id will be entered by the website admin), in the following:
    PHP Code:
                $ret $api_obj->CreateAccount($username,  $account_id$account_type$init_margin$is_DemoAccount,  $is_LockedAccount$DontLiquidate); 
    but this call returns error code "3" which is 'No previlidges to create Account'

    I tried creating client and account using the backoffice software via the same credentials and it worked successfully,

    can anyone please help me why this happens?
    also I checked the backoffice software and none of the client or account has been created

  2. #2

    Default

    are you sure you are using the BAKCOFFICE username and its password that you have received them within the ISV email delivery not a client username and PWD?

  3. #3

    Default

    If you are using Backoffice username type it here in order to check its privileges please.

  4. #4
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Default Account opening

    Dear Zaid,



    In VertexFX ,We have two steps of validation.

    1- Local validation:

    Which ensure some internal conditions and standards, Then sends request to the server side.
    If the result is successful that mean your request sent to the server.

    2- Server Validation:

    Which ensure the rest of internal conditions and standards, Then sends the result of request to the client side using an event.


    ------------------------------------------------------------------------


    Samples:

    When you send login request using "Login()" sub procedure you must wait the event, That will tell you the result of your request.

    Code:
    Public WithEvents m_oBOAPI As CVertexFXBOAPI
    Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
            m_oBOAPI.SetLoginInfo(Zaid, ZaidPW,IP, Val(Port))
            m_oBOAPI.Login()
    End Sub

    In login case you must wait AllDataAreLoaded event, That tell me the API loads all data after calling the login method .

    Code:
     Private Sub m_oBOAPI_AllDataAreLoaded() Handles m_oBOAPI.AllDataAreLoaded
          MsgBox("All Data Are Loaded")
      End Sub
    OR InvalidUsernamePassword

    Code:
    Private Sub m_oBOAPI_InvalidUsernamePassword() Handles m_oBOAPI.InvalidUsernamePassword
            MsgBox("Invalid User Name Password")
        End Sub
    ------------------------------------
    In your case:

    CreatClient function returns to you the result of local validation( If your request sent to the server or not).


    Code:
     Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
            Dim transtag As String = TxtUsername.Text
           m_oBOAPI.CreateClient(TxtParentUsrname.Text, TxtFName.Text, TxtSecName.Text, TxtThirdName.Text, TxtFamilyName.Text, TxtUsername.Text, TxtPassword.Text, Val(TxtPhone.Text), TxtFax.Text, Val(TxtMobile.Text), TxtTelPwd.Text, TxtPOB.Text, TxtCountry.Text, TxtEmail.Text, TxtAddress.Text, chkShwDemoClient.Checked, chkReadOnly.Checked, transtag)
        End Sub

    You must wait the server result using this event :

    Create Client Result

    Code:
     Private Sub m_oBOAPI_CreateClientResult(ByRef Result As VertexFXBOAPI10.CreateClientResultEnum, ByRef tag As String) Handles m_oBOAPI.CreateClientResult
             If (Result = CreateClientResultEnum.SuccessfulClientResult) Then
             MsgBox("Successful Result")
            Else
              MsgBox("Unsuccessful Result")
            End If
        End Sub


    Note:

    Make sure that AllDataAreLoaded event was invoked -To load all dealer privilege- before use any method except " Login(),SetLoginInfo() "

  5. #5
    zaid_86
    Guest

    Default

    Hello SVRMGR,

    Quote Originally Posted by SVRMGR View Post
    If you are using Backoffice username type it here in order to check its privileges please.
    here is the credentials upon your request:
    PHP Code:
     $api_obj     = new \COM("VertexFXBOAPI10.CVertexFXBOAPI");
            
    $username     'amro';
            
    $password     '1212';
            
    $server_ip     "184.173.64.45";
            
    $port         4401

  6. #6
    zaid_86
    Guest

    Default

    Hello SVRMGR,

    Quote Originally Posted by SVRMGR View Post
    are you sure you are using the BAKCOFFICE username and its password that you have received them within the ISV email delivery not a client username and PWD?
    please find the credentials I am using

    PHP Code:
     $api_obj     = new \COM("VertexFXBOAPI10.CVertexFXBOAPI");
            
    $username     'amro';
            
    $password     '1212';
            
    $server_ip     "184.173.64.45";
            
    $port         4401

  7. #7

    Default

    Dear Zaid

    Please contact your dealing room and ask them to give you enough privileges. You do not have "Create Account" privilege at your account.. ask for also "create client" and see what other privs you need and request them please

  8. #8

    Default

    You can also register at our ISV partnership program as third party developer and you will get full demo back office with enough privileges for testing purposes, you can use the sent UN and PWD and our own DEMO testing server and port.. if you are interested use this link http://www.hybrid-solutions.com/sale...v-program.html

  9. #9
    zaid_86
    Guest

    Default

    Thank you very much SVRMGR,
    I will ask for more privileges from the trading room

    and I have registered for full demo backoffice through the link provided

  10. #10
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Post Is there any other problems ?

    Dear Zaid,

    Do you still facing problems and difficulties?

  11. #11
    zaid_86
    Guest

    Default

    Hello h.abukrayem,
    Quote Originally Posted by h.abukrayem View Post
    Do you still facing problems and difficulties?
    the problem was that I don't check AllDataAreLoaded event in php,

    I am still trying to get a way to catch the COM events in PHP,

    I will post any update..


    Thanks

  12. #12
    zaid_86
    Guest

    Default Events are not being fired

    Hello,
    Now I have a problem that the events are not being fired in PHP,

    so I have wrote vb.net code just to test the event, but its not being fired also in vb.net code

    Code:
    Imports VertexFXBOAPI10
    
    
    Public Class Form1
        Public WithEvents m_oBOAPI As CVertexFXBOAPI = New CVertexFXBOAPI
        Private signed_in As Boolean
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim username As String
            Dim password As String
            Dim server_ip As String
            Dim server_port As Integer
    
            username = "XXXX"
            password = "XXXXXX"
            server_ip = "184.173.64.45"
            server_port = 4401
    
    
            m_oBOAPI.SetLoginInfo(username, password, server_ip, Val(server_port))
            m_oBOAPI.Login()
    
            Label1.Text = "Logging in..."
        End Sub
    
        Private Sub m_oBOAPI_AllDataAreLoaded() Handles m_oBOAPI.AllDataAreLoaded
            MsgBox("All Data Are Loaded")
            signed_in = True
    
        End Sub
    
        Private Sub m_oBOAPI_InvalidUsernamePassword() Handles m_oBOAPI.InvalidUsernamePassword
            MsgBox("Invalid User Name Password")
            signed_in = False
        End Sub
    
    End Class
    in the code login() method is called in the api, and label text is changed accordingly
    but no event is triggered after that...

    can you check what is wrong with my code?


    thanks
    Last edited by zaid_86; 07-02-2013 at 07:29 AM. Reason: hiding username/password credentials from the code

  13. #13
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Question Under test

    Dear Zaid,


    Are you sure that the IP address is correct?
    Are you register DLLs in System32 ?
    What is your operating system?

    Any way,Your code is under testing now, I will update you soon, Please standby
    Last edited by Hassan-HS; 07-02-2013 at 08:41 AM.

  14. #14
    zaid_86
    Guest

    Default

    Hello h.abukrayem,
    here is the information you requested

    Quote Originally Posted by h.abukrayem View Post
    Are you sure that the IP address is correct?
    yes, I have verified the IP address and its correct one, since LogedOn attribute value changes if I checked after a while, but the event is not fired..

    Quote Originally Posted by h.abukrayem View Post
    Are you register DLLs in System32 ?
    yes I did,
    I have registered VertexFXClientAPI10.0.8.dll and VertexFXBOAPI10.0.10.dll
    is there any other DLL I should register?

    Quote Originally Posted by h.abukrayem View Post
    What is your operating system?
    Windows Server 2008 R2 Standard

  15. #15
    Administrator Hassan-HS's Avatar
    Join Date
    Jun 2013
    Posts
    795

    Lightbulb Required BOAPI DLLs

    Required BOAPI DLLs :


    VertexTradingBOAPI10.0.10.dll
    VertexFXBOAPI10.0.10.dll
    HSClientBOAPI10.0.10.dll
    HSGeneralDLLBOAPI10.0.10.dll

    Please disable : Data Execution Prevention (DEP), Please read this article

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Account registration API
    By somaya in forum VertexFX API/VTL Forum
    Replies: 16
    Last Post: 09-12-2013, 08:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •