Class YooKassaServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.yookassa.YooKassaServiceImpl
-
- All Implemented Interfaces:
YooKassaService
@Service public class YooKassaServiceImpl extends java.lang.Object implements YooKassaService
-
-
Field Summary
Fields Modifier and Type Field Description private ru.loolzaaa.youkassa.client.ApiClientclientprivate CommercePropertiescommerceProperties
-
Constructor Summary
Constructors Constructor Description YooKassaServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentStatuscancelPayment(java.lang.String paymentId)Cancels the specified payment.PaymentStatuschargePayment(java.lang.String paymentId)Charges the specified payment.ru.loolzaaa.youkassa.model.PaymentcreatePayment(OrderDTO order)Creates a payment for the specified order.voidinit()booleanisYooKassaKeysDefined()Checks if the YooKassa keys are defined.ru.loolzaaa.youkassa.model.PayoutpayoutToVendor(Seller vendor, java.lang.String orderId, long amount)Payouts the specified amount to the vendor.PaymentStatusrefundPayment(OrderDTO order)Refunds the payment for the specified order.
-
-
-
Field Detail
-
commerceProperties
@Autowired private CommerceProperties commerceProperties
-
client
private ru.loolzaaa.youkassa.client.ApiClient client
-
-
Method Detail
-
init
@PostConstruct public void init()
-
isYooKassaKeysDefined
public boolean isYooKassaKeysDefined()
Description copied from interface:YooKassaServiceChecks if the YooKassa keys are defined.- Specified by:
isYooKassaKeysDefinedin interfaceYooKassaService- Returns:
- true if the YooKassa keys are defined, false otherwise.
-
createPayment
public ru.loolzaaa.youkassa.model.Payment createPayment(OrderDTO order)
Description copied from interface:YooKassaServiceCreates a payment for the specified order.- Specified by:
createPaymentin interfaceYooKassaService- Parameters:
order- the order for which the payment is created.- Returns:
- the created payment.
-
chargePayment
public PaymentStatus chargePayment(java.lang.String paymentId)
Description copied from interface:YooKassaServiceCharges the specified payment.- Specified by:
chargePaymentin interfaceYooKassaService- Parameters:
paymentId- the ID of the payment to be charged.- Returns:
- the status of the payment after charging.
-
cancelPayment
public PaymentStatus cancelPayment(java.lang.String paymentId)
Description copied from interface:YooKassaServiceCancels the specified payment.- Specified by:
cancelPaymentin interfaceYooKassaService- Parameters:
paymentId- the ID of the payment to be canceled.- Returns:
- the status of the payment after cancellation.
-
refundPayment
public PaymentStatus refundPayment(OrderDTO order)
Description copied from interface:YooKassaServiceRefunds the payment for the specified order.- Specified by:
refundPaymentin interfaceYooKassaService- Parameters:
order- the order for which the payment is refunded.- Returns:
- the status of the payment after refunding.
-
payoutToVendor
public ru.loolzaaa.youkassa.model.Payout payoutToVendor(Seller vendor, java.lang.String orderId, long amount)
Description copied from interface:YooKassaServicePayouts the specified amount to the vendor.- Specified by:
payoutToVendorin interfaceYooKassaService- Parameters:
vendor- the vendor to whom the payout is made.orderId- the ID of the order for which the payout is made.amount- the amount to be paid out.- Returns:
- the status of the payout.
-
-