developer:soap-1.6:methods:movecustomer

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:soap-1.6:methods:movecustomer [2012/08/04 11:04] (current)
tem created
Line 1: Line 1:
 +<embed ..:​contents/>​====== moveCustomer ======
  
 +Move customer from one merchant to another.
 +
 +===== Description =====
 +
 +This method allows you to move a customer record from one merchant to another. ​ This method is only available to merchants who have a master user setup to access both accounts. ​  The move method copies the customer to new merchant and then deletes the original customer. ​ A new CustNum is assigned.
 +
 +
 +===== Syntax =====
 +
 +CustNum **moveCustomer** ( [[..:​objects:​ueSecurityToken]] FromToken, integer CustNum, [[..:​objects:​ueSecurityToken]] ToToken) ​
 +
 +
 +===== Arguments =====
 +
 +^Type   ​^Name ​  ​^Description ​  ^
 +|[[..:​objects:​ueSecurityToken]] |FromToken |Merchant security token: used to identify the  merchant ​ that the customer is being moved from.|
 +|integer |CustNum | The gateway assigned customer number for the the customer to be moved. |
 +|[[..:​objects:​ueSecurityToken]] |ToToken |Merchant security token: used to identify the merchant that the customer is being moved to.|
 +
 +
 +===== Return Value =====
 +
 +|Integer |Returns gateway assigned Customer Number of the new customer. |
 +
 +===== Examples =====
 +
 +==== Java ====
 +
 +This example uses the [[developer/​javalibrary|USAePay Java library]]. ​ For directions on how to install the library and create the token/​client objects, go to either the [[..:​howto:​javajaxrpc|Java JAX-RPC Howto]] or the [[..:​howto:​javajaxws|Java JAX-WS Howto]].
 +
 +<code java>
 +try {
 +  //Set CustNum to the customer number that you want to move.  "​merch2token" ​
 +  //​represents a token set up under the merchant the customer is being moved to.
 +  BigInteger CustNum = new BigInteger("​123456"​);​
 +  BigInteger NewCustNum = client.moveCustomer(token,​ CustNum, merch2token);​
 +
 +  System.out.println(NewCustNum);​
 +} catch (Exception e) {
 +    System.out.println("​Soap Exception: " + e.getMessage());​
 +}
 +</​code>​
 +
 +==== .NET VB ====
 +<code vb>
 +Dim client As usaepay.usaepayService = New usaepay.usaepayService
 +        Dim token1 As usaepay.ueSecurityToken
 +        Dim token2 As usaepay.ueSecurityToken
 +
 +        token1 = Me.CreateToken("​source key of the merchant1",​ "​1234"​)
 +        token2 = Me.CreateToken("​source key of the merchant2",​ "​1234"​)
 +
 +        Dim custNum As String
 +        custNum = "​103125"​
 +        Dim NewCust As String
 +
 +        NewCust = client.moveCustomer(token1,​ custNum, token2)
 +        MsgBox(NewCust)
 +</​code>​
 +
 +
 +==== .NET C# ====
 +For directions on how to set up the WSDL link and create the "​token"​ and "​client"​ variables, go to the [[..:​howto:​csharp|C Sharp .Net Soap How-to]].
 +<code c>
 + ​usaepay.ueSecurityToken totoken = new usaepay.ueSecurityToken();​
 +            usaepay.ueHash hash = new usaepay.ueHash();​
 +            string sourcekey = "NEW SOURCE KEY";
 +            string pin = "new pin";
 +            totoken.SourceKey = sourcekey;
 +
 +            hash.Type = "​md5";​
 +            hash.Seed = Guid.NewGuid().ToString();​
 +
 +            string prehashvalue = string.Concat(token.SourceKey,​ hash.Seed, pin);
 +            hash.HashValue = GenerateHash(prehashvalue);​
 +
 +            totoken.PinHash = hash;
 +
 +            string CustNum = "​89147";​
 +            string NewCust;
 +
 +            try
 +            {
 +                NewCust = client.moveCustomer(token,​ CustNum, totoken);
 +                MessageBox.Show(string.Concat(NewCust));​
 +            }
 +
 +            catch (Exception err)
 +            {
 +                MessageBox.Show(err.Message);​
 +            }
 +</​code>​
 +
 +===== Change History =====
 +
 +^ Version ^ Change ^
 +| [[developer:​soap-1.1:​methods:​movecustomer|1.1]] | Method added prior to soap-1.1 |
developer/soap-1.6/methods/movecustomer.txt ยท Last modified: 2012/08/04 11:04 by tem

Page Tools