Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: square backend support #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@

<dependencies>
<!-- TODO: upgrade in nucleus-parent -->
<dependency>
<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<version>2021-09-15</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.impactupgrade.integration</groupId>
<artifactId>mailchimp-jvm-client</artifactId>
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/com/impactupgrade/nucleus/client/SquareClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.impactupgrade.nucleus.client;

import com.impactupgrade.nucleus.environment.Environment;
import com.stripe.net.RequestOptions;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class SquareClient {

private static final Logger log = LogManager.getLogger(StripeClient.class.getName());

protected final RequestOptions requestOptions;

public SquareClient(Environment env) {
// requestOptions = RequestOptions.builder().setApiKey(env.getConfig().square.secretKey).build();
requestOptions = RequestOptions.builder().build();
}

public SquareClient(RequestOptions requestOptions) {
this.requestOptions = requestOptions;
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.impactupgrade.nucleus.service.segment;

import com.impactupgrade.nucleus.environment.Environment;
import com.impactupgrade.nucleus.model.ManageDonationEvent;
import com.impactupgrade.nucleus.model.PaymentGatewayDeposit;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.Date;
import java.util.List;

public class SquarePaymentGatewayService implements PaymentGatewayService {

private static final Logger log = LogManager.getLogger(StripePaymentGatewayService.class);

protected Environment env;

@Override
public String name() { return "square"; }

@Override
public void init(Environment env) {
this.env = env;
}


@Override
public List<PaymentGatewayDeposit> getDeposits(Date startDate, Date endDate) throws Exception {
// TODO:
return null;
}

@Override
public void updateSubscription(ManageDonationEvent manageDonationEvent) throws Exception {
// TODO:
}

@Override
public void closeSubscription(ManageDonationEvent manageDonationEvent) throws Exception {
// TODO:
}
}