Skip to content

Commit

Permalink
#286 initial stubs for supporting mollie as a payment provider
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Jun 5, 2017
1 parent 141b09e commit d7d3b69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main/java/alfio/manager/PaymentManager.java
Expand Up @@ -50,6 +50,7 @@ public class PaymentManager {

private final StripeManager stripeManager;
private final PaypalManager paypalManager;
private final MollieManager mollieManager;
private final TransactionRepository transactionRepository;
private final ConfigurationManager configurationManager;
private final AuditingRepository auditingRepository;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/alfio/model/transaction/PaymentProxy.java
Expand Up @@ -29,7 +29,8 @@ public enum PaymentProxy {
OFFLINE("offline payment", false, true, EnumSet.of(ConfigurationKeys.SettingCategory.PAYMENT_OFFLINE), false),
NONE("no payment required", false, false, Collections.emptySet(), false),
ADMIN("manual", false, false, Collections.emptySet(), false),
PAYPAL("paypal", false, true, EnumSet.of(ConfigurationKeys.SettingCategory.PAYMENT_PAYPAL), true);
PAYPAL("paypal", false, true, EnumSet.of(ConfigurationKeys.SettingCategory.PAYMENT_PAYPAL), true),
MOLLIE("mollie", false, true, EnumSet.of(ConfigurationKeys.SettingCategory.PAYMENT_MOLLIE), true);

private final String description;
private final boolean deskPayment;
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/alfio/manager/PaymentManagerTest.java
Expand Up @@ -63,22 +63,22 @@ public class PaymentManagerTest {{

describe("success flow", it -> {
it.should("return a successful payment result", expect -> {
expect.that(new PaymentManager(successStripe, null, transactionRepository, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, ""))
expect.that(new PaymentManager(successStripe, null, null, transactionRepository, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, ""))
.is(PaymentResult.successful(paymentId));
});
});

describe("stripe error", it -> {
it.should("return an unsuccessful payment result", expect -> {
expect.that(new PaymentManager(failureStripe, null, transactionRepository, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, ""))
expect.that(new PaymentManager(failureStripe, null, null, transactionRepository, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, ""))
.is(PaymentResult.unsuccessful(error));
});
});

describe("internal error", it -> {
it.should("throw IllegalStateException in case of internal error", expect -> {
expect.exception(IllegalStateException.class, () -> {
new PaymentManager(successStripe, null, failureTR, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, "");
new PaymentManager(successStripe, null, null, failureTR, configurationManager, auditingRepository, userRepository).processStripePayment("", "", 100, event, "", customerName, "");
});
});
});
Expand Down

0 comments on commit d7d3b69

Please sign in to comment.