Просмотр исходного кода

WIP. getting payments to work. modularize model manifests

tags/v0.1.6
Jonathan Cobb 5 лет назад
Родитель
Сommit
faa0d18811
14 измененных файлов: 78 добавлений и 29 удалений
  1. +9
    -0
      bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java
  2. +5
    -1
      bubble-server/src/main/java/bubble/resources/bill/AllPaymentMethodsResource.java
  3. +4
    -0
      bubble-server/src/main/resources/message_templates/server/en_US/post_auth/ResourceMessages.properties
  4. +1
    -1
      bubble-server/src/test/java/bubble/test/dev/DevServerTest.java
  5. +2
    -13
      bubble-server/src/test/resources/models/manifest-all.json
  6. +4
    -0
      bubble-server/src/test/resources/models/manifest-app-analytics.json
  7. +5
    -0
      bubble-server/src/test/resources/models/manifest-app-user-block-localhost.json
  8. +6
    -0
      bubble-server/src/test/resources/models/manifest-app-user-block.json
  9. +4
    -0
      bubble-server/src/test/resources/models/manifest-dev.json
  10. +2
    -5
      bubble-server/src/test/resources/models/manifest-live.json
  11. +2
    -7
      bubble-server/src/test/resources/models/manifest-proxy.json
  12. +32
    -0
      bubble-server/src/test/resources/models/system/cloudService_invite_test.json
  13. +1
    -1
      bubble-web
  14. +1
    -1
      utils/cobbzilla-wizard

+ 9
- 0
bubble-server/src/main/java/bubble/dao/cloud/CloudServiceDAO.java Просмотреть файл

@@ -34,4 +34,13 @@ public class CloudServiceDAO extends AccountOwnedTemplateDAO<CloudService> {
return found != null ? found : findByUniqueFields("account", accountUuid, "type", csType, "enabled", true, "name", id);
}

public List<CloudService> findByAccountAndTypeAndDriverClass(String accountUuid, CloudServiceType csType, String driverClass) {
return findByFields("account", accountUuid, "type", csType, "enabled", true, "driverClass", driverClass);
}

public CloudService findFirstByAccountAndTypeAndDriverClass(String accountUuid, CloudServiceType csType, String driverClass) {
final List<CloudService> found = findByAccountAndTypeAndDriverClass(accountUuid, csType, driverClass);
return found.isEmpty() ? null : found.get(0);
}

}

+ 5
- 1
bubble-server/src/main/java/bubble/resources/bill/AllPaymentMethodsResource.java Просмотреть файл

