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.ApiClient
client
private CommerceProperties
commerceProperties
-
Constructor Summary
Constructors Constructor Description YooKassaServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaymentStatus
cancelPayment(java.lang.String paymentId)
Cancels the specified payment.PaymentStatus
chargePayment(java.lang.String paymentId)
Charges the specified payment.ru.loolzaaa.youkassa.model.Payment
createPayment(OrderDTO order)
Creates a payment for the specified order.void
init()
boolean
isYooKassaKeysDefined()
Checks if the YooKassa keys are defined.ru.loolzaaa.youkassa.model.Payout
payoutToVendor(Seller vendor, java.lang.String orderId, long amount)
Payouts the specified amount to the vendor.PaymentStatus
refundPayment(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:YooKassaService
Checks if the YooKassa keys are defined.- Specified by:
isYooKassaKeysDefined
in 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:YooKassaService
Creates a payment for the specified order.- Specified by:
createPayment
in 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:YooKassaService
Charges the specified payment.- Specified by:
chargePayment
in 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:YooKassaService
Cancels the specified payment.- Specified by:
cancelPayment
in 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:YooKassaService
Refunds the payment for the specified order.- Specified by:
refundPayment
in 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:YooKassaService
Payouts the specified amount to the vendor.- Specified by:
payoutToVendor
in 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.
-
-