Ingenico-ePayments / connect-sdk-client-swift

Ingenico Connect iOS Swift Client SDK
https://docs.connect.worldline-solutions.com/documentation/sdk/mobile/swift/
Other
5 stars 12 forks source link

error in PreparedPaymentRequest.encryptedFields #2

Closed cazador4 closed 6 years ago

cazador4 commented 6 years ago

Hi guys, We have some problems using this sdk.

We are doing this: session.prepare(paymentRequest, success: { preparedPaymentRequest in print(preparedPaymentRequest.encryptedFields) } and what we are printing is not what the server expects.

We tried with js, objective-c and java sdk's and we only have problems with this sdk.

rob-spoor commented 6 years ago

Can you show us what is printed, both for the Swift SDK and the JS or Objective-C SDK? You can of course obfuscate any sensitive data as needed.

Note that you cannot compare the client SDKs to the server SDKs (e.g. Java), as they have different structure and different purposes.

cazador4 commented 6 years ago

SDK Version: 2.2 Environment: preProduccion ( https://world.preprod.api-ingenico.com ) CreditCard: 4000 0243 2959 6391

preparedPaymentRequest.encryptedFields eyJhbGciOiJSU0EtT0FFUCIsICJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwgImtpZCI6IjhkMTQxYzE1LTYxMDQtNGVhOC04NzEwLTQxOTk0MWE2NzkzNCJ9.UoKTWOi1PUaLJXMI-LATRZMH17CERMvHIW5A1Kwwf8aQxXqIIx5We_X-cfEeke6-UfOThLQjEay7eWv0CLjOgz4DWp3jk34nh87wV7WvzzbwR1GbTSi6rRgI0FDLmS219n_TfcajzKpjkccLql91keVauSva7xjO_8N_VcU2_jzPkjogr1O8dx0NRa3S0G-KE4EefBnUVELLfNofcft7_UrG6T-Y1RJwNnxpZ_U4v4q6cNA1gqPovyJtZIHuQMyPG4XC0ycyMoygMjQWIj0ZK5z2yWDo26XZED7AIeoHIAFgtC_calxkkS4__SmV71cNxEA9zpQsC6TeqFNuGvgnmw.i8QAvCYpI3zFE_3skl_eAg.QBd08c0-c8eF5_TM3iMOpVbkmsRgcnUpiNWIZtPSCPn61rxOW49ExwbNTWOQVXijZS7v1FmwimnGimx6TvOrhcEZgIvcuxPep7xsf6ClbAcr7sRPmzOTvYfUcAmV2Qwf4BEaYze1fRF20atPnxydbvMtr3mbuj_Rs-5kovV_1RR4Pm71pAQGPrnIbUKx3KXGP5uR2Z1fS-5aFDOYkUlGInQ5dmnFfmIhhD-n01ed2HaXhioiaYIvci3VXNmX9qfOYrjfqy4V61I-RPhj8QbvcEptRV1WjolCHSoO5G3omrc.ug8bJSxH3zW3I5UGh_rrs77PD_KxDehyStQySEbaxPY

rob-spoor commented 6 years ago

And what does any of the other C2S SDKs return with the same key and input?

rob-spoor commented 6 years ago

I also suggest you remove the credit card number from your comment. The encrypted fields will not be useful for anyone without the matching private key, but the card number should not be shared.

cazador4 commented 6 years ago

The credit card number is a dummy card. link

cazador4 commented 6 years ago

Objective-C

eyJhbGciOiJSU0EtT0FFUCIsICJlbmMiOiJBMjU2Q0JDLUhTNTEyIiwgImtpZCI6IjhkMTQxYzE1LTYxMDQtNGVhOC04NzEwLTQxOTk0MWE2NzkzNCJ9.Atc37-WnFnoi_x6Wdn3r4YPwiCIcknk8C6zHa-db6MzZBWOqyaAS7qc_25eBY1iF70aRp05THGGZ942KPMkSZUo0MGDprd9yhJkNVXAF4fcyo58S5P2_rL0L5GB4MIjYwLk6-rFKJgnGaNmNR1apEXNYOOpcGJbrcOG4mi3dckUN6I1lqhg84ZMy5-CFtBcAjcLC0uTV3kc0tNlrmlYpi-EDHwWGfbn5BWuEtaCEznjSenPxlNxvoAUpY7EVoQTVdF4kepdNZ_RKS_zQPAsNmblkN8tNx3yIfrASYMNYeGbH6yd9pfZyb4GmDBkAzGL-FCyyKaAeV2qLZtxW1qBS7Q.WSQssx2-Yrejqzuodmm4IA.qBU48rJonoBjMKOtoqxsiZSHJXCMoFBOSKebDDO6FX-4kasNfq-z-wNlRmZXqA1W1Rfk9D5BIsxCR8RtOUMmyeibJeSKeHWeTGth6St17-wjPywgIb4oRBowsH48RsUbC7kjV0_kJdLM0mB2bAbaKVlSisrW7GLkM6eZQ2i6iPUOrT5P1SRIBSK5T_Yad5FSAdzVGNGDdiGbXLjUJGm1IetON7NaKyW_4wNplJ4h7XlBaJjaDVtzAy1CnBPf1zNsRmXVwkyhla4_fTx9lkz1voAAiN7A-_PqUXSuyBPVUfmnjC0JvCPH_SZD1NWA8sPmx1Qfz1GuK8yarxJyFqjxfSM6rS60wVQrUn1Pl7rmUcA.wlsTu4qAyVAx6pu7fFlMYF81v9atKXgKQRCYC5nvrw0

rob-spoor commented 6 years ago

And these are with the exact same input? I have tried to encrypt some data myself, and I get similar output. There are differences in the length of the encrypted text, but that can be attributed to the content of the data to encrypt.

rob-spoor commented 6 years ago

Can you perhaps tell us what error you are getting?

cazador4 commented 6 years ago

Error:

{
  "errorId" : "478180aa-7217-487c-9e98-26a5a1ea332c",
  "errors" : [ {
     "code" : "1700",
     "id" : "INVALID_CONSUMER_INPUT_ENCRYPTION",
     "category" : "CONNECT_PLATFORM_ERROR",
     "propertyName" : "encryptedCustomerInput",
     "message" : "INVALID_CONSUMER_INPUT_ENCRYPTION",
     "httpStatusCode" : 400
  } ]
}
cazador4 commented 6 years ago

any idea of what is going on?

rob-spoor commented 6 years ago

We are looking into it.

rob-spoor commented 6 years ago

We've fixed this in version 2.2.1. This should make its way to Cocoapods within a few hours.