Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2202
v2203
266 changes: 266 additions & 0 deletions src/main/java/com/stripe/model/PaymentIntent.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.stripe.param.PaymentIntentReauthorizeParams;
import com.stripe.param.PaymentIntentRetrieveParams;
import com.stripe.param.PaymentIntentSearchParams;
import com.stripe.param.PaymentIntentSimulateCryptoDepositParams;
import com.stripe.param.PaymentIntentTriggerActionParams;
import com.stripe.param.PaymentIntentUpdateParams;
import com.stripe.param.PaymentIntentVerifyMicrodepositsParams;
Expand Down Expand Up @@ -2113,6 +2114,9 @@ public static class NextAction extends StripeObject {
@SerializedName("cashapp_handle_redirect_or_display_qr_code")
CashappHandleRedirectOrDisplayQrCode cashappHandleRedirectOrDisplayQrCode;

@SerializedName("crypto_display_details")
CryptoDisplayDetails cryptoDisplayDetails;

@SerializedName("display_bank_transfer_instructions")
DisplayBankTransferInstructions displayBankTransferInstructions;

Expand Down Expand Up @@ -2298,6 +2302,162 @@ public static class QrCode extends StripeObject {
}
}

/**
* For more details about CryptoDisplayDetails, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class CryptoDisplayDetails extends StripeObject {
@SerializedName("deposit_addresses")
DepositAddresses depositAddresses;

/**
* For more details about DepositAddresses, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class DepositAddresses extends StripeObject {
@SerializedName("base")
Base base;

@SerializedName("solana")
Solana solana;

@SerializedName("tempo")
Tempo tempo;

/**
* For more details about Base, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Base extends StripeObject {
/** Address of the deposit address. */
@SerializedName("address")
String address;

/** The token currencies supported on this network. */
@SerializedName("supported_tokens")
List<PaymentIntent.NextAction.CryptoDisplayDetails.DepositAddresses.Base.SupportedToken>
supportedTokens;

/**
* For more details about SupportedToken, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SupportedToken extends StripeObject {
/**
* The on-chain contract address for the supported token currency on this specific
* network.
*/
@SerializedName("token_contract_address")
String tokenContractAddress;

/**
* The supported token currency. Supported token currencies include: {@code usdc}.
*
* <p>Equal to {@code usdc}.
*/
@SerializedName("token_currency")
String tokenCurrency;
}
}

/**
* For more details about Solana, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Solana extends StripeObject {
/** Address of the deposit address. */
@SerializedName("address")
String address;

/** The token currencies supported on this network. */
@SerializedName("supported_tokens")
List<PaymentIntent.NextAction.CryptoDisplayDetails.DepositAddresses.Solana.SupportedToken>
supportedTokens;

/**
* For more details about SupportedToken, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SupportedToken extends StripeObject {
/**
* The on-chain contract address for the supported token currency on this specific
* network.
*/
@SerializedName("token_contract_address")
String tokenContractAddress;

/**
* The supported token currency. Supported token currencies include: {@code usdc}.
*
* <p>Equal to {@code usdc}.
*/
@SerializedName("token_currency")
String tokenCurrency;
}
}

/**
* For more details about Tempo, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Tempo extends StripeObject {
/** Address of the deposit address. */
@SerializedName("address")
String address;

/** The token currencies supported on this network. */
@SerializedName("supported_tokens")
List<PaymentIntent.NextAction.CryptoDisplayDetails.DepositAddresses.Tempo.SupportedToken>
supportedTokens;

/**
* For more details about SupportedToken, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class SupportedToken extends StripeObject {
/**
* The on-chain contract address for the supported token currency on this specific
* network.
*/
@SerializedName("token_contract_address")
String tokenContractAddress;

/**
* The supported token currency. Supported token currencies include: {@code usdc}.
*
* <p>Equal to {@code usdc}.
*/
@SerializedName("token_currency")
String tokenCurrency;
}
}
}
}

