Record level on boost payment intent

This commit is contained in:
Ehren Kret
2022-04-29 12:04:42 -05:00
parent 578ea12b59
commit 63be7b93ce
2 changed files with 44 additions and 49 deletions

View File

@@ -154,12 +154,13 @@ public class StripeManager {
/**
* Creates a payment intent. May throw a 400 WebApplicationException if the amount is too small.
*/
public CompletableFuture<PaymentIntent> createPaymentIntent(String currency, long amount) {
public CompletableFuture<PaymentIntent> createPaymentIntent(String currency, long amount, long level) {
return CompletableFuture.supplyAsync(() -> {
PaymentIntentCreateParams params = PaymentIntentCreateParams.builder()
.setAmount(amount)
.setCurrency(currency.toLowerCase(Locale.ROOT))
.setDescription(boostDescription)
.putMetadata("level", Long.toString(level))
.build();
try {
return PaymentIntent.create(params, commonOptions());