Gopinathan B
Gopinathan B

Reputation: 382

How to do 3-D Secure Authentication in Mastercard Gateway Android SDK?

I followed https://github.com/Mastercard-Gateway/gateway-android-sdk/wiki this to make payment in my application.

Used test Merchant Id initially to create session by below API. https://mtf.gateway.mastercard.com/api/rest/version/56/merchant/DB***/session/SESSION000****

Which gave session id in response and with that updated my card details in update session API. Got success message like {"session":{"updateStatus":"SUCCESS","version":"cd9f6b9602"}}

After that I generate a random 3DSecureId for testing and passed sessionId, AMOUNT, CURRENCY, 3dSecureId in check3DSecureEnrollment API.

But getting - Error Unexpected response code 400. I couldn't able to figure what is the issue in this params?

Another try is - https://github.com/Mastercard-Gateway/gateway-android-sdk/wiki/3D-Secure-Authentication

Checked for option 1 & 2 in the above link. Showing Error inflating class layout InflateException.

Needed help to resolve these issues?

Upvotes: 0

Views: 2349

Answers (1)

Sreehari K
Sreehari K

Reputation: 979

Me too was facing the same issue. Since there is no good documentation its hard to fix these kinds of issues. To solve the issue you mentioned, my approach was to take Gateway3DSecureActivity out of the library

Intent intent = new Intent(this, Gateway3DSecureActivity.class);
intent.putExtra(Gateway3DSecureActivity.EXTRA_HTML, html);
intent.putExtra(Gateway3DSecureActivity.EXTRA_TITLE, title); // optional

startActivityForResult(intent, YOUR_3DS_REQUEST_CODE);

So I replaced Gateway3DSecureActivity in the code above with my custom activity

I was working on Kotlin so I created my own activity to handle the response which works fine. The Exception is due to the structure of the layout. The layout starts with layout tag which is the reason for the crash. So we can create our own activity without this tag that's what I have done.

Please have a look at my gist

Upvotes: 0

Related Questions