#Chocacao-payment-method

1 messages ยท Page 1 of 1 (latest)

knotty berry
alpine remnant
#

This is a big issue because I don't know then how to set the payement method for my PaymentIntent

knotty berry
#

Hi there ๐Ÿ‘‹ could you help me understand what you're trying to do?

alpine remnant
#

I'm trying to create the payement intent server side

#

for that I am using

#

`PaymentMethodListParams listParams = new PaymentMethodListParams.Builder().setCustomer(customer.getId())
.setType(PaymentMethodListParams.Type.CARD).build();
PaymentMethodCollection paymentMethods = PaymentMethod.list(listParams);

    PaymentIntentCreateParams paymentIntentParams =
            PaymentIntentCreateParams.builder()
                    .setAmount((long) ticketDAO.getTicketById(id).getPrice())
                    .setCurrency("eur")
                    .setCustomer(customer.getId())
                    .setPaymentMethod(paymentMethods.getData().get(0).getId())
                    .build();
    PaymentIntent paymentIntent = PaymentIntent.create(paymentIntentParams);`
#

but the problem is that paymentMethods.getData() is empty, however in the stripe logs I can clearly see a success on creating a payement method

knotty berry
#

Do you happen to have the request ID for the PaymentMethod.list function?

alpine remnant
#

req_3eMpgPGsxk5c4Z

knotty berry
#

Thanks, taking a look

alpine remnant
#

thank you

knotty berry
#

I'm struggling to find a request for your account that created a payment method, would you happen to have the request ID for that as well?

alpine remnant
#

I'm sorry isn't that what you are asking for ?

#

Ok I managed to create the paiement intent and set the paiement method through another function

#

thank you for your help

#

I'm ok server side, now I'm going to bother you with client side ... May I ?

knotty berry
#

Of course ๐Ÿ˜„

#

It's not a bother at all

alpine remnant
#

So here is the big issue, I am working on Android Studio. Added implementation 'com.stripe:stripe-android:18.1.0' in the gradle dependencies.
BUT private PaymentSheet paymentSheet; creates the error Cannot resolve symbol 'PaymentSheet'. This means it cannot be found in the sdk, and even with import com.stripe.android.paymentsheet.*; the import is never used.

#

I synced with gradle files, reloaded the project and everything but still nothing

#

I have PaymentOptionsViewModel_Factory or even some things like PaymentSheetLauncherModule_Companion_ProvideProductUsageTokensFactory, but the one PaymentSheet is like a ghost !

knotty berry
#

Thanks for the info, please bear with me while I consult with my colleagues.

alpine remnant
#

Take your time, I will porovide any ressource you ask of me.

knotty berry
#

Apologies for the delay.

Could you confirm the location of your gradle file?

alpine remnant
#

OK the file is here, whenever I go there it says : // This class file was compiled with different version of Kotlin compiler and can't be decompiled. // // Current compiler ABI version is 1.1.16 // File ABI version is 1.5.1
So I guess I have to update my Kotlin Compiler

#

And now it works

knotty berry
#

Wooh! Not sure what fixed it, but I'm excited all the same.

alpine remnant
#

Well your file was compiled in a version way too new for my compiler to understand. That's pretty much it ! thanks for all your help !