Code Monkey home page Code Monkey logo

android-checkout-sdk's People

Contributors

aditya-kapadiya avatar chpypl avatar chrisguzman avatar codyengel avatar gabo-alv avatar jcnoriega avatar kelay858 avatar mahmoud-turki avatar maxhastingspp avatar saperi22 avatar tdchow avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-checkout-sdk's Issues

Error while capturing order

I have archived get my app to LIVE, but in the time of capturing orders in client side with this SDK I get the following error
message=Capture order failed., reason=LSAT upgrade failed while capturing order.
This is my clientId in LIVE.
AdpuP9npnFtPPy5motOKzr5EglnWvbKjGwWWqXG9tCItxeeUHBfjBsjflQQwA6EOnQVzJHRfUFn93avl

@tdchow Please Help.

Double-click an entry in the PayPal address list, the APP flashes back

Describe the bug
Double-click an entry in the PayPal address list, the APP flashes back

To Reproduce
Steps to reproduce the behavior:

  1. Login paypal
  2. Click on 'Shipping address options'
  3. Double click any entry of paypal address list.
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots

screen_video.mp4

Smartphone (please complete the following information):

  • Android Version: [Android 9.0 API 28]
  • Device: [Samsung Galaxy S9]
  • SDK Version [0.3.1 ~ 0.5.1]

build.gradle

minSdkVersion 23
targetSdkVersion 30

while Using SDK with server-side integration, client can not pay the order

while Using SDK with server-side integration, client click the button "查看订单 check the order",there is no way to pay

image

CheckoutConfig:

CheckoutConfig config = new CheckoutConfig(
                    application,
                    Global.PayPalClientId,
                    Global.isUsePayPalSandBox ? Environment.SANDBOX : Environment.LIVE,
                    String.format("%s://paypalpay", getPackageName()),
                    CurrencyCode.USD,
                    UserAction.PAY_NOW,
                    new SettingsConfig(
                            true,
                            false
                    )
            );
            PayPalCheckout.setConfig(config);

Method Setup:

directPayPopupWindow?.view?.findViewById<PayPalButton>(R.id.btn_paypal_pay)?.setup(
                        object : CreateOrder {
                            override fun create(createOrderActions: CreateOrderActions) {
                                createOrderActions.set(transaction_id)
                            }
                        },
                        object : OnApprove {
                            override fun onApprove(approval: Approval) {
                                checkOrder(order_id, Global.PAYPAL_PAY, Constants.EVENT_PAY_SUCC, Companion.payCallBack)
                            }
                        },
                        object : OnCancel {
                            override fun onCancel() {
                                checkOrder(order_id, Global.PAYPAL_PAY, Constants.EVENT_PAY_CANCEL, Companion.payCallBack)
                            }
                        },
                        object : OnError {
                            override fun onError(errorInfo: ErrorInfo) {
                                checkOrder(order_id, Global.PAYPAL_PAY, Constants.EVENT_PAY_FAIL, Companion.payCallBack)
                            }
                        }
                )

paypal SDK Version:0.3.1
environment: SANDBOX

Exception thrown when cancelling

@CodyEngel Hello, i'm having another issue.

If i tap on the cancel label my app crashes with the following exception:

Fatal Exception: kotlin.UninitializedPropertyAccessException: lateinit property accessToken has not been initialized
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.getCheckoutLiteUrl(PYPLCheckoutUtils.kt:235)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.getCheckoutLiteUrl$default(PYPLCheckoutUtils.kt:167)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.fallBackToWeb(PYPLCheckoutUtils.kt:335)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.fallBack(PYPLCheckoutUtils.kt:309)
at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel$3.authFailure(MainPaysheetViewModel.java:537)
at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth$2.completeWithFailure(ThirdPartyAuth.java:122)
at com.paypal.authcore.authentication.Authenticator$a.onReceive(:75)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

com.google.gson.JsonSyntaxException

Before you create a new issue, please search for similar issues. It's possible somebody has encountered this bug already. PLEASE REMOVE THIS LINE TO ACKNOWLEDGE THAT AN ISSUE DOESN'T ALREADY EXIST FOR THIS BUG

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Android Version: [e.g. API 30]
  • Device: [e.g. Emulator or One Plus 9]
  • Browser [e.g. chrome, safari] <- only applicable for app switches or fallback situations
  • SDK Version [e.g. 0.1.0]
    1636946597(1)

Additional context
Add any other context about the problem here.
1636946633(1)
1636946536(1)

Paypal android checkout sdk gives invalid scope in live mode

I am developing an android application which includes in-app Paypal payments for buying coins.
I am using the latest version 0.3.0.
I am facing the following error when clicking Paypal Button in LIVE mode
Screenshot_2021-07-06-12-51-15

