Skip to content

Commit

Permalink
[DE-1079] Add missing event keys (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciej-nedza authored Dec 11, 2024
1 parent f283f3f commit 38066a6
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 7 deletions.
4 changes: 2 additions & 2 deletions doc/controllers/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ For more information on Stripe Direct Debit, please view the following two resou

For more information on Stripe Direct Debit, please view the following two resources:

+ [Payment Profiles via API for Stripe BECS Direct Debit]($e/Payment%20Profiles/createPaymentProfile)
+ [Payment Profiles via API for Stripe BECS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile)

+ [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit)

Expand Down Expand Up @@ -403,7 +403,7 @@ For more information on Stripe Direct Debit, please view the following two resou

For more information on Stripe Direct Debit, please view the following two resources:

+ [Payment Profiles via API for Stripe BACS Direct Debit]($e/Payment%20Profiles/createPaymentProfile)
+ [Payment Profiles via API for Stripe BACS Direct Debit](../../doc/controllers/payment-profiles.md#create-payment-profile)

+ [Full documentation on Stripe Direct Debit](https://maxio.zendesk.com/hc/en-us/articles/24176170430093-Stripe-SEPA-and-BECS-Direct-Debit)

Expand Down
33 changes: 33 additions & 0 deletions doc/models/event-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,37 @@
| `SubscriptionServiceCreditAccountBalanceChanged` |
| `CustomFieldValueChange` |
| `ItemPricePointChanged` |
| `RenewalSuccessRecreated` |
| `RenewalFailureRecreated` |
| `PaymentSuccessRecreated` |
| `PaymentFailureRecreated` |
| `SubscriptionDeletion` |
| `SubscriptionGroupBankAccountUpdate` |
| `SubscriptionPaypalAccountUpdate` |
| `SubscriptionGroupPaypalAccountUpdate` |
| `SubscriptionCustomerChange` |
| `AccountTransactionChanged` |
| `GoCardlessPaymentPaidOut` |
| `GoCardlessPaymentRejected` |
| `GoCardlessPaymentPending` |
| `StripeDirectDebitPaymentPaidOut` |
| `StripeDirectDebitPaymentRejected` |
| `StripeDirectDebitPaymentPending` |
| `MaxioPaymentsDirectDebitPaymentPaidOut` |
| `MaxioPaymentsDirectDebitPaymentRejected` |
| `MaxioPaymentsDirectDebitPaymentPending` |
| `InvoiceInCollectionsCanceled` |
| `SubscriptionAddedToGroup` |
| `SubscriptionRemovedFromGroup` |
| `ChargebackOpened` |
| `ChargebackLost` |
| `ChargebackAccepted` |
| `ChargebackClosed` |
| `ChargebackWon` |
| `PaymentCollectionMethodChanged` |
| `ComponentBillingDateChanged` |
| `SubscriptionTermRenewalScheduled` |
| `SubscriptionTermRenewalPending` |
| `SubscriptionTermRenewalActivated` |
| `SubscriptionTermRenewalRemoved` |

2 changes: 1 addition & 1 deletion doc/models/event-response.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"event": {
"id": 242,
"key": "custom_field_value_change",
"key": "subscription_state_change",
"message": "message0",
"subscription_id": 96,
"customer_id": 24,
Expand Down
2 changes: 1 addition & 1 deletion doc/models/event.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
```json
{
"id": 40,
"key": "subscription_group_signup_failure",
"key": "invoice_issued",
"message": "message8",
"subscription_id": 150,
"customer_id": 78,
Expand Down
34 changes: 32 additions & 2 deletions src/main/java/com/maxio/advancedbilling/models/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,22 @@ public void setCreatedAt(ZonedDateTime createdAt) {
* `subscription_bank_account_update`, `refund_failure`, `upcoming_renewal_notice`,
* `trial_end_notice`, `direct_debit_payment_paid_out`, `direct_debit_payment_rejected`,
* `direct_debit_payment_pending`, `pending_payment_created`, `pending_payment_failed`,
* `pending_payment_completed` don't have event_specific_data defined, they map to `null`
* `pending_payment_completed`, don't have event_specific_data defined,
* `renewal_success_recreated`, `renewal_failure_recreated`, `payment_success_recreated`,
* `payment_failure_recreated`, `subscription_deletion`,
* `subscription_group_bank_account_update`, `subscription_paypal_account_update`,
* `subscription_group_paypal_account_update`, `subscription_customer_change`,
* `account_transaction_changed`, `go_cardless_payment_paid_out`,
* `go_cardless_payment_rejected`, `go_cardless_payment_pending`,
* `stripe_direct_debit_payment_paid_out`, `stripe_direct_debit_payment_rejected`,
* `stripe_direct_debit_payment_pending`, `maxio_payments_direct_debit_payment_paid_out`,
* `maxio_payments_direct_debit_payment_rejected`,
* `maxio_payments_direct_debit_payment_pending`, `invoice_in_collections_canceled`,
* `subscription_added_to_group`, `subscription_removed_from_group`, `chargeback_opened`,
* `chargeback_lost`, `chargeback_accepted`, `chargeback_closed`, `chargeback_won`,
* `payment_collection_method_changed`, `component_billing_date_changed`,
* `subscription_term_renewal_scheduled`, `subscription_term_renewal_pending`,
* `subscription_term_renewal_activated`, `subscription_term_renewal_removed` they map to `null`
* instead.
* @return Returns the EventEventSpecificData
*/
Expand Down Expand Up @@ -232,7 +247,22 @@ public EventEventSpecificData getEventSpecificData() {
* `subscription_bank_account_update`, `refund_failure`, `upcoming_renewal_notice`,
* `trial_end_notice`, `direct_debit_payment_paid_out`, `direct_debit_payment_rejected`,
* `direct_debit_payment_pending`, `pending_payment_created`, `pending_payment_failed`,
* `pending_payment_completed` don't have event_specific_data defined, they map to `null`
* `pending_payment_completed`, don't have event_specific_data defined,
* `renewal_success_recreated`, `renewal_failure_recreated`, `payment_success_recreated`,
* `payment_failure_recreated`, `subscription_deletion`,
* `subscription_group_bank_account_update`, `subscription_paypal_account_update`,
* `subscription_group_paypal_account_update`, `subscription_customer_change`,
* `account_transaction_changed`, `go_cardless_payment_paid_out`,
* `go_cardless_payment_rejected`, `go_cardless_payment_pending`,
* `stripe_direct_debit_payment_paid_out`, `stripe_direct_debit_payment_rejected`,
* `stripe_direct_debit_payment_pending`, `maxio_payments_direct_debit_payment_paid_out`,
* `maxio_payments_direct_debit_payment_rejected`,
* `maxio_payments_direct_debit_payment_pending`, `invoice_in_collections_canceled`,
* `subscription_added_to_group`, `subscription_removed_from_group`, `chargeback_opened`,
* `chargeback_lost`, `chargeback_accepted`, `chargeback_closed`, `chargeback_won`,
* `payment_collection_method_changed`, `component_billing_date_changed`,
* `subscription_term_renewal_scheduled`, `subscription_term_renewal_pending`,
* `subscription_term_renewal_activated`, `subscription_term_renewal_removed` they map to `null`
* instead.
* @param eventSpecificData Value for EventEventSpecificData
*/
Expand Down
134 changes: 133 additions & 1 deletion src/main/java/com/maxio/advancedbilling/models/EventKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,73 @@ public enum EventKey {

CUSTOM_FIELD_VALUE_CHANGE,

ITEM_PRICE_POINT_CHANGED;
ITEM_PRICE_POINT_CHANGED,

RENEWAL_SUCCESS_RECREATED,

RENEWAL_FAILURE_RECREATED,

PAYMENT_SUCCESS_RECREATED,

PAYMENT_FAILURE_RECREATED,

SUBSCRIPTION_DELETION,

SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE,

SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE,

SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE,

SUBSCRIPTION_CUSTOMER_CHANGE,

ACCOUNT_TRANSACTION_CHANGED,

GO_CARDLESS_PAYMENT_PAID_OUT,

GO_CARDLESS_PAYMENT_REJECTED,

GO_CARDLESS_PAYMENT_PENDING,

STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT,

STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED,

STRIPE_DIRECT_DEBIT_PAYMENT_PENDING,

MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT,

MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED,

MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING,

INVOICE_IN_COLLECTIONS_CANCELED,

SUBSCRIPTION_ADDED_TO_GROUP,

SUBSCRIPTION_REMOVED_FROM_GROUP,

CHARGEBACK_OPENED,

CHARGEBACK_LOST,

CHARGEBACK_ACCEPTED,

CHARGEBACK_CLOSED,

CHARGEBACK_WON,

PAYMENT_COLLECTION_METHOD_CHANGED,

COMPONENT_BILLING_DATE_CHANGED,

SUBSCRIPTION_TERM_RENEWAL_SCHEDULED,

SUBSCRIPTION_TERM_RENEWAL_PENDING,

SUBSCRIPTION_TERM_RENEWAL_ACTIVATED,

SUBSCRIPTION_TERM_RENEWAL_REMOVED;


private static TreeMap<String, EventKey> valueMap = new TreeMap<>();
Expand Down Expand Up @@ -163,6 +229,39 @@ public enum EventKey {
SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED.value = "subscription_service_credit_account_balance_changed";
CUSTOM_FIELD_VALUE_CHANGE.value = "custom_field_value_change";
ITEM_PRICE_POINT_CHANGED.value = "item_price_point_changed";
RENEWAL_SUCCESS_RECREATED.value = "renewal_success_recreated";
RENEWAL_FAILURE_RECREATED.value = "renewal_failure_recreated";
PAYMENT_SUCCESS_RECREATED.value = "payment_success_recreated";
PAYMENT_FAILURE_RECREATED.value = "payment_failure_recreated";
SUBSCRIPTION_DELETION.value = "subscription_deletion";
SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE.value = "subscription_group_bank_account_update";
SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE.value = "subscription_paypal_account_update";
SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE.value = "subscription_group_paypal_account_update";
SUBSCRIPTION_CUSTOMER_CHANGE.value = "subscription_customer_change";
ACCOUNT_TRANSACTION_CHANGED.value = "account_transaction_changed";
GO_CARDLESS_PAYMENT_PAID_OUT.value = "go_cardless_payment_paid_out";
GO_CARDLESS_PAYMENT_REJECTED.value = "go_cardless_payment_rejected";
GO_CARDLESS_PAYMENT_PENDING.value = "go_cardless_payment_pending";
STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT.value = "stripe_direct_debit_payment_paid_out";
STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED.value = "stripe_direct_debit_payment_rejected";
STRIPE_DIRECT_DEBIT_PAYMENT_PENDING.value = "stripe_direct_debit_payment_pending";
MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT.value = "maxio_payments_direct_debit_payment_paid_out";
MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED.value = "maxio_payments_direct_debit_payment_rejected";
MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING.value = "maxio_payments_direct_debit_payment_pending";
INVOICE_IN_COLLECTIONS_CANCELED.value = "invoice_in_collections_canceled";
SUBSCRIPTION_ADDED_TO_GROUP.value = "subscription_added_to_group";
SUBSCRIPTION_REMOVED_FROM_GROUP.value = "subscription_removed_from_group";
CHARGEBACK_OPENED.value = "chargeback_opened";
CHARGEBACK_LOST.value = "chargeback_lost";
CHARGEBACK_ACCEPTED.value = "chargeback_accepted";
CHARGEBACK_CLOSED.value = "chargeback_closed";
CHARGEBACK_WON.value = "chargeback_won";
PAYMENT_COLLECTION_METHOD_CHANGED.value = "payment_collection_method_changed";
COMPONENT_BILLING_DATE_CHANGED.value = "component_billing_date_changed";
SUBSCRIPTION_TERM_RENEWAL_SCHEDULED.value = "subscription_term_renewal_scheduled";
SUBSCRIPTION_TERM_RENEWAL_PENDING.value = "subscription_term_renewal_pending";
SUBSCRIPTION_TERM_RENEWAL_ACTIVATED.value = "subscription_term_renewal_activated";
SUBSCRIPTION_TERM_RENEWAL_REMOVED.value = "subscription_term_renewal_removed";

valueMap.put("payment_success", PAYMENT_SUCCESS);
valueMap.put("payment_failure", PAYMENT_FAILURE);
Expand Down Expand Up @@ -211,6 +310,39 @@ public enum EventKey {
valueMap.put("subscription_service_credit_account_balance_changed", SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED);
valueMap.put("custom_field_value_change", CUSTOM_FIELD_VALUE_CHANGE);
valueMap.put("item_price_point_changed", ITEM_PRICE_POINT_CHANGED);
valueMap.put("renewal_success_recreated", RENEWAL_SUCCESS_RECREATED);
valueMap.put("renewal_failure_recreated", RENEWAL_FAILURE_RECREATED);
valueMap.put("payment_success_recreated", PAYMENT_SUCCESS_RECREATED);
valueMap.put("payment_failure_recreated", PAYMENT_FAILURE_RECREATED);
valueMap.put("subscription_deletion", SUBSCRIPTION_DELETION);
valueMap.put("subscription_group_bank_account_update", SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE);
valueMap.put("subscription_paypal_account_update", SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE);
valueMap.put("subscription_group_paypal_account_update", SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE);
valueMap.put("subscription_customer_change", SUBSCRIPTION_CUSTOMER_CHANGE);
valueMap.put("account_transaction_changed", ACCOUNT_TRANSACTION_CHANGED);
valueMap.put("go_cardless_payment_paid_out", GO_CARDLESS_PAYMENT_PAID_OUT);
valueMap.put("go_cardless_payment_rejected", GO_CARDLESS_PAYMENT_REJECTED);
valueMap.put("go_cardless_payment_pending", GO_CARDLESS_PAYMENT_PENDING);
valueMap.put("stripe_direct_debit_payment_paid_out", STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT);
valueMap.put("stripe_direct_debit_payment_rejected", STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED);
valueMap.put("stripe_direct_debit_payment_pending", STRIPE_DIRECT_DEBIT_PAYMENT_PENDING);
valueMap.put("maxio_payments_direct_debit_payment_paid_out", MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT);
valueMap.put("maxio_payments_direct_debit_payment_rejected", MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED);
valueMap.put("maxio_payments_direct_debit_payment_pending", MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING);
valueMap.put("invoice_in_collections_canceled", INVOICE_IN_COLLECTIONS_CANCELED);
valueMap.put("subscription_added_to_group", SUBSCRIPTION_ADDED_TO_GROUP);
valueMap.put("subscription_removed_from_group", SUBSCRIPTION_REMOVED_FROM_GROUP);
valueMap.put("chargeback_opened", CHARGEBACK_OPENED);
valueMap.put("chargeback_lost", CHARGEBACK_LOST);
valueMap.put("chargeback_accepted", CHARGEBACK_ACCEPTED);
valueMap.put("chargeback_closed", CHARGEBACK_CLOSED);
valueMap.put("chargeback_won", CHARGEBACK_WON);
valueMap.put("payment_collection_method_changed", PAYMENT_COLLECTION_METHOD_CHANGED);
valueMap.put("component_billing_date_changed", COMPONENT_BILLING_DATE_CHANGED);
valueMap.put("subscription_term_renewal_scheduled", SUBSCRIPTION_TERM_RENEWAL_SCHEDULED);
valueMap.put("subscription_term_renewal_pending", SUBSCRIPTION_TERM_RENEWAL_PENDING);
valueMap.put("subscription_term_renewal_activated", SUBSCRIPTION_TERM_RENEWAL_ACTIVATED);
valueMap.put("subscription_term_renewal_removed", SUBSCRIPTION_TERM_RENEWAL_REMOVED);
}

/**
Expand Down

0 comments on commit 38066a6

Please sign in to comment.