Inorder to import a Credit Card transaction into GP using eConnect , I create the following objects:
taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord
taSopLineIvcInsert_ItemsTaSopLineIvcInsert,
taSopHdrIvcInsert I think I am not setting the amounts properly in the Payment object, so I am getting the following error:
Sql procedure error codes returned: Error Number = 60 Stored Procedure taSopHdrIvcInsert Error Description = Payment total does not match line deposit + credit card payment total Node Identifier Parameters: taSopHdrIvcInsert SOPNUMBE = INVS147211111555 SOPTYPE = 3 Related Error Code Parameters for Node : taSopHdrIvcInsert PYMTRCVD = Note: This parameter was not passed in, no value for the parameter will be returned. <taSopHdrIvcInsert><SOPTYPE>3</SOPTYPE><DOCID>SPECIAL</DOCID><SOPNUMBE>INVS147211111555</SOPNUMBE><LOCNCODE>555</LOCNCODE><DOCDATE>1/14/2011</DOCDATE><CUSTNMBR>USD08</CUSTNMBR><CSTPONBR>20505000118013153465</CSTPONBR><SUBTOTAL>6.31000</SUBTOTAL><DOCAMNT>6.31000</DOCAMNT><BACHNUMB>POS555</BACHNUMB><USRDEFND1>555</USRDEFND1><USRDEFND3>10</USRDEFND3></taSopHdrIvcInsert
The code for creating the payment object is as follows:
Dim Payments(intNumLineItems) As taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord
If intPT = 2 Or intPT = 3 Then 'create payment object for each line item For countLineItems = 0 To intNumLineItems - 1
Try Dim objtaSOPmt As New taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord
' define information for the transaction header 'create as an invoice so soptype = 3 objtaSOPmt.SOPTYPE = 3 'create the SOPNumber as INVS & storetransactionid & storeId objtaSOPmt.SOPNUMBE = "INVS" & intStoreTranID.ToString() & strStoreID 'objSopNO.GetNextSopNumber(3, "SPECIAL", strConnectionString) 'this is the transacton date objtaSOPmt.DOCDATE = dtTime.Date 'set to a POS speciific customer in GP strCust = ConfigurationSettings.AppSettings( "GPCustomer" & strStoreID.Trim)
objtaSOPmt.CUSTNMBR = strCust objtaSOPmt.USRDEFND1 = strStoreID objtaSOPmt.USRDEFND3 = "10" 'total of the transaction objtaSOPmt.DOCAMNT = dtTranDetail.Rows(countLineItems)( "ITEMPrice")
objtaSOPmt.CARDNAME = ConfigurationSettings.AppSettings( "CardName")
objtaSOPmt.PYMTTYPE = 6 'for credit card payment Payments(countLineItems) = objtaSOPmt Catch ex As Exception
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID, "CreateSalesOrder", "Error creating TransactionDeatils for line item " & (countLineItems + 1).ToString() & ")" & dtTranDetail.Rows(countLineItems)("ItemNMBR") & ex.Message)
End Try Next End If 'CC Code Dim spSOP As New SOPTransactionType
Try ' for serialization, add items to a sop transaction type ReDim Preserve spSOP.taSopLineIvcInsert_Items(1)
spSOP.taSopLineIvcInsert_Items = LineItems spSOP.taSopHdrIvcInsert = objtaSopHdrIvcInsert If intPT = 2 Or intPT = 3 Then spSOP.taCreateSopPaymentInsertRecord_Items = Payments End If Catch ex As Exception
objMessageLog.InsertMessageLog(intTranID, strStoreID, intRegID, "CreateSalesOrder", "Error creating SOPTransactionType " & ex.Message)
End Try
*This post is locked for comments