improving ecocash payment handling
This commit is contained in:
@@ -38,7 +38,34 @@ public class ConfigController {
|
||||
private final IntegrationProcessorService integrationProcessorService;
|
||||
|
||||
@GetMapping("/seed")
|
||||
public ResponseEntity charges(){
|
||||
public ResponseEntity seedConfig(){
|
||||
|
||||
// clear existing payment processors before seeding
|
||||
paymentProcessorService.getPaymentProcessorRepository().deleteAll();
|
||||
paymentProcessorService.getPaymentProcessorRepository().saveAll(Arrays.asList(
|
||||
PaymentProcessor.builder()
|
||||
.name("Ecocash")
|
||||
.label("ECOCASH")
|
||||
.type("GATEWAY")
|
||||
.image("ecocash.png")
|
||||
.accountFieldName("phoneNumber")
|
||||
.accountFieldLabel("EcoCash Phone Number")
|
||||
.description("Pay using your mobile wallet")
|
||||
.authType("REMOTE")
|
||||
.build(),
|
||||
PaymentProcessor.builder()
|
||||
.name("Visa/MasterCard")
|
||||
.label("MPGS")
|
||||
.type("GATEWAY")
|
||||
.image("visa-mastercard.png")
|
||||
.accountFieldName("cardNumber")
|
||||
.accountFieldLabel("Card Number")
|
||||
.description("Pay using your international card")
|
||||
.authType("WEB")
|
||||
.build()
|
||||
));
|
||||
|
||||
|
||||
|
||||
integrationProcessorService.getIntegrationProcessorRepository().deleteAll();
|
||||
integrationProcessorService.getIntegrationProcessorRepository().saveAll(Arrays.asList(
|
||||
@@ -79,6 +106,7 @@ public class ConfigController {
|
||||
.image("econet.png")
|
||||
.externalId("78f1f497-c9eb-401c-b22c-884756e68e40")
|
||||
.integrationProcessorLabel("STEWARD")
|
||||
.accountFieldName("Phone Number")
|
||||
.build(),
|
||||
Provider.builder()
|
||||
.description("NetOne Airtime")
|
||||
@@ -88,6 +116,7 @@ public class ConfigController {
|
||||
.image("netone.png")
|
||||
.externalId("95d485a7-39c9-4559-8a27-6521969abe8f")
|
||||
.integrationProcessorLabel("STEWARD")
|
||||
.accountFieldName("Phone Number")
|
||||
.build(),
|
||||
Provider.builder()
|
||||
.description("Prepaid Zesa")
|
||||
@@ -97,6 +126,7 @@ public class ConfigController {
|
||||
.image("zesa.png")
|
||||
.externalId("0f67f7cc-b62b-4fb5-915f-6740b2afdba6")
|
||||
.integrationProcessorLabel("STEWARD")
|
||||
.accountFieldName("Meter Number")
|
||||
.build(),
|
||||
Provider.builder()
|
||||
.description("Econet Broadband")
|
||||
@@ -106,30 +136,11 @@ public class ConfigController {
|
||||
.image("econet.png")
|
||||
.externalId("287863e2-a791-4106-b629-79dadc9a6779")
|
||||
.integrationProcessorLabel("STEWARD")
|
||||
.accountFieldName("Phone Number")
|
||||
.build()
|
||||
);
|
||||
providerService.getProviderRepository().saveAll(providers);
|
||||
|
||||
// Clear existing payment processors before seeding
|
||||
paymentProcessorService.getPaymentProcessorRepository().deleteAll();
|
||||
|
||||
// seed payment processors
|
||||
List<PaymentProcessor> paymentProcessors = Arrays.asList(
|
||||
PaymentProcessor.builder()
|
||||
.name("Ecocash")
|
||||
.label("ECOCASH")
|
||||
.type("GATEWAY")
|
||||
.image("https://www.ecocash.co.zw/images/logo.png")
|
||||
.build(),
|
||||
PaymentProcessor.builder()
|
||||
.name("Mastercard")
|
||||
.label("MPGS")
|
||||
.type("GATEWAY")
|
||||
.image("https://www.mastercard.com/content/dam/public/mastercardcom/global/en/icons/mc-symbol.svg")
|
||||
.build()
|
||||
);
|
||||
paymentProcessorService.getPaymentProcessorRepository().saveAll(paymentProcessors);
|
||||
|
||||
// Clear existing charges and charge conditions before seeding
|
||||
List<ChargeCondition> chargeConditions = Arrays.asList(
|
||||
ChargeCondition.builder()
|
||||
|
||||
Reference in New Issue
Block a user