Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v26.1.0: Library allows to provide small negative request amounts like -0.1, while -1.00 is returning failure #1105

Open
captador opened this issue Jan 21, 2025 · 3 comments

Comments

@captador
Copy link

Describe the bug
Library allows to provide small negative request amounts like -0.1, while -1.00 is returning failure about incorrect value of total amount. Moreover terminal will show 0,10 EUR amount as minus sign dropped at some point.

{"SaleToPOIRequest":{"MessageHeader":{"MessageClass":"Service","MessageCategory":"Payment","MessageType":"Request","ServiceID":"8D4415B5FA","SaleID":"SystemTests","POIID":"P400Plus-806***882","ProtocolVersion":"3.0"},"PaymentRequest":{"SaleData":{"SaleTransactionID":{"TransactionID":"b85fe4ea-c8ab-4b8c-aa63-9d88fe98afb6","TimeStamp":"2025-01-21T12:26:32"},"SaleToPOIData":"eyJPcGVyYXRpb24iOlt7IlR5cGUiOiJQYXltZW50In1dLCJWQVNNb2RlT3ZlcnJpZGUiOiJWQVNNb2RlUGF5bWVudE9ubHkifQ==","SaleToAcquirerData":"eyJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZHllbi1kb3RuZXQtYXBpLWxpYnJhcnkiLCJ2ZXJzaW9uIjoiMjYuMS4wIn19fQ==","OperatorID":"autotest_dev","SaleReferenceID":"systemTestaac5bf54-7cc5-47be-9be6-764a2e606dc8","TokenRequestedType":"Transaction"},"PaymentTransaction":{"AmountsReq":{"Currency":"EUR","RequestedAmount":-0.1},"TransactionConditions":{"CustomerLanguage":"fi"}},"PaymentData":{"CardAcquisitionReference":{"TransactionID":"bLEO001737462386004","TimeStamp":"2025-01-21T12:26:26"},"PaymentType":"Normal"}}}}

Expected behavior
Same failure is returned as for -1.00 requested amount

{"MessageHeader":{"MessageClass":"Service","MessageCategory":"CardAcquisition","MessageType":"Response","SaleID":"SystemTests","POIID":"P400Plus-806698882","ProtocolVersion":"3.0"},"MessagePayload":{"Response":{"AdditionalResponse":"{\"errors\":\"At SaleToPOIRequest.CardAcquisitionRequest.CardAcquisitionTransaction.TotalAmount: Invalid value\"}","Result":"Failure","ErrorCondition":"MessageFormat"},"SaleData":{"SaleTransactionID":{"TransactionID":"1915b3fa-fd3b-40f2-9963-a4c4448b4eaa","TimeStamp":"2025-01-21T12:31:08Z"},"SaleToAcquirerData":"eyJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZHllbi1kb3RuZXQtYXBpLWxpYnJhcnkiLCJ2ZXJzaW9uIjoiMjYuMS4wIn19fQ==","SaleReferenceID":"systemTest0f02dde9-9b35-434c-800e-9c4f7d761ff0","TokenRequestedType":"Transaction"},"POIData":{"POITransactionID":{"TransactionID":"bLEO001737462668001","TimeStamp":"2025-01-21T12:31:08.867Z"}}}}

@Kwok-he-Chu
Copy link
Member

Thanks for reaching out. I did some digging and I noticed that the two requests are different, hence why the responses are different for each of the requests

  1. In the first payload, you're trying to do a regular payment request:
    MessageCategory":"Payment"

Could you provide a screenshot of where the negative amount is shown on the terminal screen + terminal type (e.g. S1F2.. V400m etc.)

  1. In the second payload, you're trying to do a card acquisition:
    "MessageCategory":"CardAcquisition"

I don't think you can do a negative amount for card acquisitions, hence the error

@captador
Copy link
Author

captador commented Feb 3, 2025

@Kwok-he-Chu , below is card acq with negative amount -0.1 EUR as well. The point is that -1.0 EUR is leading to error, while -0.1 doesn't and it is inconsistent

{"MessageHeader":{"MessageClass":"Service","MessageCategory":"CardAcquisition","MessageType":"Request","ServiceID":"CAB22B733C","SaleID":"SystemTests","POIID":"P400Plus-806698882","ProtocolVersion":"3.0"},"MessagePayload":{"SaleData":{"SaleTransactionID":{"TransactionID":"06f8a05c-9837-4975-84b9-7809ab542e03","TimeStamp":"2025-02-03T16:35:48.722936Z"},"SaleToPOIData":"eyJPcGVyYXRpb24iOlt7IlR5cGUiOiJFTVZMb3lhbHR5UmVhZCJ9XX0=","SaleToAcquirerData":"eyJhcHBsaWNhdGlvbkluZm8iOnsiYWR5ZW5MaWJyYXJ5Ijp7Im5hbWUiOiJhZHllbi1kb3RuZXQtYXBpLWxpYnJhcnkiLCJ2ZXJzaW9uIjoiMjYuMS4wIn19fQ==","OperatorID":"autotest_dev","SaleReferenceID":"systemTest9c676830-62ae-461b-b866-6b0ac4bc3540","TokenRequestedType":"Customer"},"CardAcquisitionTransaction":{"CustomerLanguage":"fi","TotalAmount":-0.1,"PaymentType":"Normal"}}}

@Kwok-he-Chu
Copy link
Member

I'll forward this feedback to the product team, thank you for sharing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants