Ingenico-ePayments / connect-extension-magento2

Ingenico Connect based Shopping Cart Extension for Magento 2.x
https://epayments.developer-ingenico.com/documentation/ecommerce-extensions/magento-2/
MIT License
4 stars 4 forks source link

Error field Size Addressess #25

Closed mesguerrae closed 1 year ago

mesguerrae commented 2 years ago

Describe the issue

when the firstname in shipping and billing or street address field len size is greather than 20 characters, show error FIELD_LENGTH_INVALID and the expected thing is that the 255 characters that magento has in its data model can be used

image

Log trace

[2022-04-27 21:09:26] report.INFO: Outgoing request to https://world.preprod.api-ingenico.com/ (requestId='6710111e-d109-4fc9-978c-748e73cf710f') POST /v1/11426/hostedcheckouts HTTP/1.1 Content-Type: application/json Date: Wed, 27 Apr 2022 21:09:26 GMT X-GCS-ClientMetaInfo: eyJwbGF0Zm9ybUlkZW50aWZpZXIiOiJNb3ppbGxhXC81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXRcLzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZVwvMTAwLjAuNDg5Ni4xMjcgU2FmYXJpXC81MzcuMzYifQ== X-GCS-ServerMetaInfo: eyJwbGF0Zm9ybUlkZW50aWZpZXIiOiJMaW51eCBpLTBmMzcwNGJkMDFjM2VmNjliIDUuMTUuMjUtMHBzaDEgIzBwc2gxIFNNUCBQUkVFTVBUIFRodSwgMjQgRmViIDIwMjIgMDE6MDE6MzUgKzAwMDAgeDg2XzY0OyBwaHAgdmVyc2lvbiA3LjQuMjgiLCJzZGtJZGVudGlmaWVyIjoiUEhQU2VydmVyU0RLL3Y2LjIwLjAiLCJzZGtDcmVhdG9yIjoiSW5nZW5pY28iLCJpbnRlZ3JhdG9yIjoiSW5nZW5pY28iLCJzaG9wcGluZ0NhcnRFeHRlbnNpb24iOnsiY3JlYXRvciI6IkluZ2VuaWNvIiwibmFtZSI6Ik0yLkNvbm5lY3QiLCJ2ZXJzaW9uIjoiTTIuNC4wIEIyQiIsImV4dGVuc2lvbklkIjoiMi41LjAifX0= Authorization: ****

{ "bankTransferPaymentMethodSpecificInput": {}, "cardPaymentMethodSpecificInput": { "recurring": {}, "requiresApproval": true, "tokenize": false, "transactionChannel": "ECOMMERCE", "threeDSecure": { "authenticationFlow": "browser", "redirectionData": { "returnUrl": "https:\/\/mcstaging.intcomex.com\/cb-es\/epayments\/hostedCheckoutPage\/processReturn\/", "variant": "100" } } }, "cashPaymentMethodSpecificInput": {}, "eInvoicePaymentMethodSpecificInput": { "paymentProduct9000SpecificInput": {} }, "fraudFields": { "customerIpAddress": "181.78.2.202" }, "hostedCheckoutSpecificInput": { "locale": "es_CO", "returnCancelState": true, "returnUrl": "https:\/\/mcstaging.intcomex.com\/cb-es\/epayments\/hostedCheckoutPage\/processReturn\/", "showResultPage": true, "tokens": "66079441-8145-468e-ab84-74f86c047bfd,66079441-8145-468e-ab84-74f86c047bfd", "validateShoppingCart": true, "variant": "100" }, "merchant": { "contactWebsiteUrl": "https:\/\/mcstaging.intcomex.com\/cb-es\/contact\/", "websiteUrl": "https:\/\/mcstaging.intcomex.com\/cb-es\/" }, "order": { "additionalInput": { "orderDate": "20220427210926", "typeInformation": { "purchaseType": "physical", "usageType": "commercial" } }, "amountOfMoney": { "amount": 2039200, "currencyCode": "COP" }, "customer": { "companyInformation": {}, "merchantCustomerId": "4493", "account": { "authentication": { "method": "merchant-credentials", "utcTimestamp": "202204271924" }, "changeDate": "20220323", "createDate": "20220323", "hadSuspiciousActivity": true, "paymentActivity": { "numberOfPaymentAttemptsLast24Hours": 9, "numberOfPaymentAttemptsLastYear": 15, "numberOfPurchasesLast6Months": 0 } }, "accountType": "existing", "billingAddress": { "additionalInfo": "", "city": "CHIA", "countryCode": "CO", "houseNumber": "", "state": "Cundinamarca", "stateCode": "CUN", "street": "CALLE 2 # 15-14", "zip": "111511" }, "contactDetails": { "emailAddress": "crumarizayu-8318@yopmail.com", "emailMessageType": "html", "phoneNumber": "+572345432" }, "device": { "acceptHeader": "\/", "browserData": { "javaScriptEnabled": true }, "ipAddress": "181.78.2.202" }, "personalInformation": { "dateOfBirth": "", "gender": "male", "name": { "firstName": "El Patron", "surname": "Del Mal" } } }, "references": { "merchantReference": "XCB|77237|XCB003840" }, "shipping": { "address": { "additionalInfo": "", "city": "Zarzal", "countryCode": "CO", "houseNumber": "61", "state": "Valle del Cauca", "stateCode": "VAC", "street": "Calle 10 # 1", "zip": "762080", "name": { "firstName": "William Fernando El Pat\u00f3n del B2B", "surname": "Marroqu\u00edn" } }, "addressIndicator": "different-than-billing", "emailAddress": "crumarizayu-8318@yopmail.com", "firstUsageDate": "20220427", "isFirstUsage": true }, "shoppingCart": { "items": [ { "amountOfMoney": { "amount": 1009200, "currencyCode": "COP" }, "invoiceData": { "description": "Xtech - Video cable - HDMI male to HDMI", "nrOfItems": 1, "pricePerItem": 1009200 }, "orderLineDetails": { "discountAmount": 0, "lineAmountTotal": 256, "productCode": "AC002XTK04", "productName": "Xtech - Video cable - HDMI male to HDMI", "productPrice": 256, "productType": "simple", "quantity": 1, "taxAmount": 41, "unit": "" } }, { "amountOfMoney": { "amount": 1030000, "currencyCode": "COP" }, "invoiceData": { "description": "Shipping", "nrOfItems": 1, "pricePerItem": 1030000 }, "orderLineDetails": { "lineAmountTotal": 309, "productName": "Shipping", "productPrice": 309, "quantity": 1, "taxAmount": 0 } } ], "reOrderIndicator": false } }, "redirectPaymentMethodSpecificInput": { "requiresApproval": true, "tokenize": false, "returnUrl": "https:\/\/mcstaging.intcomex.com\/cb-es\/epayments\/hostedCheckoutPage\/processReturn\/" }, "sepaDirectDebitPaymentMethodSpecificInput": { "paymentProduct771SpecificInput": { "mandate": { "customer": { "companyName": "VAIMO- CUENTA PRUEBA XCB2", "mandateAddress": { "city": "CHIA", "countryCode": "CO", "street": "CALLE 2 # 15-14", "zip": "111511" }, "personalInformation": { "title": "Mr" } }, "customerReference": "4493", "recurrenceType": "UNIQUE", "signatureType": "SMS" } }, "tokenize": false } } [] [] [2022-04-27 21:09:27] report.INFO: Incoming response from https://world.preprod.api-ingenico.com/ (requestId='6710111e-d109-4fc9-978c-748e73cf710f') HTTP/1.1 400 Date: Wed, 27 Apr 2022 21:09:27 GMT Server: Apache X-OneAgent-JS-Injection: true X-Cnection: close Set-Cookie: dtCookie=v_4_srv_26_sn_FC9E96D11DB67680532A32959EF2DC10_perc_100000_ol_0_mul_1_app-3Aea7c4b59f27d43eb_1; Path=/; Domain=.api-ingenico.com; secure Content-Type: application/json Connection: close Transfer-Encoding: chunked

{ "errorId": "6269b107314001c560dfc5103800fc82", "errors": [ { "code": "21000220", "id": "FIELD_LENGTH_INVALID", "category": "CONNECT_PLATFORM_ERROR", "propertyName": "order.shipping.address.name.firstName", "message": "FIELD_LENGTH_INVALID", "httpStatusCode": 400 } ] } [] [] [2022-04-27 21:09:27] report.EMERGENCY: Unable to perform request using communicator configuration: The server returned an error. [] []

Checklist

Before posting an issue, please make sure you've checked the following checklist:

To Reproduce

Please provide clear steps on how to reproduce the behavior. Also provide the following information:

Expected behavior

That redirects to the ingenico checkout and you can pay

mesguerrae commented 2 years ago

for us it is important that the maximum size of the magento fields is respected, because if there can be fields that are of those lengths

rob-spoor commented 2 years ago

The maximum length is defined in the API to be 15 characters, see https://epayments-api.developer-ingenico.com/s2sapi/v1/en_US/java/payments/create.html?paymentPlatform=ALL#payments-create-payload. I don't think can be extended to 255 characters just because Magento uses a longer field length.

mesguerrae commented 2 years ago

What is required is that the plugin controls those lengths and not modify the API (we know and understand that the API works for many merchants).

The duty of a plugin is to function according to what the API requires and in this case that the plugin sends the lengths correctly

bertterheide commented 2 years ago

@mesguerrae a toggle has been added in release 2.7.0 that allows you to limit the length. This setting can be found under the Ingenico payment method > Admin > Limit API field length.

mesguerrae commented 2 years ago

we are currently using version 2.5.0. Until when will this version be supported?