NCRCounterpointAPI / APIGuide

Repository for NCR Counterpoint API Documentation
33 stars 15 forks source link

when inserting a document with paycode set as final_pmt='Y' this error is returned #43

Closed Bflatt closed 6 years ago

Bflatt commented 7 years ago

Array ( [Documents] => Array ( )

[ErrorCode] => ERROR_UNKNOWN
[Message] => An error occurred during AddDocument POST: Object reference not set to an instance of an object.,    at CPAPI.Business_85.DocumentExtensions_85.HandleFinalPayments(PS_DOC_HDR document)

at CPAPI.Business_85.DocumentBusiness_85.SplitMixedDocumentAndSave(PS_DOC_HDR document, PS_TAX tax, IM_CTL itemControl) at CPAPI.Business_85.DocumentBusiness_85.SaveMixedDocument(PS_DOC_HDR document, PS_TAX tax) at CPAPI.Business_85.DocumentBusiness_85.AddDocument(PS_DOC_HDR_POST documentPost, PS_TAX_VIEW taxView, String workgroup) )

MikeRitchie commented 7 years ago

Could you provide the data that you're posting to API?

My recollection is that final payment only works with credit type pay codes, and the amount for the payment must be less than the total amount due (the amount included with the payment will be charged immediately, as a deposit. There must be a balance due remaining that Counterpoint will charge when the order is released).

Bflatt commented 7 years ago