I have the following configuration in my code:

val environment: Environment = if (resources.getBoolean(R.bool.production)) Environment.LIVE else Environment.SANDBOX
val config = CheckoutConfig(
        this,
        getString(R.string.paypal_client_id), environment,
        "by.the.way://paypalpay", CurrencyCode.USD, UserAction.PAY_NOW,
        SettingsConfig(
                true,
                false
        )
)
setConfig(config)

This is the code for buying coins:

btnPaymentPayPal.setup(object : CreateOrder {
            override fun create(createOrderActions: CreateOrderActions) {
                val purchaseUnits = ArrayList<PurchaseUnit>()
                purchaseUnits.add(
                        PurchaseUnit.Builder()
                                .amount(
                                        Amount.Builder()
                                                .currencyCode(CurrencyCode.USD)
                                                .value(coinsPakageModel.price.toString())
                                                .build()
                                )
                                .description(coinsPakageModel.name)
                                .build()
                )
                val order: Order = Order.Builder().appContext(
                        AppContext.Builder()
                                .userAction(UserAction.PAY_NOW)
                                .build()
                ).intent(OrderIntent.CAPTURE)
                        .purchaseUnitList(purchaseUnits).build()
                createOrderActions.create(order)
            }
        },
                object : OnApprove {
                    override fun onApprove(approval: Approval) {
                        approval.orderActions.capture(object : OnCaptureComplete {
                            override fun onCaptureComplete(result: captureOrderResult) {
                              //...
                            }
                        })
                    }
                },
                object : OnCancel {
                    override fun onCancel() {
                        //...
                    }
                },
                object : OnError {
                    override fun onError(errorInfo: ErrorInfo) {
                        //...
                    }
                }
        )

And this is my Paypal Configuration in developers dashboard. My account is a business account :
javierfiguerasm_1-1626812818709
javierfiguerasm_2-1626812842945
javierfiguerasm_3-1626812920165
javierfiguerasm_0-1626812684530

Paypal Retunr Url

Screenshot_2021-04-26 Edit applications - PayPal Developer(1)

My application id is "soft.agency.kbt.com.i69.stage". In Paypal Developer, when I try to add this in return url with "://paypalpay". it always says "Oauth invalid return URL".

But when I remove the number from my application id, it works but the problem is I cannot change my application id as it is already published in the google playstore. please tell me what to do?

General instability/incompatibility with SDK

I have imported com.paypal.checkout:android-sdk:0.1.0 into my project for native deposit flow - running into a number of issues on varying OS levels.

Implementation Details

We are making use of the Server-side integration. There is no issue with our server implementation in regards to the creation of the orderId that we pass along to the SDK. As a reference, this is called once we get the orderId from our backend:

private fun startPayPalDeposit(paypalOrderId: String) {
        checkoutSdk.start(
            createOrder = CreateOrder { createOrderActions ->
                createOrderActions.set(paypalOrderId)
            },
            onApprove = OnApprove {
                viewModel.capturePaypalDeposit(paypalOrderId)
            },
            onCancel = OnCancel {
                viewModel.onStopLoading()
            },
            onError = OnError {
                viewModel.onStopLoading()
            }
        )
    }

For what it is worth, this exact implementation has no issues on newer versions of Android, API 26+.

Running on Android API 21

java.lang.RuntimeException: Feature only supported for versions Android-M and above
        at com.paypal.authcore.security.BaseSecureKeyWrapper.generatePublicKey()
        at com.paypal.authcore.security.NoAuthSecureKeyWrapper.generateAsymmetricKeyPair()
        at com.paypal.authcore.authentication.Authenticator.a()
        at com.paypal.authcore.authentication.Authenticator.authenticateForAccessTokenWithDelegate()
        at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth.getUserAccessToken(ThirdPartyAuth.java:140)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.logInUser(MainPaysheetViewModel.java:1036)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$u3bJQV5CM255mmoJkHAH5Y7Tgzs(MainPaysheetViewModel.java)
        at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$u3bJQV5CM255mmoJkHAH5Y7Tgzs.onUpdateClientConfig(lambda)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$updateClientConfigBefore$11(MainPaysheetViewModel.java:394)
        at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$bZWZcCIiVLiE6wcvi0c3LrRX6pk.onEvent(lambda)
        at com.paypal.pyplcheckout.events.Events.fire(Events.java:109)
        at com.paypal.pyplcheckout.services.callbacks.ClientConfigUpdateCallback.onApiSuccess(ClientConfigUpdateCallback.kt:53)
        at com.paypal.pyplcheckout.services.callbacks.BaseCallback.onResponse(BaseCallback.kt:38)
        at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:69)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)

