#lamikam

1 messages · Page 1 of 1 (latest)

silk sealBOT
foggy sable
#

PaymentIntentCreateParams createParams = new PaymentIntentCreateParams.Builder()
.setCustomer(stripeEntities[0])
.addPaymentMethodType(type)
.setCurrency("usd")
.setAmount( Math.round(Double.parseDouble(amount) * 100)) // amounts always in cents
.setPaymentMethod(stripeEntities[1])
.setConfirm(true) // indicates to authorized right now
.setOffSession(true) // indicates to authorize right now
.putMetadata("reference", reference) // this metdata will contain the account number
.putMetadata("direct", "true") // need this later in webhook processing to ignore the charge from webhook
.build();

         PaymentIntent paymentIntent = PaymentIntent.create(createParams);
         PaymentIntent details = PaymentIntent.retrieve(paymentIntent.getId());
#

this is returning null - Charge charge = details.getLatestChargeObject();

#

this is for a us_bank_account payment method

granite galleon
#

Hello! Can you give me the ID of the Payment Intent so I can take a look?

foggy sable
#

sure once second...

#

need a minute

#

<com.stripe.model.PaymentIntent@761095866 id=pi_3Nv2QvDyHdg3Nb8m1fYakagC> JSON: {
"amount": 1098,
"amount_capturable": 0,
"amount_details": {
"tip": {
"amount": null
}
},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"client_secret": "pi_3Nv2QvDyHdg3Nb8m1fYakagC_secret_G6g4p7MYycHffqOhSb35M5jmO",
"

granite galleon
#

I'm wondering if the Charge hasn't quite been created yet. You're creating the Payment Intent and then immediately trying to read it and get the Charge back. If you introduce a slight delay between creation and reading it back does the Charge show up?

foggy sable
#

I will try that. This was working fine for months

granite galleon
#

That Payment Intent does have a latest_charge now, and there are no requests that modified it after it was created...

#

That's strange.

foggy sable
#

mayve a java library issue?

granite galleon
#

I mean, the fact that it's populated isn't strange, what's strange is that you're running into this issue.

#

Perhaps. Did you upgrade recently?

foggy sable
#

upgraded to lib version 22 and it said to use getLatestChargeObject();

granite galleon
#

Where did it say that?

foggy sable
#

2022-11-15
Charge no longer auto-expands refunds by default. You can expand the list but for performance reasons we recommended against doing so unless needed.
The charges property on PaymentIntent has been removed. You can use the latest_charge property instead.

granite galleon
#

And getLatestChargeObject is correct...

foggy sable
#

corrrect

#

anything else I can try?

#

upgrade to a later library?

granite galleon
#

Our of curiosity, why are you creating the Payment Intent and then immediately fetching it rather than using the result of the creation request?

foggy sable
#

my ignorance probably

#

isn't that what this does? PaymentIntent details = PaymentIntent.retrieve(paymentIntent.getId());

granite galleon
#

After this line: PaymentIntent paymentIntent = PaymentIntent.create(createParams); can you try Charge charge = paymentIntent.getLatestChargeObject(); and see if that works?

#

And then comment out PaymentIntent details = PaymentIntent.retrieve(paymentIntent.getId());.

foggy sable
#

need a minute

#

that returns null also

granite galleon
#

Huh.

#

What version of the Java library are you running specifically?

silk sealBOT
foggy sable
#

22.0.0

granite galleon
#

Can you try 22.30.0 and see if it has the same behavior?

foggy sable
#

ok. that will take me a while. is there a way we can re-connect?

granite galleon
#

You can return and ask in #dev-help whenever we're open, which is most of the time. 🙂

foggy sable
#

thanks!

#

running now

#

nope not running. my bad