#benherosian-capture-java

1 messages · Page 1 of 1 (latest)

neon matrix
#

Can you share your exact code? I think you're using the wrong setter on the Charge itself which is unrelated (and mostly internal, but java/gradle makes this confusing)

tender night
#

Thanks for the response. I'm the site admin but my developers are having issues accessing the Discord. I am now trying to be the intermediary so we can get this resolved. I am just getting my devs to send the code so I can insert.

#

Heres the code:
Charge charge;
try {
charge = Charge.retrieve(payment.getReferenceId());
charge.setAmount(payment.getAmount().longValue()*100);
charge.capture();
} catch (StripeException e) {
LOG.error("Failed to do a capture for the order: " + payment.getOrderShipment().getOrder().getOrderNumber(), e);
throw new PaymentGatewayException(e.getMessage());
}

neon matrix
#

yeah that will never work

#

you're supposed to pass the amount as part of the capture call itself

tender night
#

Do you have a code example you can share?

neon matrix
#

So there are many ways to do this. Can you share some other code you use for charge creation for example? That'll tell me how you use stripe-java today and then I can show you

tender night
#

Not a problem. Will get this to you shortly.

#

Thanks for the help. I gave my Devs access to Stripe so they can access the Discord themselves. They said they understand the issue and are working on a fix. Closing the thread.