Interface StripeService
-
- All Known Implementing Classes:
StripeServiceImpl
public interface StripeService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Order.TaxcalculateTax(Seller buyer, Seller seller, java.util.Map<java.lang.String,com.stripe.model.TaxRate> taxRates)Calculates the tax for an order based on the buyer, seller, and tax rates.java.util.Map<java.lang.String,java.lang.Object>calculateTaxRate(java.lang.String amount, java.lang.String countryIsoCode)This method returns data as object.com.stripe.model.PaymentIntentcancelIntent(java.lang.String paymentIntentId)This method cancel created payment intent in Stripejava.lang.StringcancelSubscriptionAfterActivePeriod(java.lang.String sellerId)This method cancels a stripe subscription after expired stripe contract period.java.lang.StringcancelSubscriptionImmediately(java.lang.String sellerId)This method cancels a stripe subscription immediately.booleanchangePaymentMethod(java.lang.String paymentIntentId, java.lang.String paymentMethodId)Changes the payment method for the given payment intent.java.lang.StringchargeCreditCard(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap)This method creates a charge for payment.PaymentStatuschargeIntent(java.lang.String paymentIntentId)Charges payment intent.java.lang.StringchargeSepa(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap)This method creates a stripe charge entity.voidchargeTariffCreditCard(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap)This method creates a charge tariff for payment.voidchargeTariffSepa(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap)This method creates a stripe charge tariff.java.lang.StringcreateIntent(java.lang.String orderId, java.lang.String stripeConnectId, java.lang.String paymentMethodId, java.math.BigDecimal nettoAmount, Order.Tax tax)Creates payment intent for current seller by payment method and amount.java.util.Map<java.lang.String,java.lang.Object>createPaymentMethod(java.util.LinkedHashMap<java.lang.String,java.lang.Object> paymentMethod)Creates payment method and - if needed - customer for Stripe.java.util.Map<java.lang.String,java.lang.String>getAmountByTariff(java.lang.String tariff)This method returns data as map.java.util.Map<java.lang.String,java.lang.Object>getContractEndDate(java.lang.String createdDate, java.lang.String pattern)This method does return time.java.util.Map<java.lang.String,java.lang.Object>getContractEndDateFromTimestamp(java.lang.String created, java.lang.String pattern)This method does return time.java.lang.StringgetCurrency()This method returns currency namejava.util.List<com.stripe.model.Invoice>getInvoices()This method returns data as list.java.util.Map<java.lang.String,java.lang.Object>getPaymentMethod(java.lang.String paymentMethodId)This method returns data as map.java.util.List<com.stripe.model.PaymentMethod>getPaymentMethods(java.lang.String type)This method returns data as list.java.util.List<com.stripe.model.Product>getProducts()This method returns data as list.java.util.Map<java.lang.String,java.lang.Object>getSubscription()This method returns data as object.booleanisStripeKeysDefined()This method does return boolean result.booleanisTariffEquals(java.lang.String tariff)This method does return boolean result.java.lang.Stringobtain3DSecureLink(java.lang.String paymentIntentId)Obtains link for payment intent authorization.java.util.Map<java.lang.String,com.stripe.model.TaxRate>obtainAllTaxRates()Obtains all tax rates from Stripe api.com.stripe.model.PayoutpayoutToVendor(Seller vendor, java.lang.String orderId, long amount)Moves funds from stripe account to bank/card.voidremovePaymentMethod(java.lang.String paymentMethodId)This method returns data as object.
-
-
-
Method Detail
-
isStripeKeysDefined
boolean isStripeKeysDefined()
This method does return boolean result.- Returns:
- value as boolean
-
getCurrency
java.lang.String getCurrency()
This method returns currency name- Returns:
- value as string
-
createIntent
java.lang.String createIntent(java.lang.String orderId, java.lang.String stripeConnectId, java.lang.String paymentMethodId, java.math.BigDecimal nettoAmount, Order.Tax tax)Creates payment intent for current seller by payment method and amount.- Parameters:
orderId- id of the order for metadatastripeConnectId- id of the stripe connect account for vendorpaymentMethodId- payment method ID.nettoAmount- net amount in the smallest currency unit, e.g. for 100$ expected value would be 10000 (that means to be cents).tax- tax object- Returns:
- created intent ID
-
cancelIntent
com.stripe.model.PaymentIntent cancelIntent(java.lang.String paymentIntentId)
This method cancel created payment intent in Stripe- Parameters:
paymentIntentId- identification from payment intent in Stripe- Returns:
- stripe payment intent entity
-
changePaymentMethod
boolean changePaymentMethod(java.lang.String paymentIntentId, java.lang.String paymentMethodId)Changes the payment method for the given payment intent.- Parameters:
paymentIntentId- id of intentpaymentMethodId- id of a new using in the intent payment method- Returns:
- true if successful
-
chargeIntent
PaymentStatus chargeIntent(java.lang.String paymentIntentId)
Charges payment intent.- Parameters:
paymentIntentId- id- Returns:
PaymentStatusof the payment
-
obtain3DSecureLink
java.lang.String obtain3DSecureLink(java.lang.String paymentIntentId)
Obtains link for payment intent authorization.- Parameters:
paymentIntentId- intent id- Returns:
- link
-
payoutToVendor
com.stripe.model.Payout payoutToVendor(Seller vendor, java.lang.String orderId, long amount) throws com.stripe.exception.StripeException
Moves funds from stripe account to bank/card.- Parameters:
vendor- selleramount- amountorderId- identification of order- Returns:
- stripe payout
- Throws:
com.stripe.exception.StripeException- in create token and customer
-
chargeSepa
java.lang.String chargeSepa(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap) throws com.stripe.exception.StripeExceptionThis method creates a stripe charge entity.- Parameters:
chargeRequestAsMap- map-representation of database entity- Returns:
- optional value to externally interaction
- Throws:
com.stripe.exception.StripeException- in create charge
-
chargeCreditCard
java.lang.String chargeCreditCard(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap) throws com.stripe.exception.StripeExceptionThis method creates a charge for payment.- Parameters:
chargeRequestAsMap- map-representation of charge request- Returns:
- value as text
- Throws:
com.stripe.exception.StripeException- in create token and customer
-
chargeTariffSepa
void chargeTariffSepa(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap) throws com.stripe.exception.StripeExceptionThis method creates a stripe charge tariff.- Parameters:
chargeRequestAsMap- map-representation of database entity- Throws:
com.stripe.exception.StripeException- in create charge tariff
-
chargeTariffCreditCard
void chargeTariffCreditCard(java.util.LinkedHashMap<java.lang.String,java.lang.Object> chargeRequestAsMap) throws com.stripe.exception.StripeExceptionThis method creates a charge tariff for payment.- Parameters:
chargeRequestAsMap- map-representation of charge request- Throws:
com.stripe.exception.StripeException- in create token, customer and update subscription
-
getAmountByTariff
java.util.Map<java.lang.String,java.lang.String> getAmountByTariff(java.lang.String tariff)
This method returns data as map.- Parameters:
tariff- field for filter and return data- Returns:
- data as map
-
getInvoices
java.util.List<com.stripe.model.Invoice> getInvoices()
This method returns data as list.- Returns:
- data as list
-
getProducts
java.util.List<com.stripe.model.Product> getProducts()
This method returns data as list.- Returns:
- data as list
-
createPaymentMethod
java.util.Map<java.lang.String,java.lang.Object> createPaymentMethod(java.util.LinkedHashMap<java.lang.String,java.lang.Object> paymentMethod)
Creates payment method and - if needed - customer for Stripe.- Parameters:
paymentMethod- data- Returns:
- map as object
-
removePaymentMethod
void removePaymentMethod(java.lang.String paymentMethodId)
This method returns data as object.- Parameters:
paymentMethodId- field for filter and return data
-
getPaymentMethods
java.util.List<com.stripe.model.PaymentMethod> getPaymentMethods(java.lang.String type)
This method returns data as list.- Parameters:
type- field for filter and return data- Returns:
- data as list
-
getPaymentMethod
java.util.Map<java.lang.String,java.lang.Object> getPaymentMethod(java.lang.String paymentMethodId)
This method returns data as map.- Parameters:
paymentMethodId- field for filter and return data- Returns:
- data as map
-
getSubscription
java.util.Map<java.lang.String,java.lang.Object> getSubscription()
This method returns data as object.- Returns:
- map as object
-
calculateTaxRate
java.util.Map<java.lang.String,java.lang.Object> calculateTaxRate(java.lang.String amount, java.lang.String countryIsoCode)This method returns data as object.- Parameters:
amount- from this amount will be calculated a tax valuecountryIsoCode- field for filter and return data- Returns:
- map as object
-
obtainAllTaxRates
java.util.Map<java.lang.String,com.stripe.model.TaxRate> obtainAllTaxRates()
Obtains all tax rates from Stripe api.- Returns:
- map of country iso codes to tax rate
-
cancelSubscriptionAfterActivePeriod
java.lang.String cancelSubscriptionAfterActivePeriod(java.lang.String sellerId)
This method cancels a stripe subscription after expired stripe contract period.- Parameters:
sellerId- identification bean which will be find database entity- Returns:
- value as text
-
cancelSubscriptionImmediately
java.lang.String cancelSubscriptionImmediately(java.lang.String sellerId)
This method cancels a stripe subscription immediately.- Parameters:
sellerId- identification bean which will be find database entity- Returns:
- value as text
-
getContractEndDate
java.util.Map<java.lang.String,java.lang.Object> getContractEndDate(java.lang.String createdDate, java.lang.String pattern)This method does return time.- Parameters:
createdDate- from which can extracted timepattern- pattern for formatting a date- Returns:
- data as map
-
getContractEndDateFromTimestamp
java.util.Map<java.lang.String,java.lang.Object> getContractEndDateFromTimestamp(java.lang.String created, java.lang.String pattern)This method does return time.- Parameters:
created- from which can extracted timepattern- pattern for formatting a date- Returns:
- data as map
-
isTariffEquals
boolean isTariffEquals(java.lang.String tariff)
This method does return boolean result.- Parameters:
tariff- value to check- Returns:
- value as boolean
-
calculateTax
Order.Tax calculateTax(Seller buyer, Seller seller, java.util.Map<java.lang.String,com.stripe.model.TaxRate> taxRates)
Calculates the tax for an order based on the buyer, seller, and tax rates.- Parameters:
buyer- the user who is buying the orderseller- the user who is selling the ordertaxRates- a map containing the tax rates for different products- Returns:
- the tax amount for the order
-
-