-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
112 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package net.nanxu.payment; | ||
|
||
import org.springframework.stereotype.Component; | ||
import run.halo.app.infra.ExternalLinkProcessor; | ||
|
||
/** | ||
* ExternalLinkCreator. | ||
* | ||
* @author: P | ||
**/ | ||
@Component | ||
public class ExternalLinkCreator { | ||
private final ExternalLinkProcessor externalLinkProcessor; | ||
|
||
public ExternalLinkCreator(ExternalLinkProcessor externalLinkProcessor) { | ||
this.externalLinkProcessor = externalLinkProcessor; | ||
} | ||
|
||
public String paymentUrl(String orderNo, String channel) { | ||
return externalLinkProcessor.processLink("/payment/" + orderNo + "/pay/" + channel); | ||
} | ||
|
||
public String callbackUrl(String internal, String orderNo, String channel) { | ||
return externalLinkProcessor.processLink("/payment/" + internal + "/" + orderNo + "/callback/" + channel); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/net/nanxu/payment/NotificationExtensionGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.nanxu.payment; | ||
|
||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import net.nanxu.payment.infra.INotification; | ||
import org.springframework.stereotype.Component; | ||
import run.halo.app.plugin.extensionpoint.ExtensionGetter; | ||
|
||
/** | ||
* NotificationExtensionGetter. | ||
* | ||
* @author: P | ||
**/ | ||
@RequiredArgsConstructor | ||
@Component | ||
public class NotificationExtensionGetter { | ||
private final ExtensionGetter extensionGetter; | ||
|
||
public List<INotification> getNotificationExtensions() { | ||
return extensionGetter.getExtensionList(INotification.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/net/nanxu/payment/PaymentExtensionGetter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package net.nanxu.payment; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import net.nanxu.payment.infra.IPayment; | ||
import org.springframework.stereotype.Component; | ||
import run.halo.app.plugin.extensionpoint.ExtensionGetter; | ||
import java.util.List; | ||
|
||
/** | ||
* PaymentExtensionGetter. | ||
* | ||
* @author: P | ||
**/ | ||
@RequiredArgsConstructor | ||
@Component | ||
public class PaymentExtensionGetter { | ||
private final ExtensionGetter extensionGetter; | ||
|
||
public List<IPayment> getPaymentExtensions() { | ||
return extensionGetter.getExtensionList(IPayment.class); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.