#dhara-android

1 messages · Page 1 of 1 (latest)

robust totem
sonic spade
#

when i am trying to confirm payment

#

for testing purpose

robust totem
#

can you share the information I asked for? I'm afraid we need specific details like that.

sonic spade
#

ConfirmPaymentIntentParams confirmParams = ConfirmPaymentIntentParams
.createWithPaymentMethodCreateParams(params3, paymentIntentClientSecret);
stripe.confirmPayment(this, confirmParams);

#

List<Object> paymentMethodTypes =
new ArrayList<>();
paymentMethodTypes.add("card");
Map<String, Object> params = new HashMap<>();
params.put("amount", 2000);
params.put("currency", "gbp");
params.put("stripe_token_id",stripe_token);
params.put("description","dhara rabadiya");
params.put("type","text");
params.put("enabled",true);
params.put("email","hello@yopmail.com");
params.put(
"payment_method_types",
paymentMethodTypes
);
Log.e("sdhcbsc"," "+params);

    RequestBody body = RequestBody.create(params.toString(), mediaType);
    Request request = new Request.Builder()
            .url(BACKEND_URL + "create-payment-intent")
            .post(body)
            .build();
    httpClient.newCall(request)
            .enqueue(new PayCallback(this));

    // Hook up the pay button to the card widget and stripe instance
    Button payButton = findViewById(R.id.checkout);
    payButton.setOnClickListener((View view) -> {
        PaymentMethodCreateParams params3 = AddPayment.cardMultilineWidget.getPaymentMethodCreateParams();

        if (params3 != null) {
            ConfirmPaymentIntentParams confirmParams = ConfirmPaymentIntentParams
                    .createWithPaymentMethodCreateParams(params3, paymentIntentClientSecret);
            stripe.confirmPayment(this, confirmParams);
        }
    });
}
#

this is full code

robust totem
sonic spade
#

no

robust totem
#

can you get one please?

sonic spade
#

ok

robust totem
sonic spade
#

req_8E8VyQ5flw5HPu

robust totem
#

ok, so this is from your backend code, your PHP server(which you did not share the code for).

#

the easy fix is to find that code and simply remove the line 'save_payment_method' => true (and replace it with setup_future_usage => "off_session", if overall you want Stripe to save the card used in the payment).

sonic spade
#

so this is the error from backend?

robust totem
#

yes

#

I assume you followed some old guide or something, save_payment_method is an old and deprecated parameter, you should just get rid of it.

sonic spade
#

can you please send me latect doc link

#

because backend developer is said
that is working

#

i need to found if there is any error from my code then how can i found?

robust totem
sonic spade
#

they dont agree with to remove this line

#

they told me that it is working they alreay tested

robust totem
#

ok! well then you will keep having this error until you change it.

sonic spade
#

but i cant found some of the methods like

#

Customer.create

#

for android stripe version 19.1.1

robust totem
#

yes, those are backend functions.

#

they're not something you call in your frontend(the Android app), so that's quite normal.

sonic spade
#

ok

#

how can i found client_secret in android

#

because i cant found code for android

#

for this thing

robust totem
#

the client_secret is something your backend creates and send to your app.

#

you don't have one currently because your backend is failing to create the PaymentIntent, because it needs to make the change I told you to make.

sonic spade
#

any other option without any changes in backend side?