@@ -54,7 +54,11 @@ public class AllPaymentMethodsResource {
public Response findPaymentMethod(@Context ContainerRequest ctx,
@PathParam("id") String id) {
final Account account = userPrincipal(ctx);
final CloudService cloud = cloudDAO.findByAccountAndTypeAndId(account.getUuid(), CloudServiceType.payment, id);
CloudService cloud = cloudDAO.findByAccountAndTypeAndId(account.getUuid(), CloudServiceType.payment, id);
if (cloud == null) {
// try to find by driverClass
cloud = cloudDAO.findFirstByAccountAndTypeAndDriverClass(account.getUuid(), CloudServiceType.payment, id);
}
if (cloud == null) return notFound(id);
return ok(new PaymentService(cloud, cloud.getPaymentDriver(configuration).getPaymentMethodType()));
}


+ 4
- 0
bubble-server/src/main/resources/message_templates/server/en_US/post_auth/ResourceMessages.properties Просмотреть файл

@@ -68,6 +68,10 @@ payment_description_credit=Pay using a Credit Card
payment_description_code=Use an Invitation Code
payment_description_free=Enjoy Bubble for FREE!

# Payment fields
field_payment_invite_code=Invitation Code
button_label_submit_invite_code=Use Invite Code

# Error messages from API server
err.accountContactsJson.length=Account contacts length violation
err.accountPlan.callerCountryDisallowed=Your country is not currently supported by our platform


+ 1
- 1
bubble-server/src/test/java/bubble/test/dev/DevServerTest.java Просмотреть файл

@@ -11,7 +11,7 @@ import static org.cobbzilla.util.system.Sleep.sleep;
public class DevServerTest extends ActivatedBubbleModelTestBase {

@Override protected String getModelPrefix() { return "models/"; }
@Override protected String getManifest() { return "manifest-all"; }
@Override protected String getManifest() { return "manifest-dev"; }

@Override protected boolean useMocks() { return false; }



+ 2
- 13
bubble-server/src/test/resources/models/manifest-all.json Просмотреть файл

@@ -1,15 +1,4 @@
[
"system/cloudService",
"system/cloudService_live",
"system/bubbleDomain",
"system/bubblePlan",
"system/bubbleFootprint",
"system/ruleDriver",
"apps/user_block/bubbleApp_userBlock",
"apps/user_block/hn/bubbleApp_userBlock_hn",
"apps/user_block/hn/bubbleApp_userBlock_hn_matchers",
"apps/user_block/hn/bubbleApp_userBlock_hn_data",
"apps/user_block/localhost/bubbleApp_userBlock_localhost",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_matchers",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_data"
"manifest-live",
"manifest-app-user-block-localhost"
]

+ 4
- 0
bubble-server/src/test/resources/models/manifest-app-analytics.json Просмотреть файл

@@ -0,0 +1,4 @@
[
"apps/analytics/bubbleApp_analytics",
"apps/analytics/bubbleApp_analytics_matchers"
]

+ 5
- 0
bubble-server/src/test/resources/models/manifest-app-user-block-localhost.json Просмотреть файл

@@ -0,0 +1,5 @@
[
"apps/user_block/localhost/bubbleApp_userBlock_localhost",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_matchers",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_data"
]

+ 6
- 0
bubble-server/src/test/resources/models/manifest-app-user-block.json Просмотреть файл

@@ -0,0 +1,6 @@
[
"apps/user_block/bubbleApp_userBlock",
"apps/user_block/hn/bubbleApp_userBlock_hn",
"apps/user_block/hn/bubbleApp_userBlock_hn_matchers",
"apps/user_block/hn/bubbleApp_userBlock_hn_data"
]

+ 4
- 0
bubble-server/src/test/resources/models/manifest-dev.json Просмотреть файл

@@ -0,0 +1,4 @@
[
"manifest-all",
"system/cloudService_invite_test"
]

+ 2
- 5
bubble-server/src/test/resources/models/manifest-live.json Просмотреть файл

@@ -5,9 +5,6 @@
"system/bubblePlan",
"system/bubbleFootprint",
"system/ruleDriver",
"apps/analytics/bubbleApp_analytics",
"apps/analytics/bubbleApp_analytics_matchers",
"apps/user_block/bubbleApp_userBlock",
"apps/user_block/hn/bubbleApp_userBlock_hn",
"apps/user_block/hn/bubbleApp_userBlock_hn_matchers"
"manifest-app-user-analytics",
"manifest-app-user-block"
]

+ 2
- 7
bubble-server/src/test/resources/models/manifest-proxy.json Просмотреть файл

@@ -1,10 +1,5 @@
[
"system/ruleDriver",
"apps/user_block/bubbleApp_userBlock",
"apps/user_block/hn/bubbleApp_userBlock_hn",
"apps/user_block/hn/bubbleApp_userBlock_hn_matchers",
"apps/user_block/hn/bubbleApp_userBlock_hn_data",
"apps/user_block/localhost/bubbleApp_userBlock_localhost",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_matchers",
"apps/user_block/localhost/bubbleApp_userBlock_localhost_data"
"manifest-app-user-block",
"manifest-app-user-block-localhost"
]

+ 32
- 0
bubble-server/src/test/resources/models/system/cloudService_invite_test.json Просмотреть файл

@@ -0,0 +1,32 @@
[
{
"_subst": true,
"name": "InviteCode",
"children": {
"CloudServiceData": [
{
"_subst": true,
"key": "code1",
"dataJson": {
"token": "code1",
"expiration": "{{timestamp 'now,33d'}}"
}
}, {
"_subst": true,
"key": "code2",
"dataJson": {
"token": "code2",
"expiration": "{{timestamp 'now,33d'}}"
}
}, {
"_subst": true,
"key": "expired",
"dataJson": {
"token": "expired",
"expiration": "{{timestamp 'now'}}"
}
}
]
}
}
]

+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit 0cf7321e714801118c7ab13ca2202a68936c0dea
Subproject commit a7a0fbb20bc83b243bb5f99ee219a1be2c0fbeed

+ 1
- 1
utils/cobbzilla-wizard

@@ -1 +1 @@
Subproject commit 54c08985284f4f81dad3200b04e93384cbdffb12
Subproject commit b44f0dbd7aa201646fe4bb4999e9e97e81fce258

Загрузка…
Отмена
Сохранить