veritrans / veritrans-android

The easiest way to integrate with Veritrans payment API on android
MIT License
74 stars 54 forks source link

error inflating layout #168

Closed porpuera closed 7 years ago

porpuera commented 7 years ago

when i click this button error. uiBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Logger.i("config>clientkey:" + MidtransSDK.getInstance().getClientKey()); Logger.i("config>merchantUrl:" + MidtransSDK.getInstance().getMerchantServerUrl()); Logger.i("config>sdkurl:" + MidtransSDK.getInstance().getSdkBaseUrl()); Logger.i("config>timeout:" + MidtransSDK.getInstance().getRequestTimeOut()); MidtransSDK.getInstance().setTransactionRequest(initializePurchaseRequest(UI_FLOW)); MidtransSDK.getInstance().startPaymentUiFlow(MainActivity.this); } });

this error log : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.veritranssample/com.midtrans.sdk.uikit.activities.UserDetailsActivity}: android.view.InflateException: Binary XML file line #32: Error inflating class

how to solve this.?

thanks before.

rakawestu commented 7 years ago

Hi @porpuera.

Could you elaborate the way you initialize the SDK? Also more logs if possible.

porpuera commented 7 years ago

i got the code from this file https://github.com/veritrans/veritrans-android/blob/master/sdk-example/src/main/java/com/midtrans/sdk/sample/MainActivity.java and initialize the SDK same like on MainActivity.java.

rakawestu commented 7 years ago

@porpuera Did you also use this code?

           // SDK initiation for UIflow
            SdkUIFlowBuilder.init(this, BuildConfig.CLIENT_KEY, BuildConfig.BASE_URL, this)
                    .setDefaultText("open_sans_regular.ttf")
                    .setSemiBoldText("open_sans_semibold.ttf")
                    .setBoldText("open_sans_bold.ttf")
                    .buildSDK();

You need to set font with same name as supplied on builder at assets directory.

porpuera commented 7 years ago

ok thanks, i miss the asset fonts.

but i have any problem.

this CLIENT_KEY = "VT-client-obH*****"; BASE_URL = "https://api.sandbox.veritrans.co.id/v2";

when i get retrieving payment methods i got error dialog "failed to registering transaction method"

how to solve this?

rakawestu commented 7 years ago

Hi @porpuera.

finn-deagle commented 7 years ago

permisi mas @rakawestu , saya punya masalah seperti diatas. ketika saya klik button UIFLOW dan button pembayaran yang lain muncul error seperti yang diatas. kira - kira masalahnya apa ya?

KONFIGURASI GRADLE saya sperti dibawah : CLIENT_KEY = "VT-client-5de17Vho***" BASE_URL = "https://app.sandbox.midtrans.com/snap/v1/transactions"

rakawestu commented 7 years ago

@finn-deagle Did you implement the merchant server? BASE_URL is not midtrans URL but your server URL. Please take a look at this page.

https://github.com/veritrans/veritrans-android/wiki/Implementation-for-Merchant-Server

finn-deagle commented 7 years ago

oh yes, I See.

I have more question, to create "token" I must send request to https://app.sandbox.midtrans.com/snap/v1/transactions, with authorization header.???

On Wed, May 3, 2017 at 4:28 PM, Raka Westu Mogandhi < notifications@github.com> wrote:

@finn-deagle https://github.com/finn-deagle Did you implement the merchant server? Please take a look at this page.

https://github.com/veritrans/veritrans-android/wiki/ Implementation-for-Merchant-Server

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/veritrans/veritrans-android/issues/168#issuecomment-298840586, or mute the thread https://github.com/notifications/unsubscribe-auth/Aa4FV3yewtSClWLkoZibBvMwpi2Px-RWks5r2CylgaJpZM4KvaEc .

dindatisi commented 7 years ago

hi @finn-deagle for faster response, please send your questions to support@midtrans.com as we don't always monitor the issues here. thanks