ziahaqi / sample-uikit

Sample implementation of midtrans uikit sdk
https://mobile-docs.midtrans.com/#android-sdk
13 stars 5 forks source link

request method using GET #5

Open thoma-rf opened 6 years ago

thoma-rf commented 6 years ago

I use this with 1.20.0-SANDBOX I set this app to get token from my local server (localhost, using sample https://github.com/rizdaprasetya/midtrans-mobile-merchant-server--php-sample-) the server works fine, I tested it using Postman app. but, if I request using this app, always returns 404, because it uses GET

some logs from app

D/Retrofit: ---> HTTP POST http://192.168.6.31/midtrans-sp/charge Accept: application/json X-Source: mobile-android Accept: application/json Content-Type: application/json Content-Length: 706 D/Retrofit: <--- HTTP 404 http://192.168.6.31/midtrans-sp/charge (100ms) Date: Mon, 23 Jul 2018 12:35:28 GMT Server: Apache/2.4.29 (Ubuntu) Content-Length: 9 Keep-Alive: timeout=5, max=99 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8 D/Retrofit: req = GET // this is my web server output

thoma-rf commented 6 years ago

found out the issue was in the apache setting. this app request /charge but apache store it in /charge/ thus the request redirected to /charge/ by apache. this redirection makes the POST request become GET, because apache sends response code 301. some reference suggest modify the redirect using 307 , but retrofit in the the app does not handle it.

TLDR; my work around solution is to re-implement the webservice using node. https://github.com/thoma-rf/ws-mid

Sudhakaraks03 commented 5 years ago

Hi i'am trying to Integrate Midtrans Mobile SDK to one of our client app i'am trying to add customer details like below

mCustomerDetails.setEmail(manager.getEmail()); BillingAddress billingAddress=new BillingAddress(); billingAddress.setCountryCode("+62"); mCustomerDetails.setBillingAddress(billingAddress);

but after redirecting to midtrans webpage i'am getting the below Error "customer_details.billing_address.country_code jumlah karakter salah(seharusnya 3 karakter) " in Popup can anyone please help me ASAP Thanks>