This doesn't make sense to me since the CHANGELOG.md only calls out API 23 as the minimum in Version 0.4.0. However, after checking the source code pulled into the project, I can see this:

    @TargetApi(23)
    @NonNull
    public PublicKey generatePublicKey(@NonNull String var1, boolean var2)

Running on Android API 23

First, the app will launch the user to the browser to select which payment method they want to use from their account. Then upon selecting one and clicking the Continue button, it will display a loading screen and say something along the lines of "Returning you to XYZ Inc". When the application returns, this overlay is presented to the user and nothing happens. The only thing I can find in the logs that might be relevant is this:
No one listening to the event of type NATIVE_CHECKOUT_PAY_SHEET_LIFE_CYCLE.

Screenshot_1630601079

Additional notes

If I try to upgrade the library to com.paypal.checkout:android-sdk:0.2.0 (I also add the necessary info to the project-level build.gradle file), I get this as output when running on API 21:

java.lang.RuntimeException: Feature only supported for versions Android-M and above
        at com.paypal.authcore.security.BaseSecureKeyWrapper.generatePublicKey()
        at com.paypal.authcore.security.NoAuthSecureKeyWrapper.generateAsymmetricKeyPair()
        at com.paypal.authcore.authentication.Authenticator.a()
        at com.paypal.authcore.authentication.Authenticator.authenticateForAccessTokenWithDelegate()
        at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth.getUserAccessToken(ThirdPartyAuth.java:140)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.logInUser(MainPaysheetViewModel.java:1285)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$u3bJQV5CM255mmoJkHAH5Y7Tgzs(MainPaysheetViewModel.java)
        at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$u3bJQV5CM255mmoJkHAH5Y7Tgzs.onUpdateClientConfig(lambda)
        at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$updateClientConfigBefore$17(MainPaysheetViewModel.java:623)
        at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$aNrB20LFlUkv6bj-6UgWWnDtt-A.onEvent(lambda)
        at com.paypal.pyplcheckout.events.Events.fire(Events.java:109)
        at com.paypal.pyplcheckout.services.callbacks.ClientConfigUpdateCallback.onApiSuccess(ClientConfigUpdateCallback.kt:54)
        at com.paypal.pyplcheckout.services.callbacks.BaseCallback.onResponse(BaseCallback.kt:38)
        at com.google.firebase.perf.network.InstrumentOkHttpEnqueueCallback.onResponse(InstrumentOkHttpEnqueueCallback.java:69)
        at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)

Again, this is quite annoying since the CHANGELOG.md calls out this library bump in Version 0.4.0, but the function is likely annotated like it was in 0.1.0.

When running com.paypal.checkout:android-sdk:0.2.0 on API 23, we end up with the same issue as shown above for the same API version (the picture of the transparent Activity over our application) with a bunch of different errors:

E/InstrumentationErr: Error Parsing Experiment fetchAndHandleExperiments()
    java.lang.Exception: Error Parsing Experiment
        at com.paypal.pyplcheckout.ab.elmo.Elmo.fetchRemoteTreatment(Elmo.kt:94)
E/InstrumentationErr: java.lang.Exception: Experiment not found in cache fetchAndHandleExperiments()
    java.lang.Exception: Experiment not found in cache
        at com.paypal.pyplcheckout.ab.elmo.Elmo.getTreatment(Elmo.kt:111)
E/InstrumentationErr: java.lang.Exception: Experiment not found in cache fetchAndHandleExperiments()
    java.lang.Exception: Experiment not found in cache
        at com.paypal.pyplcheckout.ab.elmo.Elmo.getTreatment(Elmo.kt:111)
E/InstrumentationErr: error in reading UserCheckoutResponse Binary XML file line #11: Binary XML file line #11: Error inflating class ImageView
    android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class ImageView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)

All of these errors are returned with just a single transaction attempt.

Regardless of what I upgrade the library to, if I update the project to target API 23, a device at that level crashes when pulling up wallet due to:

E/InstrumentationErr: error in reading UserCheckoutResponse Binary XML file line #11: Binary XML file line #11: Error inflating class ImageView
    android.view.InflateException: Binary XML file line #11: Binary XML file line #11: Error inflating class ImageView
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)

The theme for the project: Theme.MaterialComponents.DayNight.NoActionBar.

Conclusion

There seem to be a handful of issues at lower API levels. Specifically 21 and 23 having issues no matter which library version available. All of these tests ran on emulated Pixel devices with Google Play Services x86 straight from the AVD Manager. I haven't tested versions 24 and 25 at the moment, so I don't know where the exact floor is, but the same implementation in code works for API level 26, 29, 30 regardless of library version.

java.lang.IllegalStateException

