braintree / braintree_android

Braintree SDK for Android
https://developer.paypal.com/braintree/docs/start/hello-client/android/v4
MIT License
405 stars 232 forks source link

Amount not showing on transaction screen #329

Closed Slake07 closed 2 years ago

Slake07 commented 3 years ago

General information

Issue description

I can't see the amount of my product at the time of the transaction screen. device-2021-02-16-154737

crookedneighbor commented 3 years ago

Can you share your client side code for initializing PayPal? I suspect you're using the vault flow instead of the checkout flow, which wouldn't show an amount in the confirmation screen.

Slake07 commented 3 years ago

@crookedneighbor I am using following way:

SDK Version: implementation 'com.braintreepayments.api:braintree:3.16.0'

try {
            mBraintreeFragment = BraintreeFragment.newInstance(this, "sandbox_*****************");
            mBraintreeFragment.addListener(this);
        }catch (InvalidArgumentException e){}

private void makePaymentFromBraintree(){
        PayPal.requestOneTimePayment(mBraintreeFragment, getPaypalRequest());
    }

    private PayPalRequest getPaypalRequest(){
        String subtotal = String.valueOf(subTotalFromService);
        String tax = Utilities.getRoundedTwoDigitValue(vat);
        String total = Utilities.getRoundedTwoDigitValue(new BigDecimal("0").add(new BigDecimal(subtotal).add(new BigDecimal(tax))).floatValue());

        PayPalRequest request = new PayPalRequest(total);
        request.currencyCode(Constants.EURO_CURRENCY);
        request.displayName(Constants.PAYPAL_ORDER_NAME);
        request.intent(PayPalRequest.INTENT_AUTHORIZE);

        return request;
    }

As per my understanding, This is checkout flow only. Still Let me know what I miss here and help me with this issue.

sarahkoop commented 2 years ago

Hi @Slake07 - You should see the amount if you set the userAction on the request to USER_ACTION_COMMIT. Closing this - but please re-open if you continue to experience the issue.