[Failed insert because of Y on final payment.txt](https://github.com/NCRCounterpointAPI/APIGuide/files/1180026/Failed.insert.because.of.Y.on.final.payment.txt)

Bflatt commented 7 years ago

Mike. Paul has had issued with other mods and inserting without 'Y' for final payment. Earlier this month this was working for us and we could post the inserted orders. Now when we insert and order we can release but they will not post due to payment application problems. I am gathering a sample insert with 'N' for final payment with resulting table values. We are having issues with the header totals reporting an negative amount due and the tickets will not post.

MikeRitchie commented 7 years ago

Is your intent to just provide payment information to Counterpoint, and let Counterpoint charge the full amount of the order upon release, or is the intent to have the API charge a deposit against the card immediately (when the API call is made), and also save the card for Counterpoint to use as final payment when the order is released?

Bflatt commented 7 years ago

The intent is to apply payment to order as fully paid and apply deposit on release to lines released all at once on multiple releases of one line at a time. These will be authorize.net or paypal payments.

[cid:image001.jpg@01D2DEDA.41EDDC70]

Bill Flatt Mainspring, LLC 6060 S American Plaza St E | Suite 300 | Tulsa, OK | 74135 Phone: 800.865.1427 x2827 | Local: 918.317.0707 | Direct: 918.960.2827 bflatt@mainspring.netmailto:bflatt@mainspring.net | www.mainspring.nethttp://www.mainspring.net | Need Help?mailto:support@mainspring.net [cid:image002.png@01D2DEDA.41EDDC70]https://www.facebook.com/MainSpringRetailSolutions/[cid:image003.png@01D2DEDA.41EDDC70]https://twitter.com/MainspringPOS [cid:image004.png@01D2DEDA.41EDDC70] http://www.linkedin.com/company/576462 [cid:image005.png@01D2DEDA.41EDDC70] mailto:support@mainspring.net

From: MikeRitchie [mailto:notifications@github.com] Sent: Thursday, July 27, 2017 9:46 AM To: NCRCounterpointAPI/APIGuide APIGuide@noreply.github.com Cc: Bill Flatt bflatt@mainspring.net; Author author@noreply.github.com Subject: Re: [NCRCounterpointAPI/APIGuide] when inserting a document with paycode set as final_pmt='Y' this error is returned (#43)

Is your intent to just provide payment information to Counterpoint, and let Counterpoint charge the full amount of the order upon release, or is the intent to have the API charge a deposit against the card immediately (when the API call is made), and also save the card for Counterpoint to use as final payment when the order is released?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NCRCounterpointAPI/APIGuide/issues/43#issuecomment-318366616, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AbToeXSs-7_daBa9eKpMCdardj30GbfMks5sSJSYgaJpZM4Okf5A.

MikeRitchie commented 7 years ago

If you've charged the full order amount to the customer prior to calling the API (via authorize.net or paypal), then you would not want to mark final pmt ="Y". Final payment is meant as a credit card that should be used by Counterpoint to charge the final outstanding order balance due when releasing the order in Counterpoint. If you've already charged the full amount outside of Counterpoint, then I'd ensure:

If all the above are true, then the order in Counterpoint should be fully paid and balanced, and can be released however the user chooses.

Bflatt commented 7 years ago

Mike we have backed our insert down to no taxes or freight and this is the resulting table queries. This order will not post the payment line or the subsequent release. The distribution are out of balance. I have attached out developers insert

Mike this is a query from ps_doc_hdr_tot doc id 202108350449 and 202108350448 are the result of an matching order placed in CounterPoint. 107474108436680 and 107474108265480 is the result of order inserted from woo. You see the amount due on the tot_typ S for the inverted order is -24.00

Ps_doc_hdr_tot

[cid:image001.png@01D306BE.11A4EB10]

Vi_ps_doc_hdr sal_amt_due and amt_due are incorrect. Doc_id 107474108265480 - TKT 104247 is the resulting deposit ticket which is created by CounterPoint. We are not inserting this. It is automatically created.

[cid:image012.png@01D306BF.04E84F10]

[cid:image001.jpg@01D2DEDA.41EDDC70]

Bill Flatt Mainspring, LLC 6060 S American Plaza St E | Suite 300 | Tulsa, OK | 74135 Phone: 800.865.1427 x2827 | Local: 918.317.0707 | Direct: 918.960.2827 bflatt@mainspring.netmailto:bflatt@mainspring.net | www.mainspring.nethttp://www.mainspring.net | Need Help?mailto:support@mainspring.net [cid:image002.png@01D2DEDA.41EDDC70]https://www.facebook.com/MainSpringRetailSolutions/[cid:image003.png@01D2DEDA.41EDDC70]https://twitter.com/MainspringPOS [cid:image004.png@01D2DEDA.41EDDC70] http://www.linkedin.com/company/576462 [cid:image005.png@01D2DEDA.41EDDC70] mailto:support@mainspring.net

From: MikeRitchie [mailto:notifications@github.com] Sent: Thursday, July 27, 2017 9:46 AM To: NCRCounterpointAPI/APIGuide APIGuide@noreply.github.com Cc: Bill Flatt bflatt@mainspring.net; Author author@noreply.github.com Subject: Re: [NCRCounterpointAPI/APIGuide] when inserting a document with paycode set as final_pmt='Y' this error is returned (#43)

Is your intent to just provide payment information to Counterpoint, and let Counterpoint charge the full amount of the order upon release, or is the intent to have the API charge a deposit against the card immediately (when the API call is made), and also save the card for Counterpoint to use as final payment when the order is released?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NCRCounterpointAPI/APIGuide/issues/43#issuecomment-318366616, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AbToeXSs-7_daBa9eKpMCdardj30GbfMks5sSJSYgaJpZM4Okf5A.

Array ( [PS_DOC_HDR] => Array ( [STR_ID] => 2 [STA_ID] => ECOMM [DRW_ID] => ECOMM [PS_DOC_NOTE] => Array ( )

        [TKT_TYP] => T
        [CUST_NO] => WEBGUEST
        [DOC_TYP] => O
        [TO_REL_LINS] => 1
        [TAX_COD] => WEBOH
        [NORM_TAX_COD] => WEBOH
        [SHIP_VIA_COD] => C
        [BILL_TO_CONTACT] => Array
            (
                [FST_NAM] => Aleksandar
                [LST_NAM] => Milicevic
                [NAM] => Aleksandar Milicevic
                [NAM_UPR] => ALEKSANDAR MILICEVIC
                [ADRS_1] => Obilicev veca
                [ADRS_2] => 92130
                [CITY] => New York
                [ZIP_COD] => 19000
                [STATE] => OH
                [PHONE_1] => 2342458795423
                [NAM_TYP] => P
            )

        [SHIP_TO_CONTACT] => Array
            (
                [FST_NAM] => Aleksandar
                [LST_NAM] => Milicevic
                [NAM] => Aleksandar Milicevic
                [ADRS_1] => Obilicev veca
                [ADRS_2] => 92130
                [CITY] => New York
                [ZIP_COD] => 19000
                [STATE] => OH
                [NAM_TYP] => P
            )

        [USR_ID] => MGR
        [PS_DOC_LIN] => Array
            (
                [0] => Array
                    (
                        [LIN_TYP] => O
                        [ITEM_NO] => 31770003
                        [QTY_SOLD] => 1
                        [MIX_MATCH_CONTRIB] => 0
                        [TAX_AMT_ALLOC] => 0
                        [NORM_TAX_AMT_ALLOC] => 0
                        [PS_DOC_LIN_PRICE] => Array
                            (
                                [DIM_1_UPR] => *
                                [DIM_2_UPR] => *
                                [DIM_3_UPR] => *
                                [PRC_RUL_SEQ_NO] => -1
                                [PRC_BRK_DESCR] => I
                                [PRC_SEQ_NO] => 1
                            )

                    )

            )

        [PS_DOC_PMT] => Array
            (
                [PAY_COD] => ANET
                [FINAL_PMT] => N
                [AMT] => 24.00
            )

        [PS_DOC_HDR_MISC_CHRG] => Array
            (
                [TOT_TYP] => O
                [MISC_CHRG_NO] => 1
                [MISC_TYP] => A
                [MISC_AMT] => 0
            )

        [PS_DOC_TAX] => Array
            (
                [AUTH_COD] => WEBOH
                [RUL_COD] => WEBOH
                [TAX_DOC_PART] => O
                [LIN_AMT] => 24
                [TXBL_LIN_AMT] => 0
                [TXBL_MISC_CHG_AMT_1] => 0
                [TXBL_MISC_CHG_AMT_2] => 0
                [TXBL_MISC_CHG_AMT_3] => 0
                [TXBL_MISC_CHG_AMT_4] => 0
                [TXBL_MISC_CHG_AMT_5] => 0
                [TXBL_QTY] => 1
                [NORM_TAX_AMT] => 0
                [TAX_AMT] => 0
                [TAX_AMT_EXACT] => 0
                [NORM_TAX_AMT_EXACT] => 0
                [TOT_TXBL_AMT] => 0
            )

        [PS_DOC_HDR_EC] => Array
            (
                [EC_STR_ID] => 0
                [EC_IMP_DT] => 2017-07-27
                [EC_ORD_MISC_AMT_1_TOT_EXPECTD] => 0
                [EC_IMP_HAD_SPECL_MSGS] => N
                [EC_ORD_TAX_AMT_TOT_EXPECTD] => 0
                [EC_ORD_NO] => 7967
                [EC_CUST_NO] => 1
                [EC_ORD_TOT] => 24.00
                [NXT_EC_SEQ_NO_OFFSET] => 1
            )

        [PS_DOC_HDR_TOT] => Array
            (
                [TAX_AMT] => 0
                [NORM_TAX_AMT] => 0
            )

        [PS_TAX] => Array
            (
                [ORD_NORM_TAX_AMT] => 0
                [ORD_TAX_AMT] => 0
            )

        [PS_DOC_PMT_APPLY] => Array
            (
                [PMT_SEQ_NO] => 1
                [APPL_TYP] => O
                [AMT] => 24.00
                [HOME_CURNCY_AMT] => 24.00
                [EXCH_LOSS] => 0.00
            )

    )

)

Bflatt commented 7 years ago

This is the whole picture of resulting tables with cp order insert doc id’s as 202 and developer doc insert as doc_id’s 107474 deposit tickets start with 104 order docs are 700

[cid:image011.png@01D306C0.56ED34F0]

[cid:image001.jpg@01D2DEDA.41EDDC70]

Bill Flatt Mainspring, LLC 6060 S American Plaza St E | Suite 300 | Tulsa, OK | 74135 Phone: 800.865.1427 x2827 | Local: 918.317.0707 | Direct: 918.960.2827 bflatt@mainspring.netmailto:bflatt@mainspring.net | www.mainspring.nethttp://www.mainspring.net | Need Help?mailto:support@mainspring.net [cid:image002.png@01D2DEDA.41EDDC70]https://www.facebook.com/MainSpringRetailSolutions/[cid:image003.png@01D2DEDA.41EDDC70]https://twitter.com/MainspringPOS [cid:image004.png@01D2DEDA.41EDDC70] http://www.linkedin.com/company/576462 [cid:image005.png@01D2DEDA.41EDDC70] mailto:support@mainspring.net

From: MikeRitchie [mailto:notifications@github.com] Sent: Thursday, July 27, 2017 9:57 AM To: NCRCounterpointAPI/APIGuide APIGuide@noreply.github.com Cc: Bill Flatt bflatt@mainspring.net; Author author@noreply.github.com Subject: Re: [NCRCounterpointAPI/APIGuide] when inserting a document with paycode set as final_pmt='Y' this error is returned (#43)

If you've charged the full order amount to the customer prior to calling the API (via authorize.net or paypal), then you would not want to mark final pmt ="Y". Final payment is meant as a credit card that should be used by Counterpoint to charge the final outstanding order balance due when releasing the order in Counterpoint. If you've already charged the full amount outside of Counterpoint, then I'd ensure:

If all the above are true, then the order in Counterpoint should be fully paid and balanced, and can be released however the user chooses.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NCRCounterpointAPI/APIGuide/issues/43#issuecomment-318369713, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AbToeUPA9cbNKkF8IIGt20MXdWrHG9DLks5sSJcegaJpZM4Okf5A.

Array ( [PS_DOC_HDR] => Array ( [STR_ID] => 2 [STA_ID] => ECOMM [DRW_ID] => ECOMM [PS_DOC_NOTE] => Array ( )

        [TKT_TYP] => T
        [CUST_NO] => WEBGUEST
        [DOC_TYP] => O
        [TO_REL_LINS] => 1
        [TAX_COD] => WEBOH
        [NORM_TAX_COD] => WEBOH
        [SHIP_VIA_COD] => C
        [BILL_TO_CONTACT] => Array
            (
                [FST_NAM] => Aleksandar
                [LST_NAM] => Milicevic
                [NAM] => Aleksandar Milicevic
                [NAM_UPR] => ALEKSANDAR MILICEVIC
                [ADRS_1] => Obilicev veca
                [ADRS_2] => 92130
                [CITY] => New York
                [ZIP_COD] => 19000
                [STATE] => OH
                [PHONE_1] => 2342458795423
                [NAM_TYP] => P
            )

        [SHIP_TO_CONTACT] => Array
            (
                [FST_NAM] => Aleksandar
                [LST_NAM] => Milicevic
                [NAM] => Aleksandar Milicevic
                [ADRS_1] => Obilicev veca
                [ADRS_2] => 92130
                [CITY] => New York
                [ZIP_COD] => 19000
                [STATE] => OH
                [NAM_TYP] => P
            )

        [USR_ID] => MGR
        [PS_DOC_LIN] => Array
            (
                [0] => Array
                    (
                        [LIN_TYP] => O
                        [ITEM_NO] => 31770003
                        [QTY_SOLD] => 1
                        [MIX_MATCH_CONTRIB] => 0
                        [TAX_AMT_ALLOC] => 0
                        [NORM_TAX_AMT_ALLOC] => 0
                        [PS_DOC_LIN_PRICE] => Array
                            (
                                [DIM_1_UPR] => *
                                [DIM_2_UPR] => *
                                [DIM_3_UPR] => *
                                [PRC_RUL_SEQ_NO] => -1
                                [PRC_BRK_DESCR] => I
                                [PRC_SEQ_NO] => 1
                            )

                    )

            )

        [PS_DOC_PMT] => Array
            (
                [PAY_COD] => ANET
                [FINAL_PMT] => N
                [AMT] => 24.00
            )

        [PS_DOC_HDR_MISC_CHRG] => Array
            (
                [TOT_TYP] => O
                [MISC_CHRG_NO] => 1
                [MISC_TYP] => A
                [MISC_AMT] => 0
            )

        [PS_DOC_TAX] => Array
            (
                [AUTH_COD] => WEBOH
                [RUL_COD] => WEBOH
                [TAX_DOC_PART] => O
                [LIN_AMT] => 24
                [TXBL_LIN_AMT] => 0
                [TXBL_MISC_CHG_AMT_1] => 0
                [TXBL_MISC_CHG_AMT_2] => 0
                [TXBL_MISC_CHG_AMT_3] => 0
                [TXBL_MISC_CHG_AMT_4] => 0
                [TXBL_MISC_CHG_AMT_5] => 0
                [TXBL_QTY] => 1
                [NORM_TAX_AMT] => 0
                [TAX_AMT] => 0
                [TAX_AMT_EXACT] => 0
                [NORM_TAX_AMT_EXACT] => 0
                [TOT_TXBL_AMT] => 0
            )

        [PS_DOC_HDR_EC] => Array
            (
                [EC_STR_ID] => 0
                [EC_IMP_DT] => 2017-07-27
                [EC_ORD_MISC_AMT_1_TOT_EXPECTD] => 0
                [EC_IMP_HAD_SPECL_MSGS] => N
                [EC_ORD_TAX_AMT_TOT_EXPECTD] => 0
                [EC_ORD_NO] => 7967
                [EC_CUST_NO] => 1
                [EC_ORD_TOT] => 24.00
                [NXT_EC_SEQ_NO_OFFSET] => 1
            )

        [PS_DOC_HDR_TOT] => Array
            (
                [TAX_AMT] => 0
                [NORM_TAX_AMT] => 0
            )

        [PS_TAX] => Array
            (
                [ORD_NORM_TAX_AMT] => 0
                [ORD_TAX_AMT] => 0
            )

        [PS_DOC_PMT_APPLY] => Array
            (
                [PMT_SEQ_NO] => 1
                [APPL_TYP] => O
                [AMT] => 24.00
                [HOME_CURNCY_AMT] => 24.00
                [EXCH_LOSS] => 0.00
            )

    )

)

Bflatt commented 7 years ago

I removed cust_no from my insert and the document will insert. the result is the same. the deposit payment line will post but creates out of balance distributions by the amount of the deposit. and How are we supposed to insert to the correct customer is we can't include the cust_no in the doc_hdr section?

Bflatt commented 7 years ago

Mike, This was working a week ago and now it it not. Something changed on the API

Bflatt commented 7 years ago

Mike,

I have created an manual insert of a test order EXACTLY matching the sample in the api documentation and the issue posting a deposit ticket still persists. The inserted document will post the deposit ticket created on insert but with out of balance distributions. The inserted order will release and post correctly. Our only remaining issue is the automatically created deposit ticket.

I have attached sheet detailing the sample from the api documentation and our sample insert which produces the results below. If you could please review the insert for any errors on our part. Our example does not include tax or misc charge but when included it produces the same results.

VI_PS_DOC_LIN ROWS match exactly between CounterPoint and Insert order

From vi_ps_doc_hdr

[cid:image012.jpg@01D306F8.72AA8430] Highlighted fields are from the resulting payment line created on insert of the test document. 202308489600 is from a document entered in Counterpoint. 107474108884216 is from our test insert. The other two documents are the resulting orders and they match exactly on every other field in the table.

PS_DOC_HDR_ORIG_DOC Which is generated automatically on insert

[cid:image013.jpg@01D306F8.72AA8430] Every other field matches exactly

PS_DOC_HDR_TOT Which is not a part of the api doc as a required insert so we are not including any insert fields.

[cid:image014.jpg@01D306F8.72AA8430]

AMT_DUE is a negative in the amount of the payment applied.

Initial posting of the drawer after order insert. This posting would include the Order deposit received. [cid:image016.jpg@01D306F8.72AA8430]

Resulting distributions - No deposit is listed in the summary and no liability side distribution is created.

[cid:image024.png@01D306F2.357FB310] [cid:image028.png@01D306F2.357FB310]

Expected result

[cid:image026.jpg@01D306F8.72AA8430]

[cid:image001.jpg@01D2DEDA.41EDDC70]

Bill Flatt Mainspring, LLC 6060 S American Plaza St E | Suite 300 | Tulsa, OK | 74135 Phone: 800.865.1427 x2827 | Local: 918.317.0707 | Direct: 918.960.2827 bflatt@mainspring.netmailto:bflatt@mainspring.net | www.mainspring.nethttp://www.mainspring.net | Need Help?mailto:support@mainspring.net [cid:image002.png@01D2DEDA.41EDDC70]https://www.facebook.com/MainSpringRetailSolutions/[cid:image003.png@01D2DEDA.41EDDC70]https://twitter.com/MainspringPOS [cid:image004.png@01D2DEDA.41EDDC70] http://www.linkedin.com/company/576462 [cid:image005.png@01D2DEDA.41EDDC70] mailto:support@mainspring.net

From: MikeRitchie [mailto:notifications@github.com] Sent: Thursday, July 27, 2017 9:57 AM To: NCRCounterpointAPI/APIGuide APIGuide@noreply.github.com Cc: Bill Flatt bflatt@mainspring.net; Author author@noreply.github.com Subject: Re: [NCRCounterpointAPI/APIGuide] when inserting a document with paycode set as final_pmt='Y' this error is returned (#43)

If you've charged the full order amount to the customer prior to calling the API (via authorize.net or paypal), then you would not want to mark final pmt ="Y". Final payment is meant as a credit card that should be used by Counterpoint to charge the final outstanding order balance due when releasing the order in Counterpoint. If you've already charged the full amount outside of Counterpoint, then I'd ensure:

If all the above are true, then the order in Counterpoint should be fully paid and balanced, and can be released however the user chooses.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/NCRCounterpointAPI/APIGuide/issues/43#issuecomment-318369713, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AbToeUPA9cbNKkF8IIGt20MXdWrHG9DLks5sSJcegaJpZM4Okf5A.

Bflatt commented 7 years ago

This issue is NOT corrected with the 2.0 API. Payment inserts with FInal_PMT='N' and AMT included still result in an improperly formed Payment ticket.

MikeRitchie commented 6 years ago

This will be addressed in an upcoming 2.1 release coming very soon. Date will be shared as soon as it is available.