-
Notifications
You must be signed in to change notification settings - Fork 0
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
6 changed files
with
133 additions
and
17 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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/impactupgrade/nucleus/service/segment/StripeSynchronizationService.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,37 @@ | ||
package com.impactupgrade.nucleus.service.segment; | ||
|
||
import com.impactupgrade.nucleus.environment.Environment; | ||
import com.impactupgrade.nucleus.model.CrmContact; | ||
import com.impactupgrade.nucleus.model.PagedResults; | ||
|
||
import java.util.Calendar; | ||
|
||
public class StripeSynchronizationService implements SynchronizationService { | ||
|
||
protected Environment env; | ||
|
||
@Override | ||
public String name() { | ||
return "stripeSync"; | ||
} | ||
|
||
@Override | ||
public boolean isConfigured(Environment env) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void init(Environment env) { | ||
} | ||
|
||
@Override | ||
public void syncContacts(Calendar updatedAfter) throws Exception { | ||
PagedResults<CrmContact> contactPagedResults = env.primaryCrmService().getDonatingContacts(updatedAfter); | ||
for (PagedResults.ResultSet<CrmContact> resultSet : contactPagedResults.getResultSets()) { | ||
//TODO: bulk update? | ||
for (CrmContact crmContact : resultSet.getRecords()) { | ||
//TODO: update contact in Xero | ||
} | ||
} | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
...ources/META-INF/services/com.impactupgrade.nucleus.service.segment.SynchronizationService
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,2 @@ | ||
com.impactupgrade.nucleus.service.segment.StripeSynchronizationService | ||
com.impactupgrade.nucleus.service.segment.XeroSynchronizationService |