The following functions are provided to allow the reseller to create/edit/get postcode software customer account details
The customer record represents the customer record we need to store, to allow us to make the appropriate returns to the royal mail.
Example code Public CO_TestAccount As Boolean = False 'Set to true for Test account. We will ignore any orders 'Posted to this account, and clear them after a few days Public CO_ID as long = 0 'This is used to uniquely identify Company record Public CO_COMPANY As String = "" 'A70 Company Name Public CO_Contact_Name As String = "" ‘50 Public CO_LINE1 As String = "" ‘A50 We require a Company name and address Public CO_LINE2 As String = "" ‘A50 As it is required by the Royal Mail Public CO_LINE3 As String = "" ‘A50 Public CO_TOWN As String = "" ‘50 Public CO_COUNTY As String = "" ‘50 Public CO_POSTCODE As String = "" ‘A12 Public CO_DataKey_For_Internal_use As String = ""'DataKey for employees to use Public CO_DataKey_For_Web_use As String = "" 'DataKey for Public facing web site Public CO_COUNTRY As String = "UK" Public CO_VATNO As String = "" ‘9 Public CO_Phone As String = "" ‘A30 Public CO_Fax As String = "" ‘A30 Public CO_PostcodeAreas As String = "" ‘A90 'Use comma to seperate each entry (30 max) ,be careful else will not work e.g. PE,NE,N Public CO_e_mail_address As String = "" 'We need this to allow login, but will not send any e-mails 'Leave balnk, and system will assign own unique address Public CO_Password As String = ""'For the account on our online system. Leave blank ‘For future use: Public CO_Spare_Flag1 As Boolean = False Public CO_Spare_Flag2 As Boolean = False Public CO_Spare_Flag3 As Boolean = False Public CO_Spare_String1 As String = "" Public CO_Spare_String2 As String = "" Public CO_Spare_String3 As String = "" Public CO_Spare_String4 As String = "" Public CO_Spare_String5 As String = "" Public CO_Spare_Num1 As Double Public CO_Spare_Num2 As Double Public CO_Spare_Num3 As Double
Public CO_TestAccount As Boolean = False 'Set to true for Test account. We will ignore any orders 'Posted to this account, and clear them after a few days Public CO_ID as long = 0 'This is used to uniquely identify Company record Public CO_COMPANY As String = "" 'A70 Company Name Public CO_Contact_Name As String = "" ‘50 Public CO_LINE1 As String = "" ‘A50 We require a Company name and address Public CO_LINE2 As String = "" ‘A50 As it is required by the Royal Mail Public CO_LINE3 As String = "" ‘A50 Public CO_TOWN As String = "" ‘50 Public CO_COUNTY As String = "" ‘50 Public CO_POSTCODE As String = "" ‘A12 Public CO_DataKey_For_Internal_use As String = ""'DataKey for employees to use Public CO_DataKey_For_Web_use As String = "" 'DataKey for Public facing web site Public CO_COUNTRY As String = "UK" Public CO_VATNO As String = "" ‘9 Public CO_Phone As String = "" ‘A30 Public CO_Fax As String = "" ‘A30 Public CO_PostcodeAreas As String = "" ‘A90 'Use comma to seperate each entry (30 max) ,be careful else will not work e.g. PE,NE,N Public CO_e_mail_address As String = "" 'We need this to allow login, but will not send any e-mails 'Leave balnk, and system will assign own unique address Public CO_Password As String = ""'For the account on our online system. Leave blank ‘For future use: Public CO_Spare_Flag1 As Boolean = False Public CO_Spare_Flag2 As Boolean = False Public CO_Spare_Flag3 As Boolean = False Public CO_Spare_String1 As String = "" Public CO_Spare_String2 As String = "" Public CO_Spare_String3 As String = "" Public CO_Spare_String4 As String = "" Public CO_Spare_String5 As String = "" Public CO_Spare_Num1 As Double Public CO_Spare_Num2 As Double Public CO_Spare_Num3 As Double
Important fields are shown in bold
Function Function CustomerCreate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Function CustomerCreate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Returns True if successful, else error in ErrorDescription$
Example code Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord .CO_COMPANY = Me.InpCustomerCompany.Text .CO_Contact_Name = Me.InpCompanyContact.Text .CO_LINE1 = Me.InpCustomerLines1.Text .CO_PostcodeAreas = Me.InpCustomerArea.Text .CO_TestAccount = True 'Set to true for Test account. ‘We will ignore any orders posted to this account, and clear them after a few days ‘You should populate all address fields, as we have to report them back to the ‘Royal Mail End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerCreate(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Account created") ‘Data returned which should be stored in your Database Me.InpCustomerID.Text = CustomerRecord.CO_ID Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use ‘or Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use End If
Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord .CO_COMPANY = Me.InpCustomerCompany.Text .CO_Contact_Name = Me.InpCompanyContact.Text .CO_LINE1 = Me.InpCustomerLines1.Text .CO_PostcodeAreas = Me.InpCustomerArea.Text .CO_TestAccount = True 'Set to true for Test account. ‘We will ignore any orders posted to this account, and clear them after a few days ‘You should populate all address fields, as we have to report them back to the ‘Royal Mail End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerCreate(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Account created") ‘Data returned which should be stored in your Database Me.InpCustomerID.Text = CustomerRecord.CO_ID Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use ‘or Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use End If
Function Function CustomerUpdate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Function CustomerUpdate(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Please Note:
Example code Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord .CO_ID = Me.InpCustomerID.Text 'Account ID to update .CO_COMPANY = Me.InpCustomerCompany.Text .CO_Contact_Name = Me.InpCompanyContact.Text .CO_LINE1 = Me.InpCustomerLines1.Text .CO_PostcodeAreas = Me.InpCustomerArea.Text ‘You should populate Company name and all address fields, as we have to ‘report them back to the Royal Mail End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerUpdate(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Account updated") ‘Data returned which should be stored in your Database Me.InpCustomerID.Text = CustomerRecord.CO_ID Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use ‘or Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use End If
Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord .CO_ID = Me.InpCustomerID.Text 'Account ID to update .CO_COMPANY = Me.InpCustomerCompany.Text .CO_Contact_Name = Me.InpCompanyContact.Text .CO_LINE1 = Me.InpCustomerLines1.Text .CO_PostcodeAreas = Me.InpCustomerArea.Text ‘You should populate Company name and all address fields, as we have to ‘report them back to the Royal Mail End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerUpdate(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Account updated") ‘Data returned which should be stored in your Database Me.InpCustomerID.Text = CustomerRecord.CO_ID Me.InpInternalDataKey.Text = CustomerRecord.CO_DataKey_For_Internal_use ‘or Me.InpWebDataKey.Text = CustomerRecord.CO_DataKey_For_Web_use End If
Function Function CustomerGet(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Function CustomerGet(ByVal Parameters$, ByRef CustomerRecord As CustRecord, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Example code Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord 'Get account by ID .CO_ID = Me.InpCustomerID.Text End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerGet(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else With CustomerRecord Me.InpInternalDataKey.Text = .CO_DataKey_For_Internal_use Me.InpWebDataKey.Text = .CO_DataKey_For_Web_use Me.InpCustomerID.Text = .CO_ID Me.InpCustomerCompany.Text = .CO_COMPANY Me.InpCompanyContact.Text = .CO_Contact_Name Me.InpCustomerLines1.Text = .CO_LINE1 Me.InpCustomerArea.Text = .CO_PostcodeAreas End With End If
Dim CustomerRecord As New CustomerPortal.CustRecord Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal With CustomerRecord 'Get account by ID .CO_ID = Me.InpCustomerID.Text End With Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use If Not CustomerPortal.CustomerGet(Parameters, CustomerRecord, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else With CustomerRecord Me.InpInternalDataKey.Text = .CO_DataKey_For_Internal_use Me.InpWebDataKey.Text = .CO_DataKey_For_Web_use Me.InpCustomerID.Text = .CO_ID Me.InpCustomerCompany.Text = .CO_COMPANY Me.InpCompanyContact.Text = .CO_Contact_Name Me.InpCustomerLines1.Text = .CO_LINE1 Me.InpCustomerArea.Text = .CO_PostcodeAreas End With End If
Function Function CustomerGetList(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Function CustomerGetList(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Returns True if success, else error in ErrorDescription$
Example code Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim Parameters$ = "", AdminDisplay$ = "" Dim ErrorDescription$ = "" Parameters = "WITHWITHLICENSE" Dim ListOfCustomer$ = CustomerPortal.CustomerGetList(Parameters$, _ Settings.ResellerAccountID, Settings.ResellerAccountPassword, _ ErrorDescription) If ErrorDescription = "" Then MsgBox("Customers:" & ListOfCustomer$) Else MsgBox("Error returned:" & ErrorDescription) End If
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim Parameters$ = "", AdminDisplay$ = "" Dim ErrorDescription$ = "" Parameters = "WITHWITHLICENSE" Dim ListOfCustomer$ = CustomerPortal.CustomerGetList(Parameters$, _ Settings.ResellerAccountID, Settings.ResellerAccountPassword, _ ErrorDescription) If ErrorDescription = "" Then MsgBox("Customers:" & ListOfCustomer$) Else MsgBox("Error returned:" & ErrorDescription) End If
Function Function CustomerGetLicenseSummary(ByVal Parameters$, ByRef CustomerDisplay$, ByRef AdminDisplay$, ByRef ExtraInfo$, ByVal CustomerAccountID&, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Function CustomerGetLicenseSummary(ByVal Parameters$, ByRef CustomerDisplay$, ByRef AdminDisplay$, ByRef ExtraInfo$, ByVal CustomerAccountID&, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As Boolean
Example code Dim SimplyPostCodeLookup As New SimplyPostCode Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim CustomerDisplay$ = "", AdminDisplay$ = "" Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use Dim CustomerAccountID& = Me.InpCustomerID.Text Dim ExtraInfo$ = "" ''This may be used in future to return extra data, and can be ignored If Not CustomerPortal.CustomerGetLicenseSummary(Parameters, CustomerDisplay$, _ AdminDisplay$, ExtraInfo$, CustomerAccountID, _ Settings.ResellerAccountID, _ Settings.ResellerAccountPassword, _ ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Customer Licenses which can be displayed to customer:" & vbCrLf & CustomerDisplay) End If
Dim SimplyPostCodeLookup As New SimplyPostCode Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim CustomerDisplay$ = "", AdminDisplay$ = "" Dim ErrorDescription$ = "" Dim Parameters$ = "" 'For future use Dim CustomerAccountID& = Me.InpCustomerID.Text Dim ExtraInfo$ = "" ''This may be used in future to return extra data, and can be ignored If Not CustomerPortal.CustomerGetLicenseSummary(Parameters, CustomerDisplay$, _ AdminDisplay$, ExtraInfo$, CustomerAccountID, _ Settings.ResellerAccountID, _ Settings.ResellerAccountPassword, _ ErrorDescription) Then MsgBox("Error returned:" & ErrorDescription) Else MsgBox("Customer Licenses which can be displayed to customer:" & vbCrLf & CustomerDisplay) End If
Example 1 Internal User Licenses:
If you place an order for internal users then the system immediately allows access to them, but this function will return different answers at various stages of the order process.
Stage 1) Order received, waiting for us to process:
System fully functional. Order in progress
Stage 2) Processed order, waiting to reconcile bank transfer:
Internal Use- Medium Business PackageFull PAF 1 users Expires:31 Oct 2011 System fully functional. Order in progress…
Stage 3) Bank transfer reconciled:
Internal Use- Medium Business Package Full PAF 1 users Expires:31 Oct 2011
Example 2 Credit Packs:
If you place an order for internal/External Use credit packs then the system immediately allows access to them. When packs are used the system will show the current balance and average usage.
Order received:
External Use- Small/Medium Business Package Full PAF 800 credits Expires:31 Oct 2011
When used, shows the average usage:
External Use- Small/Medium Business Package Full PAF 798 credits average usage 2.00 per day 356 per six months Expires:31 Oct 2011
All credit packs expire after 12 months, thus the expiry date is shown.
Function Function DoCommand(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Function DoCommand(ByVal Parameters$, ByVal ResellerAccountID&, ByVal ResellerAccountPassword$, ByRef ErrorDescription$) As String
Returns XML description if sucess, else error in ErrorDescription$
Command 1: Reset an account
To delete test purchases, during the testing stage, use this command.
Parameters="RESET123"
Will delete all license information for account 123.
Returns="1All licenses deleted for account 123"
Please note: This will only delete license for accounts marked as test accounts. (CO_TestAccount=TRUE)
Example code Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim ErrorDescription$ = "" Dim Parameters$ = "RESET" & Me.InpCustomerID.Text & "" MsgBox(CustomerPortal.DoCommand(Parameters, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription))
Dim CustomerPortal As New CustomerPortal.WebServiceCustomerPortal Dim ErrorDescription$ = "" Dim Parameters$ = "RESET" & Me.InpCustomerID.Text & "" MsgBox(CustomerPortal.DoCommand(Parameters, Settings.ResellerAccountID, Settings.ResellerAccountPassword, ErrorDescription))