java.lang.IllegalStateException:
at com.paypal.openid.AuthorizationService.a (Unknown Source:9)
at com.paypal.openid.AuthorizationService.a (Unknown Source)
createCustomTabsIntentBuilder
dispose
performAuthorizationRequest
performTokenRequest
performTokenRequest
at com.paypal.authcore.authentication.Authenticator.a (Unknown Source:194)
a
a
a
a
authenticateForAccessTokenWithDelegate
getAuthService
getUriFromUrl
at com.paypal.authcore.authentication.Authenticator.a (Unknown Source:96)
a
a
a
a
authenticateForAccessTokenWithDelegate
getAuthService
getUriFromUrl
at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth.getUserAccessToken (SourceFile:2)
at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.logInUser (SourceFile:4)
at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$gzn7IQlqWzbNXDntwRSNZFJjIRk (Unknown Source)
lambda$new$0
lambda$new$0
lambda$new$0
lambda$new$0
lambda$new$3
lambda$new$4
lambda$onLifeCycleCreate$5
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$createContingencyEventListener$19
lambda$updateClientConfigBefore$22
lambda$startThreeDsFlow$25
at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$gzn7IQlqWzbNXDntwRSNZFJjIRk.onUpdateClientConfig (Unknown Source:2)
at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$gzn7IQlqWzbNXDntwRSNZFJjIRk (SourceFile:21)
lambda$updateClientConfigBefore$22
at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$0qi8S4gTaHTffyGJVKC2HNZy5Ng.onEvent (Unknown Source:2)
at com.paypal.pyplcheckout.events.Events.fire (SourceFile:5)
at com.paypal.pyplcheckout.services.callbacks.ClientConfigUpdateCallback.onApiSuccess (SourceFile:16)
at com.paypal.pyplcheckout.services.callbacks.BaseCallback.handleApiSuccess (SourceFile:7)
at com.paypal.pyplcheckout.services.callbacks.BaseCallback.onResponse (SourceFile:8)
at okhttp3.internal.connection.RealCall$AsyncCall.run (SourceFile:7)
at java.util.concurrent.ThreadPoolExecutor.processTask (ThreadPoolExecutor.java:1187)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:784)
1637814175(1)

1637814091(1)

Only Published App can pass the app review request to pay in live environment?

Only Published App (eg: In Google Play, Apple Store, Huawei Application Market and so on) can pass the app review request to pay in live environment?

It work fine in sandbox mode, but when I switch to live mode, it shows the error "invalid scope"(issue #24 ).

I send the email to ur team and got the error msg:
Access denied to your site/application.

Hope u can answer my question!

Throws java.lang.IllegalArgumentException if the return url contains underscore

Hello,

My application id contains underscore (_) and when i set it as return url it throws
Caused by: java.lang.IllegalArgumentException: Check your returnUrl! It should contain your app's package name appended with "://paypalpay".

And if i change the return url the checkout doesn't work and also i couldn't able to set return url on developer dashboard as it also doesn't support underscore.

I couldn't able to change my application ID as its already published on play store.

Invalid Scrope on PayPal.com Page in Chrome

When I run this code after cloned it. Then Change my Client & Secret Key Live after that on the Client Integration button click open create order page after filling all forms then Submit it redirect on Paypal.com page but showing invalid scope nothing performs. Please see a screenshot from the attachment.

image_2021_09_02T04_10_24_240Z

OnApproval like REST v2

Hi all,

In my integration, after completing the order with the onApproval callback, we have to send to our server a set of information regarding the order. To get this data we call the rest api /v2/checkout/orders/id with the order id received from the SDK.

Is it possible to get the same information with the current version of the SDK?

In the last version, some of the data of the order seems to have been added, are you planning to introduce the other data in a feature release?

Have a nice day,
Lorenzo

App review request

We want to use paypal in our app.We have sent an email to [email protected] in order to permission to App review request,but we received an email reply from [email protected] stating that the review process has been modified and go to developer.paypal.com and create an app with Log in with PayPal scopes, this will trigger an app review to the right team.

It seems that we have created the APP. Could you advise us what should we do next? We don't know the steps about how to get the review request approved? We need you advise us how to do one step by one step, thanks.

Client ID of the live app:
AZ2qZ-_Qy3vY7prQSFwqA2BJiPRFLiWRuiCyPihQWp9DgEZPdDDmq4sX6G4NW2FjXvIlR43GcUcuZQLO

This card can't be used for this type of transaction

Describe the bug
My client is always getting this error. As you said to contact the Paypal Support team, I contacted them and they said to try with one of the relatives or another person's PayPal account. We tried that. But We are having always the same error in PayPal Live Mode. Images Attached. Please help me. It's happening always. The Screenshots are written in France Language But In English we get the error that "This card can't be used for this type of transaction"

Screenshots
Screenshot_20210526-214710_AnyDesk
Screenshot_20210526-215007_AnyDesk
Screenshot_20210526-214654_AnyDesk
Screenshot_2021-05-23 Case 08790770

Smartphone (please complete the following information):

  • Android Version: API 30 and API 29 (Both Versions Tested)
  • Device: SAMSUNG J4, SAMSUNG M21
  • Browser [chrome]
  • SDK Version [0.1.0]

CaptureOrderResult.Success is lacking payment information

Hi @CodyEngel ,

We have implemented refunds with the PHP SDK, and for that we need the paymentID or captureID (i don´t know).

On iOS we get this value on the success response of the capture method. However, in android we only get an orderStatus which is an enum and an ID which is the orderID and is no good for us to call the refund method.

Could you please implemente on the android SDK the same information that we get on the iOS SDK?

OrderContextNotAvailableException while capturing payment

Describe the bug
While capturing payment inside onApprove, app crashed giving OrderContextNotAvailableException

To Reproduce
Steps to reproduce the behavior:

  1. Get order id from own server
  2. set order id inside createOrder
  3. complete payment
  4. See error

Expected behavior
It should work without crashing

Smartphone (please complete the following information):

  • Android Version: Api 29
  • Device: Samsung m31s
  • SDK Version 0.2.0 & 0.3.0

Additional context

com.paypal.checkout.order.OrderContextNotAvailableException: Tried to retrieve OrderContext before it was created.
        at com.paypal.checkout.order.OrderContext$Companion.get(OrderContext.kt:27)
        at com.paypal.checkout.order.UpdateOrderStatusAction$execute$orderContext$1.invokeSuspend(UpdateOrderStatusAction.kt:27)
        at com.paypal.checkout.order.UpdateOrderStatusAction$execute$orderContext$1.invoke(Unknown Source:10)
        at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
        at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:161)
        at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
        at com.paypal.checkout.order.UpdateOrderStatusAction.execute(UpdateOrderStatusAction.kt:26)
        at com.paypal.checkout.order.CaptureOrderAction$execute$2.invokeSuspend(CaptureOrderAction.kt:21)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

