Interface Payment
-
- All Superinterfaces:
PrettyPrintable
public interface Payment extends PrettyPrintable
The interface that represents a payment and contains all related data.- Author:
- soknight
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull LocalDateTimegetCreatedAt()Get the creation date of this payment.@NotNull StringgetCustomer()Get the customer of this payment.@NotNull DeliveryModeTypegetDeliveryType()Get the delivery mode used for this payment.@NotNull StringgetDeliveryTypeRaw()Get the raw delivery mode type.@NotNull Optional<String>getEmail()Get the optional-wrapped email of the customer of this payment.doublegetEnrolledAmount()Get the enrolled amount.@NotNull Optional<String>getErrorMessage()Get the optional-wrapped error message for this payment.intgetHandleAttempts()Get the amount of attempts to handle this payment on the server side.intgetId()Get the unique ID of this payment.@NotNull PaymentSystemgetPaymentSystem()Get the used payment system of this payment.@NotNull StringgetPaymentSystemRaw()Get the raw used payment system of this payment.@NotNull PaymentTypegetPaymentType()Get the used payment type of this payment.@NotNull StringgetPaymentTypeRaw()Get the raw used payment type of this payment.@NotNull List<PurchasedProduct>getProducts()Get the list of all purchased products of this payment.doublegetPurchaseCost()Get the purchase cost of this payment.@NotNull OptionalIntgetRating()Get the optional-wrapped rating value.@NotNull Optional<String>getRedirectUrl()Get the optional-wrapped redirect URL for this payment.@NotNull List<SentCommand>getSentCommands()Get the list of all sent commands.@NotNull ServergetServer()Get the target game server describing object.intgetServerId()Get the ID of the connected server related to this payment.doublegetServiceComission()Get the EasyDonate platform comission.intgetShopId()Get the ID of the payment owning shop.@NotNull PaymentStatusgetStatus()Get the current status of this payment.intgetStatusRaw()Get the raw status of this payment.@NotNull LocalDateTimegetUpdatedAt()Get the date of last update of this payment.booleanwasSent()Check is all commands from the payment related purchased products was successfully sent to the connected game server.-
Methods inherited from interface ru.easydonate.easydonate4j.data.model.PrettyPrintable
toPrettyString
-
-
-
-
Method Detail
-
getId
int getId()
Get the unique ID of this payment.- Returns:
- The payment ID.
-
getShopId
int getShopId()
Get the ID of the payment owning shop.- Returns:
- The owning shop ID.
-
getCustomer
@NotNull @NotNull String getCustomer()
Get the customer of this payment.- Returns:
- The payment customer.
-
getEmail
@NotNull @NotNull Optional<String> getEmail()
Get the optional-wrapped email of the customer of this payment.
If an email wasn't actually specified by the customer, this method will return an empty Optional.- Returns:
- The optional-wrapped payment customer's email.
-
getStatus
@NotNull @NotNull PaymentStatus getStatus()
Get the current status of this payment.
For the list of payments from theEasyDonateClient.getPaymentsList()method a status of everyone returned payment will bePaymentStatus.SUCCESS- Returns:
- The payment status.
- See Also:
PaymentStatus
-
getStatusRaw
int getStatusRaw()
Get the raw status of this payment.
Can be used when thegetStatus()method has returned the unknown constant.- Returns:
- The raw payment status.
- See Also:
getStatus()
-
getPurchaseCost
double getPurchaseCost()
Get the purchase cost of this payment.- Returns:
- The payment purchase cost.
-
getEnrolledAmount
double getEnrolledAmount()
Get the enrolled amount.
It's an amount that has been added to yours real shop balance.- Returns:
- The enrolled amount.
-
getServiceComission
double getServiceComission()
Get the EasyDonate platform comission.
It's an amount that has been withdrawn by the EasyDonate aggregator.- Returns:
- The service comission.
-
getPaymentSystem
@NotNull @NotNull PaymentSystem getPaymentSystem()
Get the used payment system of this payment.- Returns:
- The used payment system.
- See Also:
PaymentSystem
-
getPaymentSystemRaw
@NotNull @NotNull String getPaymentSystemRaw()
Get the raw used payment system of this payment.
Can be used when thegetPaymentSystem()method has returned the unknown constant.- Returns:
- The raw used payment system.
- See Also:
getPaymentSystem()
-
getPaymentType
@NotNull @NotNull PaymentType getPaymentType()
Get the used payment type of this payment.- Returns:
- The used payment type.
- See Also:
PaymentType
-
getPaymentTypeRaw
@NotNull @NotNull String getPaymentTypeRaw()
Get the raw used payment type of this payment.
Can be used when thegetPaymentType()method has returned the unknown constant.- Returns:
- The raw used payment type.
- See Also:
getPaymentType()
-
getServerId
int getServerId()
Get the ID of the connected server related to this payment.- Returns:
- The payment server ID.
-
getDeliveryType
@NotNull @NotNull DeliveryModeType getDeliveryType()
Get the delivery mode used for this payment.- Returns:
- The payment delivery mode.
- See Also:
DeliveryModeType
-
getDeliveryTypeRaw
@NotNull @NotNull String getDeliveryTypeRaw()
Get the raw delivery mode type.
Can be used when thegetDeliveryType()method has returned the unknown constant.- Returns:
- The raw payment delivery mode.
- See Also:
getDeliveryType()
-
getRedirectUrl
@NotNull @NotNull Optional<String> getRedirectUrl()
Get the optional-wrapped redirect URL for this payment.
Only will be returned if this payment was generated by the corresponding API method or using theEasyDonateClient.createPayment()method.- Returns:
- The optional-wrapped payment redirect URL.
- See Also:
EasyDonateClient.createPayment(),PendingPaymentBuilder.setRedirectUrl(String)
-
getErrorMessage
@NotNull @NotNull Optional<String> getErrorMessage()
Get the optional-wrapped error message for this payment.
If any error was occurred then this error message stored here.- Returns:
- The optional-wrapped payment error message.
-
getHandleAttempts
int getHandleAttempts()
Get the amount of attempts to handle this payment on the server side.
If this shop uses the plugin delivery mode then this counter means an amount of attempts to run all commands of purchased products.- Returns:
- The amount of attempts to handle this payment.
- See Also:
DeliveryModeType.PLUGIN
-
wasSent
boolean wasSent()
Check is all commands from the payment related purchased products was successfully sent to the connected game server.- Returns:
- A boolean value: the check result.
-
getRating
@NotNull @NotNull OptionalInt getRating()
Get the optional-wrapped rating value.
When a customer returns to the shop after the payment completion, this customer can rate the payment process upon his user experience.- Returns:
- The payment process rating from a customer.
-
getSentCommands
@NotNull @NotNull List<SentCommand> getSentCommands()
Get the list of all sent commands.- Returns:
- The list of all sent commands.
- See Also:
SentCommand,PurchasedProduct.getCommands()
-
getProducts
@NotNull @NotNull List<PurchasedProduct> getProducts()
Get the list of all purchased products of this payment.- Returns:
- The list of all purchased products.
- See Also:
PurchasedProduct
-
getServer
@NotNull @NotNull Server getServer()
Get the target game server describing object.- Returns:
- The target game server.
- See Also:
Server
-
getCreatedAt
@NotNull @NotNull LocalDateTime getCreatedAt()
Get the creation date of this payment.- Returns:
- The payment creation date.
-
getUpdatedAt
@NotNull @NotNull LocalDateTime getUpdatedAt()
Get the date of last update of this payment.- Returns:
- The last payment update date.
-
-