/**
* For more details about DisplayBankTransferInstructions, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
Expand Down Expand Up @@ -5718,6 +5878,17 @@ public static class Cashapp extends StripeObject {
@Setter
@EqualsAndHashCode(callSuper = false)
public static class Crypto extends StripeObject {
@SerializedName("deposit_options")
DepositOptions depositOptions;

/**
* The mode of the crypto payment.
*
* <p>One of {@code default}, or {@code deposit}.
*/
@SerializedName("mode")
String mode;

/**
* Indicates that you intend to make future payments with this PaymentIntent's payment method.
*
Expand All @@ -5741,6 +5912,23 @@ public static class Crypto extends StripeObject {
*/
@SerializedName("setup_future_usage")
String setupFutureUsage;

/**
* For more details about DepositOptions, please refer to the <a
* href="https://docs.stripe.com/api">API Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class DepositOptions extends StripeObject {
/**
* The blockchain networks to support for deposits. Learn more about <a
* href="https://docs.stripe.com/payments/deposit-mode-stablecoin-payments#token-and-network-support">supported
* networks and tokens</a>.
*/
@SerializedName("networks")
List<String> networks;
}
}

/**
Expand Down Expand Up @@ -7771,6 +7959,84 @@ public void setDestinationObject(Account expandableObject) {
}
}

public TestHelpers getTestHelpers() {
return new TestHelpers(this);
}

public static class TestHelpers {
private final PaymentIntent resource;

private TestHelpers(PaymentIntent resource) {
this.resource = resource;
}

/**
* Simulate an incoming crypto deposit for a testmode PaymentIntent with {@code
* payment_method_options[crypto][mode]=deposit}. The {@code transaction_hash} parameter
* determines whether the simulated deposit succeeds or fails. Learn more about <a
* href="https://stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration">testing
* your integration</a>.
*/
public PaymentIntent simulateCryptoDeposit(Map<String, Object> params) throws StripeException {
return simulateCryptoDeposit(params, (RequestOptions) null);
}

/**
* Simulate an incoming crypto deposit for a testmode PaymentIntent with {@code
* payment_method_options[crypto][mode]=deposit}. The {@code transaction_hash} parameter
* determines whether the simulated deposit succeeds or fails. Learn more about <a
* href="https://stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration">testing
* your integration</a>.
*/
public PaymentIntent simulateCryptoDeposit(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/payment_intents/%s/simulate_crypto_deposit",
ApiResource.urlEncodeId(this.resource.getId()));
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options);
return resource.getResponseGetter().request(request, PaymentIntent.class);
}

/**
* Simulate an incoming crypto deposit for a testmode PaymentIntent with {@code
* payment_method_options[crypto][mode]=deposit}. The {@code transaction_hash} parameter
* determines whether the simulated deposit succeeds or fails. Learn more about <a
* href="https://stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration">testing
* your integration</a>.
*/
public PaymentIntent simulateCryptoDeposit(PaymentIntentSimulateCryptoDepositParams params)
throws StripeException {
return simulateCryptoDeposit(params, (RequestOptions) null);
}

/**
* Simulate an incoming crypto deposit for a testmode PaymentIntent with {@code
* payment_method_options[crypto][mode]=deposit}. The {@code transaction_hash} parameter
* determines whether the simulated deposit succeeds or fails. Learn more about <a
* href="https://stripe.com/docs/payments/deposit-mode-stablecoin-payments#test-your-integration">testing
* your integration</a>.
*/
public PaymentIntent simulateCryptoDeposit(
PaymentIntentSimulateCryptoDepositParams params, RequestOptions options)
throws StripeException {
String path =
String.format(
"/v1/test_helpers/payment_intents/%s/simulate_crypto_deposit",
ApiResource.urlEncodeId(this.resource.getId()));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.POST,
path,
ApiRequestParams.paramsToMap(params),
options);
return resource.getResponseGetter().request(request, PaymentIntent.class);
}
}

@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
Expand Down
Loading
Loading