Problem with version 0.4

After updating the SDK to version 0.4.0 and 0.4.1 all transactions on the LIVE environment started failing with the error on the screenshot. This happens right after tapping on the PayPalButton.
Prior to this update, everything was working fine. We also have an iOS implementation using the same account and it works ok.

image

  • Android Version: API 30
  • Device: Mulitple devices
  • SDK Version 0.4.0 and 0.4.1

Unable to build the app with Gradle plugin 7.0.3. when the checkout sdk is added

When you have the Android Gradle plugin version 7.0.2 or 7.0.3 and targeting Android 12 (compileSdkVersion = 31 and targetSdkVersion = 31 in the app Gradle file), the manifest merging when building the app fails due to some Activities with intent filters don't have explicitly set the exported attribute in the checkout SDK's manifest file.

Steps to reproduce the behavior:

  1. Update gradle plugin version to 7.0.2 or 7.0.3
  2. Set compileSdkVersion and targetSdkVersion in your app's gradle file to 31
  3. Add the checkout sdk dependency as described in the PayPal docs or in quickstart sample app.
  4. Try to build you app on a device or emulator targeting Android 11 or 12 (API 30 or 31)

Expected behavior
The app should build and install.

Smartphone (please complete the following information):

  • Android Version: API 30, API 31
  • Device: Any device or emulator with Android 11 (30) or Android 12 (31)
  • SDK Version [e.g. 0.5.1]

Payment Button status always returns error on version 0.4.0

Hi @CodyEngel,

After migrating to version 0.4.0 the payment button always appears loading and the gets hidden.
I have this code to make a log:
payPal.setPaymentButtonEligibilityStatusChanged(paymentButtonEligibilityStatus -> Log.i("PaymentButtonEligibility", String.format("paymentButton : %s", paymentButtonEligibilityStatus)));

The output is the following:
2021-08-09 14:48:40.733 23927-23927/pt.zonesoft.biip I/PaymentButtonEligibility: paymentButton : Loading
2021-08-09 14:49:10.778 23927-23927/pt.zonesoft.biip I/PaymentButtonEligibility: paymentButton : Error

  • Android Version: API 30
  • Device: Emulator
  • SDK Version 0.4.0

SDK crash on second order after login

Hi, after the login with a sandbox account the order is confirmed and everything is ok.
While trying to create a new order however the SDK crash with the following

