里面提供了sdk,直接使用即可,下载3楼链接里的内容,解压。
2、打开foxtable安装目录里的Foxtable.exe.config,在以下节点添加红字的这部分内容即可:
……
<runtime>
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="C1.C1Zip.4"
publicKeyToken="79882d576c6336da"
culture="neutral" />
<bindingRedirect oldVersion="4.0.20191.359" newVersion="4.0.20183.338" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="C1.Win.Bitmap.4"
publicKeyToken="944ae1ea0e47ca04"
culture="neutral" />
<bindingRedirect oldVersion="4.0.20183.338" newVersion="4.0.20191.359" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="C1.C1Excel.4"
publicKeyToken="79882d576c6336da"
culture="neutral" />
<bindingRedirect oldVersion="4.0.20191.359" newVersion="4.0.20183.338" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"
publicKeyToken="30ad4fe6b2a6aeed"
culture="neutral" />
<bindingRedirect oldVersion="7.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
……
添加后保存。最后记得备份一下Foxtable.exe.config,因为如果升级Foxtable新版本,这个文件会被覆盖,需要重新改一下。
3、到目录“Sample Code”里找到对应要做的功能的目录。比如04.一般开立fa piao,使用vs打开,或者找到其中的Issue.aspx.cs文件使用文本编辑器打开,转换为vb.net代码使用:
http://converter.telerik.com/,转换后补上完整的命名空间(如下红字),如:
Dim invc As New Ecpay.EInvoice.Integration.Models.InvoiceCreate()
invc.MerchantID = "2000132"
invc.RelateNumber = "ecPay" & New Random().[Next](0, 99999).ToString()
invc.CustomerID = ""
invc.CustomerIdentifier = ""
invc.CustomerName = ""
invc.CustomerAddr = "客戶地址"
invc.CustomerPh
invc.CustomerEmail = "test@ecpay.com.tw"
invc.Print = Ecpay.EInvoice.Integration.Enumeration.PrintEnum.No
invc.Donation = Ecpay.EInvoice.Integration.Enumeration.DonationEnum.No
invc.LoveCode = ""
invc.carruerType = Ecpay.EInvoice.Integration.Enumeration.CarruerTypeEnum.PhoneBarcode
invc.CarruerNum = "/6G+X3LQ"
invc.CarruerNum = invc.CarruerNum.Replace("+"c, " "c)
invc.SalesAmount = "300"
invc.InvoiceRemark = "(qwrrg)"
invc.invType = Ecpay.EInvoice.Integration.Enumeration.TheWordTypeEnum.Normal
Dim item As New Ecpay.EInvoice.Integration.Models.Item()
With item
.ItemName = "糧食"
.ItemCount = "1"
.ItemWord = "個"
.ItemPrice = "100.1"
.ItemAmount = "100.1"
End With
invc.Items.Add(item)
item = New Ecpay.EInvoice.Integration.Models.Item()
With item
.ItemName = "糧食"
.ItemPrice = "200"
.ItemCount = "1"
.ItemWord = "個"
.ItemAmount = "200"
End With
invc.Items.Add(item)
Dim inv As New Ecpay.EInvoice.Integration.Service.Invoice(Of Ecpay.EInvoice.Integration.Models.InvoiceCreate)()
inv.Environment = Ecpay.EInvoice.Integration.Enumeration.EnvironmentEnum.Stage
inv.HashIV = "q9jcZX8Ib9LM8wYk"
inv.HashKey = "ejCk326UnaZWKisg"
Dim json As String = inv.post(invc) '调用接口
msgbox(json) '查看返回结果