#benherosian-capture-java
1 messages · Page 1 of 1 (latest)
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)
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());
}
yeah that will never work
you're supposed to pass the amount as part of the capture call itself
Do you have a code example you can share?
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