kotlin.UninitializedPropertyAccessException: lateinit property accessToken has not been initialized
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.getCheckoutLiteUrl(PYPLCheckoutUtils.kt:239)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.getCheckoutLiteUrl$default(PYPLCheckoutUtils.kt:171)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.fallBackToWeb(PYPLCheckoutUtils.kt:337)
at com.paypal.pyplcheckout.utils.PYPLCheckoutUtils.fallBack(PYPLCheckoutUtils.kt:311)
at com.paypal.pyplcheckout.auth.AuthHandler.authFailure(AuthHandler.kt:84)
at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth$2.completeWithFailure(ThirdPartyAuth.java:122)
at com.paypal.authcore.authentication.Authenticator$b.onTokenRequestCompleted(Unknown Source:6)
at com.paypal.openid.AuthorizationService$b.a(Unknown Source:57)
at com.paypal.openid.AuthorizationService$b.onPostExecute(Unknown Source:2)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.access$600(AsyncTask.java:180)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

I'm using the last version of the sdk (0.3.1)

FATAL EXCEPTION: OkHttp Dispatcher Process: com.xxx.xxx, PID: 15025 android.content.ActivityNotFoundException at com.paypal.openid.AuthorizationService.a()

Action:
when I click the paypal button , anr shows(Two Nexus phone acts normally, A samsung phone does not behave properly ).

Logcat:
FATAL EXCEPTION: OkHttp Dispatcher Process: com.xxx.xxx, PID: 15025 android.content.ActivityNotFoundException at com.paypal.openid.AuthorizationService.a() at com.paypal.openid.AuthorizationService.performAuthorizationRequest() at com.paypal.authcore.authentication.Authenticator.a() at com.paypal.authcore.authentication.Authenticator.authenticateForAccessTokenWithDelegate() at com.paypal.pyplcheckout.flavorauth.ThirdPartyAuth.getUserAccessToken(ThirdPartyAuth.java:140) at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.logInUser(MainPaysheetViewModel.java:1423) at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$gzn7IQlqWzbNXDntwRSNZFJjIRk(MainPaysheetViewModel.java) at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$gzn7IQlqWzbNXDntwRSNZFJjIRk.onUpdateClientConfig(lambda) at com.paypal.pyplcheckout.home.viewmodel.MainPaysheetViewModel.lambda$updateClientConfigBefore$18(MainPaysheetViewModel.java:676) at com.paypal.pyplcheckout.home.viewmodel.-$$Lambda$MainPaysheetViewModel$7bqLPJINhX0FCLdPicr9f-mb2EU.onEvent(lambda) at com.paypal.pyplcheckout.events.Events.fire(Events.java:119) at com.paypal.pyplcheckout.services.callbacks.ClientConfigUpdateCallback.onApiSuccess(ClientConfigUpdateCallback.kt:54) at com.paypal.pyplcheckout.services.callbacks.BaseCallback.onResponse(BaseCallback.kt:38) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:504) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818)

Phone:
Samsung SM-G9280, Android 6.0.1, android-checkout-sdk 0.3.1

Request log in paypal scope permission

We want to use paypal in our app.We have sent an email to [email protected] in order to obtain the email permission to log in with paypa,but it's been more than 10 days and we haven't received a reply.Our client_id is: AWpMbiZI8NKS7Fq9LfqLi2iQeLNBGbSlQilzGvl8EtMKPjvNy8xd3PaRZKeZ1H63_b3Ag-LmKIY_51RZ
Thanks a lot for your reply.

lateinit property abManager has not been initialized

When I start Charles and then start my App, My app crashes.
When I start my App and then start Charles, everything goes well.
Here is the log:

# OkHttp Dispatcher(6338)

kotlin.UninitializedPropertyAccessException

lateinit property abManager has not been initialized

com.paypal.pyplcheckout.services.callbacks.BaseCallback.retryOnError(BaseCallback.kt:78)
com.paypal.pyplcheckout.services.callbacks.BaseCallback.onFailure(BaseCallback.kt:40)
okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:525)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
java.lang.Thread.run(Thread.java:923)

Logcat:

