Giter Club home page Giter Club logo

commerce-web-android's People

Contributors

agrawalsunita avatar bdeasy avatar esalazarmc avatar kragavan avatar krupa051290 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

commerce-web-android's Issues

Facing issue Something went wrong.

Hi,

I have integrated the lib(CommerceWebSdk) as you suggested, but facing the issue of "Something went wrong error" in the stage/prod URL environment.

Screenshot_20221010_223306

Below is the code snippet.

`
val locale = Locale.US
val checkoutId = "5tuEqCZoA_RE8Lqr4L0ubIrMvfoFNrhAFvET5ons948e6fe9"
val checkoutUrl = "https://sandbox.src.mastercard.com/srci/"
val allowedCardTypes: MutableSet = HashSet()
allowedCardTypes.add(CardType.MASTER)
allowedCardTypes.add(CardType.VISA)
allowedCardTypes.add(CardType.AMEX)

    val commerceConfig = CommerceConfig(locale, checkoutId, checkoutUrl, allowedCardTypes)
    CommerceWebSdk.getInstance().initialize(this,commerceConfig)
    var button = CommerceWebSdk.getInstance().getCheckoutButton(this);
    findViewById<LinearLayout>(R.id.lin).addView(button)
}

override fun setRequest(request: CheckoutRequest?) {
    Log.d("Raja", "onCreate: ${request.toString()}")
}

override fun getCheckoutRequest(listener: CheckoutRequestListener?) {
    listener?.setRequest(getSrcCheckoutRequest())
}

private fun getSrcCheckoutRequest(): CheckoutRequest? {
    val mastercardFormatSet: MutableSet<MastercardFormat> = HashSet()
    mastercardFormatSet.add(MastercardFormat.ICC)
    mastercardFormatSet.add(MastercardFormat.UCAF)

    val mastercard: CryptoOptions = Mastercard(mastercardFormatSet)
    val cryptoOptionsSet: MutableSet<CryptoOptions> = HashSet()
    cryptoOptionsSet.add(mastercard)

    return CheckoutRequest.Builder()
        .amount(100.0)
        .cartId(UUID.randomUUID().toString())
        .currency("USD")
        .callbackUrl("intent://commerce/#Intent;scheme=mastercarddemo;package=com.test.mastercarddemo;end")
        .cryptoOptions(cryptoOptionsSet)
        .suppressShippingAddress(false)
        .build()
}`

Which one should we use ?

Hello,
I have a question. We use old masterpass sdk(2.0.5) in our project and we want to integrate 3Ds and debit card payment method.
Which one should we use ?

  1. Masterpass Checkout Android SDK - v2.8
  2. commerce-web-android 1.0
    Thanks.

NullPointerException: Once the new checkout button is clicked

I'm facing an issue when I upgraded to the new MasterPass commerce SDK. Once I click on the checkout button:

Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mastercard.commerce.WebCheckoutActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RelativeLayout.addView(android.view.View)' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.RelativeLayout.addView(android.view.View)' on a null object reference
        at com.mastercard.commerce.WebCheckoutActivity.onCreate(WebCheckoutActivity.java:90)
        at android.app.Activity.performCreate(Activity.java:7802)
        at android.app.Activity.performCreate(Activity.java:7791)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

gradlew.bat sets JAVA_HOME to a hardcoded location

Gradle wrapper's gradlew.bat must not depend on whether there is Java installed at D:\java\zulu1.8.0_265\jre or not.

image
image

The issue needs to be investigated further.
If possible, it shall be fixed by regenerating gradlew files, as manual modification of these files is hard to maintain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.