2024-07-15 13:42:18 +08:00
|
|
|
package com.ai.da.service;
|
|
|
|
|
|
2024-12-16 10:26:02 +08:00
|
|
|
import com.ai.da.mapper.primary.entity.SubscriptionInfo;
|
2024-11-18 16:20:25 +08:00
|
|
|
import com.ai.da.model.dto.ProductPurchaseDTO;
|
|
|
|
|
import com.stripe.exception.StripeException;
|
|
|
|
|
|
2024-07-15 13:42:18 +08:00
|
|
|
import javax.servlet.http.HttpServletRequest;
|
2024-11-18 16:20:25 +08:00
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
2024-07-15 13:42:18 +08:00
|
|
|
|
|
|
|
|
public interface StripeService {
|
|
|
|
|
|
2024-11-18 16:20:25 +08:00
|
|
|
String pay(ProductPurchaseDTO productPurchaseDTO);
|
2024-07-15 13:42:18 +08:00
|
|
|
|
|
|
|
|
Boolean notify(HttpServletRequest request);
|
2024-07-16 16:59:58 +08:00
|
|
|
|
2024-12-16 10:26:02 +08:00
|
|
|
SubscriptionInfo getLatestSubscriptionInfoByAccountId(Long accountId);
|
|
|
|
|
|
2024-07-16 16:59:58 +08:00
|
|
|
String refund(String amount, String orderId, String reason);
|
|
|
|
|
|
|
|
|
|
void checkOrderStatus(String orderNo);
|
2024-11-18 16:20:25 +08:00
|
|
|
|
2024-11-28 10:43:06 +08:00
|
|
|
List<String> getSubscriptionIds(String name, String userEmail) throws StripeException;
|
2024-11-18 16:20:25 +08:00
|
|
|
|
2024-12-09 16:53:29 +08:00
|
|
|
Map<String, String> getPaymentMethodByInvoiceId(String invoiceId);
|
|
|
|
|
|
2024-12-16 10:26:02 +08:00
|
|
|
void cancelSubscription(String orderNo, String cancelReason);
|
2024-11-18 16:20:25 +08:00
|
|
|
|
2024-11-28 10:43:06 +08:00
|
|
|
void cancelSubscriptionTemp(String subscriptionId);
|
|
|
|
|
|
2024-11-18 16:20:25 +08:00
|
|
|
Map<String, String> getPaymentMethod(String paymentMethodId);
|
|
|
|
|
|
|
|
|
|
/*void updateSubscription(String subscriptionId);
|
|
|
|
|
|
|
|
|
|
void resume(String subscriptionId);*/
|
|
|
|
|
|
|
|
|
|
void subscriptionReminder();
|
|
|
|
|
|
|
|
|
|
void checkSubscriptionExpiration();
|
|
|
|
|
|
2024-11-28 10:43:06 +08:00
|
|
|
String createSubscriptionTemp(String name, String email);
|
|
|
|
|
|
|
|
|
|
String changeCustomerPayment(String name, String email);
|
|
|
|
|
|
|
|
|
|
boolean sendRenewalFailEmail(String invoiceId, String subscriptionId, String orderNo);
|
2024-12-09 16:53:29 +08:00
|
|
|
|
2024-12-18 11:53:41 +08:00
|
|
|
List<Map<String,String>> getCustomerPaymentMethod(String name, String email);
|
|
|
|
|
|
|
|
|
|
String detachCustomerAllPaymentMethod(String name, String email);
|
2024-07-15 13:42:18 +08:00
|
|
|
}
|