Before you create a new issue, please search for similar issues. It's possible somebody has encountered this bug already. PLEASE REMOVE THIS LINE TO ACKNOWLEDGE THAT AN ISSUE DOESN'T ALREADY EXIST FOR THIS BUG

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Android Version: [e.g. API 30]
  • Device: [e.g. Emulator or One Plus 9]
  • Browser [e.g. chrome, safari] <- only applicable for app switches or fallback situations
  • SDK Version [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

There is a problem when I compile and install

**Execution failed for task ':app:checkDebugAarMetadata'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find android.arch.lifecycle:extensions:2.1.0.**
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/android/arch/lifecycle/extensions/2.1.0/extensions-2.1.0.pom
- https://repo.maven.apache.org/maven2/android/arch/lifecycle/extensions/2.1.0/extensions-2.1.0.pom
- https://oss.sonatype.org/content/repositories/snapshots/android/arch/lifecycle/extensions/2.1.0/extensions-2.1.0.pom
- https://cardinalcommerceprod.jfrog.io/artifactory/android/android/arch/lifecycle/extensions/2.1.0/extensions-2.1.0.pom
- file:/C:/Users/Administrator/.m2/repository/android/arch/lifecycle/extensions/2.1.0/extensions-2.1.0.pom
Required by:
project :app > com.paypal.checkout:android-sdk:0.2.0
Could not find android.arch.lifecycle:runtime:2.1.0.

Searched in the following locations:
- https://dl.google.com/dl/android/maven2/android/arch/lifecycle/runtime/2.1.0/runtime-2.1.0.pom
- https://repo.maven.apache.org/maven2/android/arch/lifecycle/runtime/2.1.0/runtime-2.1.0.pom
- https://oss.sonatype.org/content/repositories/snapshots/android/arch/lifecycle/runtime/2.1.0/runtime-2.1.0.pom
- https://cardinalcommerceprod.jfrog.io/artifactory/android/android/arch/lifecycle/runtime/2.1.0/runtime-2.1.0.pom
- file:/C:/Users/Administrator/.m2/repository/android/arch/lifecycle/runtime/2.1.0/runtime-2.1.0.pom
Required by:
project :app > com.paypal.checkout:android-sdk:0.2.0

Possible solution:

Logcat:

Before you create a new issue, please search for similar issues. It's possible somebody has encountered this bug already. PLEASE REMOVE THIS LINE TO ACKNOWLEDGE THAT AN ISSUE DOESN'T ALREADY EXIST FOR THIS BUG

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Smartphone (please complete the following information):

  • Android Version: [e.g. API 30]
  • Device: [e.g. Emulator or One Plus 9]
  • Browser [e.g. chrome, safari] <- only applicable for app switches or fallback situations
  • SDK Version [e.g. 0.1.0]

Additional context
Add any other context about the problem here.

AAPT: error: duplicate value for resource 'attr/button_color' with config ''.

AAPT: error: duplicate value for resource 'attr/button_color' with config ''.
During integration, I have conflicts with the existing three-party SDK resource names of the project. Could you modify the resource names?Or could you guide me to deal with this situation?

values.xml





    <attr format="enum" name="button_size">
        <enum name="small" value="0"/>
        <enum name="medium" value="1"/>
        <enum name="large" value="2"/>
    </attr>

    <attr format="enum" name="button_shape">
        <enum name="rectangle" value="0"/>
        <enum name="pill" value="1"/>
        <enum name="rounded" value="2"/>
    </attr>
</declare-styleable>

lateinit property accessToken has not been initialized

When we wake up SDK payment, we always encounter an occasional crash. The crash log is as follows:
UncaughtException: kotlin.UninitializedPropertyAccessException: lateinit property accessToken has not been initialized

Could not download cardinalmobilesdk-2.2.4-1.aar

What went wrong:
Execution failed for task ':quickstart-kotlin:mergeDebugNativeLibs'.
Could not resolve all files for configuration ':quickstart-kotlin:debugRuntimeClasspath'.
Could not download cardinalmobilesdk-2.2.4-1.aar (org.jfrog.cardinalcommerce.gradle:cardinalmobilesdk:2.2.4-1)

Could not get resource 'https://cardinalcommerceprod.jfrog.io/artifactory/android/org/jfrog/cardinalcommerce/gradle/cardinalmobilesdk/2.2.4-1/cardinalmobilesdk-2.2.4-1.aar'.
Could not GET 'https://jfrog-prod-use1-shared-virginia-main.s3.amazonaws.com/aol-cardinalcommerceprod/filestore/d5/d5eedb4e46acee81da87bdcf572b3c0f90827b9f?x-jf-traceId=4b1ffcdec49adf39&response-content-disposition=attachment%3Bfilename%3D%22cardinalmobilesdk-2.2.4-1.aar%22&response-content-type=application%2Foctet-stream&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210824T031059Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIASG3IHPL6VGZWKQVB%2F20210824%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=f4dbd1c5179cc6cef60220eaec08f9e0fcad39e065933489bd0bd07f33c7ed40'.
Connect to jfrog-prod-use1-shared-virginia-main.s3.amazonaws.com:443 [jfrog-prod-use1-shared-virginia-main.s3.amazonaws.com/52.217.16.12] failed: Read timed out

allprojects {
repositories {
mavenCentral()
mavenLocal()
google()
jcenter()

maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
google()
jcenter()

maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree_team_sdk'
password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
}
}
}

I ran this demo and found this error. Please tell me how to solve this error. Thank you

webpage doesn't redirect back to app after successful login

Hello, I have an issue with my application. The webpage doesn't redirect back to the app after I've logged in. It goes back to the login screen (cc: the picture).
I've put the correct redirect URLs both on the dashboard and in code.
I've cross-checked the application ID too to be sure.
What could be the problem please

Screen Shot 2021-09-30 at 12 13 50 PM

Paypal (sdk version-0.5.1)IllegalArgumentException Cannot add the same observer with different lifecycles

androidx.lifecycle.LiveData in observe at line 6
com.paypal.pyplcheckout.home.view.fragments.HomeFragment in initPYPLHomeViewModelObservers at line 13
com.paypal.pyplcheckout.home.view.fragments.HomeFragment in onActivityCreated at line 12
androidx.fragment.app.Fragment in performActivityCreated at line 4
androidx.fragment.app.FragmentStateManager in activityCreated at line 3
androidx.fragment.app.FragmentStateManager in moveToExpectedState at line 17
androidx.fragment.app.FragmentManager in executeOpsTogether at line 34
androidx.fragment.app.FragmentManager in removeRedundantOperationsAndExecute at line 10
androidx.fragment.app.FragmentManager in execPendingActions at line 4
androidx.fragment.app.FragmentManager in dispatchStateChange at line 9
androidx.fragment.app.FragmentManager in dispatchActivityCreated at line 4
androidx.fragment.app.FragmentController in dispatchActivityCreated at line 1
androidx.fragment.app.FragmentActivity in onStart at line 6
androidx.appcompat.app.AppCompatActivity in onStart at line 1
android.app.Instrumentation in callActivityOnStart at line 1433
android.app.Activity in performStart at line 7858
android.app.ActivityThread in handleStartActivity at line 3347
android.app.servertransaction.TransactionExecutor in performLifecycleSequence at line 221
android.app.servertransaction.TransactionExecutor in cycleToPath at line 201
android.app.servertransaction.TransactionExecutor in executeLifecycleState at line 173
android.app.servertransaction.TransactionExecutor in execute at line 97
android.app.ActivityThread$H in handleMessage at line 2063
android.os.Handler in dispatchMessage at line 107
android.os.Looper in loop at line 214
android.app.ActivityThread in main at line 7615
java.lang.reflect.Method in invoke
com.android.internal.os.RuntimeInit$MethodAndArgsCaller in run at line 492
com.android.internal.os.ZygoteInit in main at line 964

Payment hangs up on stage "Pulling up your digital wallet..."

Hello,

I have a question related to the PayPal Native Checkout SDK. I've already tried to find a similar problem here, but didn't find any. Originally we asked this question in the PayPal issue tracker, but they directed us here.

Here is the issue's description:

The first payment attempt brings the full sized login window. Enters login/pass there and press "Log in" button. After that, the bottom panel should be shown in front of the app's window. However, it shows under app's window, please check the screenshot paypal1.png; the app's log for this attempt stored in the file paypal_log.txt.
On each next attempt, login window doesn't show, but bottom panel appears on the screen and the payment process is hanged up on a stage "Pulling up your digital wallet..."; please check the screenshot paypal2.png and the log file paypal_log2.txt. However, this process can be aborted by the device's "Back" button - it brings to screen the exit dialog, screenshot paypal3.png.
Restarting the app doesn't help and payment process finishes with the same result - process hangs on the same stage. If app's data/cache will be cleaned - only then payment process will be started with the login window.

The used device is Samsung SM-G900F Android 6.0.1, API 23. PayPal Native Checkout SDK version 5.0.1.

Could you, please, help with the resolving of this issue? Thank you in advance!

paypal_log.txt

paypal_log2.txt

paypal1
paypal2
paypal3

paymentButton - onApprove, onCancel not invoked

After setting up everything on my paypal account, i am able to use the paymentButton to start the payment.

However, after the authorization my app does not come to the foreground. The same happens if i cancel the payment process.

I verified and all the return URIs are correctly configured.

In iOS a don't have any problem, only on Android.

Unable to receive order notification

The payment was successfully initiated through the payment button provided by the SDK. It was found that the balance of the sandbox account was reduced, but the order notification could not be found on the developer platform. In the past, it was possible to pay through com.braintreepayments.api:paypal:4.+ Order notification

Crash when opening the app after using the proxy(problem with version 0.4.5 bug)

AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
kotlin.UninitializedPropertyAccessException: lateinit property abManager has not been initialized
at com.paypal.pyplcheckout.services.callbacks.BaseCallback.retryOnError(BaseCallback.kt:78)
at com.paypal.pyplcheckout.services.callbacks.BaseCallback.onFailure(BaseCallback.kt:40)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:525)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)

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.