Skip to content

Commit

Permalink
Release 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
damian229 committed Aug 11, 2021
1 parent bd4df31 commit 4520c5b
Show file tree
Hide file tree
Showing 15 changed files with 365 additions and 346 deletions.
32 changes: 32 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PAYPAL_HYPERWALLET_API_PASSWORD=
PAYPAL_HYPERWALLET_API_SERVER=
PAYPAL_HYPERWALLET_API_USERNAME=
PAYPAL_HYPERWALLET_OPERATOR_BANK_ACCOUNT_TOKEN_DEFAULT=
PAYPAL_HYPERWALLET_PROGRAM_TOKEN_PAYMENTS_DEFAULT=
PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT=
PAYPAL_HYPERWALLET_PROGRAM_TOKENS=
PAYPAL_MAIL_SMTP_AUTH=
PAYPAL_MAIL_SMTP_STARTTLS_ENABLE=
PAYPAL_MAIL_USER_NAME=
PAYPAL_MAIL_USER_PASSWORD=
PAYPAL_SERVER_EMAIL_HOST=
PAYPAL_SERVER_EMAIL_PORT=

PAYPAL_MIRAKL_ENVIRONMENT=
PAYPAL_MIRAKL_OPERATOR_API_KEY=

PAYPAL_RABBITMQ_PASSWORD=
PAYPAL_RABBITMQ_USERNAME=
PAYPAL_RABBITMQ_ERLANG_COOKIE=

PAYPAL_BRAINTREE_MERCHANT_ID=
PAYPAL_BRAINTREE_PRIVATE_KEY=
PAYPAL_BRAINTREE_PUBLIC_KEY=

PAYPAL_HYPERWALLET_ENCRYPTION_ALGORITHM=
PAYPAL_HYPERWALLET_SIGN_ALGORITHM=
PAYPAL_HYPERWALLET_ENCRYPTION_METHOD=
PAYPAL_HYPERWALLET_PRIVATE_JWK_JSON_LOCATION=
PAYPAL_HYPERWALLET_PUBLIC_JWK_JSON_LOCATION=

PAYPAL_CONNECTOR_SERVER_URL=
399 changes: 255 additions & 144 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ subprojects {
environment =
environment = ["BP_JVM_VERSION" : "16",
"BPE_DELIM_JAVA_TOOL_OPTIONS" : " ",
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Xms256m -Xmx1g"
"BPE_APPEND_JAVA_TOOL_OPTIONS": "-Xms256m -Xmx1524m"
]
}

Expand Down
42 changes: 10 additions & 32 deletions docker-compose.prod.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,19 @@ services:
- "8080:8080"
depends_on:
- queue
volumes:
- ${PWD}/app-data:/workspace/data
environment:
- PAYPAL_MIRAKL_ENVIRONMENT
- PAYPAL_MIRAKL_OPERATOR_API_KEY
- PAYPAL_HYPERWALLET_API_SERVER
- PAYPAL_HYPERWALLET_PROGRAM_TOKENS
- PAYPAL_HYPERWALLET_PROGRAM_TOKEN_PAYMENTS_DEFAULT
- PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT
- PAYPAL_HYPERWALLET_API_USERNAME
- PAYPAL_HYPERWALLET_API_PASSWORD
- PAYPAL_SERVER_EMAIL_HOST
- PAYPAL_SERVER_EMAIL_PORT
- PAYPAL_MAIL_USER_NAME
- PAYPAL_MAIL_USER_PASSWORD
- PAYPAL_MAIL_SMTP_AUTH
- PAYPAL_MAIL_SMTP_STARTTLS_ENABLE
- PAYPAL_HYPERWALLET_OPERATOR_BANK_ACCOUNT_TOKEN_DEFAULT
- PAYPAL_RABBITMQ_USERNAME
- PAYPAL_RABBITMQ_PASSWORD
- PAYPAL_HYPERWALLET_ENCRYPTION_ALGORITHM
- PAYPAL_HYPERWALLET_SIGN_ALGORITHM
- PAYPAL_HYPERWALLET_ENCRYPTION_METHOD
- PAYPAL_HYPERWALLET_PRIVATE_JWK_JSON_LOCATION
- PAYPAL_HYPERWALLET_PUBLIC_JWK_JSON_LOCATION
- PAYPAL_CONNECTOR_SERVER_URL
- PAYPAL_BRAINTREE_MERCHANT_ID
- PAYPAL_BRAINTREE_PUBLIC_KEY
- PAYPAL_BRAINTREE_PRIVATE_KEY
- SPRING_PROFILES_ACTIVE=${PAYPAL_SPRING_PROFILE_ACTIVE:-prod}
- PAYPAL_BRAINTREE_REPORT_ENVIRONMENT
- PWD=/workspace
env_file:
- '.env'
volumes:
- ${PWD}/keys:/home/keys
- ${PWD}/financial-reports:/home/reports
- ${PWD}/logs:/workspace/logs
- ${PWD}/app-data:/workspace/data
queue:
image: rabbitmq:management
image: rabbitmq:3.8.18-management
restart: always
hostname: paypal-hyperwallet-rabbitmq
ports:
Expand All @@ -56,6 +33,7 @@ services:
volumes:
- ${PWD}/rabbitmq-data:/var/lib/rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=paypal
- RABBITMQ_DEFAULT_PASS=hyperwallet
- RABBITMQ_ERLANG_COOKIE=super-secret-erlang-cookie
- RABBITMQ_DEFAULT_USER=${PAYPAL_RABBITMQ_USERNAME}
- RABBITMQ_DEFAULT_PASS=${PAYPAL_RABBITMQ_PASSWORD}
- RABBITMQ_ERLANG_COOKIE=${PAYPAL_RABBITMQ_ERLANG_COOKIE}

77 changes: 0 additions & 77 deletions docker-compose.yml

This file was deleted.

46 changes: 12 additions & 34 deletions docker-compose.yml.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
version: "3.8"
services:
app:
env_file:
- ".env"
image: @DOCKER_REPOSITORY_NAME@:@DOCKER_TAG@
restart: always
ports:
Expand All @@ -9,41 +11,15 @@ services:
queue:
condition: service_healthy
environment:
- PAYPAL_MIRAKL_ENVIRONMENT
- PAYPAL_MIRAKL_OPERATOR_API_KEY
- PAYPAL_HYPERWALLET_API_SERVER
- PAYPAL_HYPERWALLET_API_USERNAME
- PAYPAL_HYPERWALLET_API_PASSWORD
- PAYPAL_HYPERWALLET_PROGRAM_TOKENS
- PAYPAL_HYPERWALLET_PROGRAM_TOKEN_PAYMENTS_DEFAULT
- PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT
- PAYPAL_SERVER_EMAIL_HOST
- PAYPAL_SERVER_EMAIL_PORT
- PAYPAL_MAIL_USER_NAME
- PAYPAL_MAIL_USER_PASSWORD
- PAYPAL_MAIL_SMTP_AUTH
- PAYPAL_MAIL_SMTP_STARTTLS_ENABLE
- PAYPAL_HYPERWALLET_OPERATOR_BANK_ACCOUNT_TOKEN_DEFAULT
- PAYPAL_RABBITMQ_USERNAME
- PAYPAL_RABBITMQ_PASSWORD
- PAYPAL_MOCKSERVER_URL
- PAYPAL_HYPERWALLET_ENCRYPTION_ALGORITHM
- PAYPAL_HYPERWALLET_SIGN_ALGORITHM
- PAYPAL_HYPERWALLET_ENCRYPTION_METHOD
- PAYPAL_HYPERWALLET_PRIVATE_JWK_JSON_LOCATION
- PAYPAL_HYPERWALLET_PUBLIC_JWK_JSON_LOCATION
- PAYPAL_HYPERWALLET_QA_JWK_JSON_LOCATION
- PAYPAL_CONNECTOR_SERVER_URL
- PAYPAL_BRAINTREE_MERCHANT_ID
- PAYPAL_BRAINTREE_PUBLIC_KEY
- PAYPAL_BRAINTREE_PRIVATE_KEY
- SPRING_PROFILES_ACTIVE=${PAYPAL_SPRING_PROFILE_ACTIVE:-dev}
- PWD=/workspace
volumes:
- ${PWD}/keys:/home/keys
- ${PWD}/financial-reports:/home/reports
- ${PWD}/logs:/workspace/logs
- ${PWD}/app-data:/workspace/data
queue:
image: rabbitmq:management
image: rabbitmq:3.8.18-management
restart: always
hostname: paypal-hyperwallet-rabbitmq
healthcheck:
Expand All @@ -61,16 +37,18 @@ services:
volumes:
- ${PWD}/rabbitmq-data:/var/lib/rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=paypal
- RABBITMQ_DEFAULT_PASS=hyperwallet
- RABBITMQ_ERLANG_COOKIE=super-secret-erlang-cookie
- RABBITMQ_DEFAULT_USER=${PAYPAL_RABBITMQ_USERNAME}
- RABBITMQ_DEFAULT_PASS=${PAYPAL_RABBITMQ_PASSWORD}
- RABBITMQ_ERLANG_COOKIE=${PAYPAL_RABBITMQ_ERLANG_COOKIE}
env_file:
- ".env"
smtp:
image: mailhog/mailhog
restart: always
hostname: paypal-hyperwallet-mailhog
ports:
- "1025:1025"
- "8025:8025"
- "1025:1025"
- "8025:8025"
logging:
driver: "json-file"
options:
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
springBoot = 2.4.5
dependencyManagement = 1.0.11.RELEASE
projectVersion = 3.1
projectVersion = 4.0
paypalHyperwalletDockerRepository = hyperwallet-mirakl-connector
org.gradle.jvmargs = -XX:PermSize=1024M -XX:MaxPermSize=1024M
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.paypal.infrastructure.listeners;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.amqp.AmqpRejectAndDontRequeueException;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.listener.api.RabbitListenerErrorHandler;
Expand All @@ -22,8 +24,9 @@ public class RabbitMQGlobalErrorHandler implements RabbitListenerErrorHandler {
@Override
public Object handleError(final Message amqpMessage, final org.springframework.messaging.Message<?> message,
final ListenerExecutionFailedException exception) {
log.error(Arrays.toString(amqpMessage.getBody()));
log.error(message.getPayload().toString());
log.error("Body: {}", Arrays.toString(amqpMessage.getBody()));
log.error("Payload: {}",
ToStringBuilder.reflectionToString(message.getPayload(), ToStringStyle.NO_CLASS_NAME_STYLE));
throw new AmqpRejectAndDontRequeueException("Something failed processing the notifications, avoiding retry",
exception);
}
Expand Down
8 changes: 4 additions & 4 deletions infrastructure/src/main/resources/infrastructure.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
hyperwallet.api.hyperwalletprograms = ${PAYPAL_HYPERWALLET_PROGRAM_TOKENS}
mail.notifications.recipients = [email protected]
mail.notifications.from = [email protected]
spring.rabbitmq.host = queue
spring.rabbitmq.port = 5672
mail.notifications.recipients = ${PAYPAL_HYPERWALLET_MAIL_RECIPIENT:[email protected]}
mail.notifications.from = ${PAYPAL_HYPERWALLET_MAIL_FROM:[email protected]}
spring.rabbitmq.host = ${PAYPAL_RABBITMQ_HOST:queue}
spring.rabbitmq.port = ${PAYPAL_RABBITMQ_PORT:5672}
spring.rabbitmq.username = ${PAYPAL_RABBITMQ_USERNAME}
spring.rabbitmq.password = ${PAYPAL_RABBITMQ_PASSWORD}
28 changes: 14 additions & 14 deletions invoices/src/main/resources/invoices.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
invoices.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
invoices.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
invoices.hyperwallet.api.server = ${PAYPAL_HYPERWALLET_API_SERVER}
invoices.hyperwallet.api.username = ${PAYPAL_HYPERWALLET_API_USERNAME}
invoices.hyperwallet.api.password = ${PAYPAL_HYPERWALLET_API_PASSWORD}
invoices.operator.commissions.bankAccount.token.DEFAULT = ${PAYPAL_HYPERWALLET_OPERATOR_BANK_ACCOUNT_TOKEN_DEFAULT}
invoices.payments.queue = notifications.payments.queue
invoices.hyperwallet.api.hyperwalletprogram.token.DEFAULT = ${PAYPAL_HYPERWALLET_PROGRAM_TOKEN_PAYMENTS_DEFAULT}
invoices.operator.commissions.enabled = true
invoices.operator.creditNotes.enabled = true
payments.notifications.failureStatuses = FAILED,RECALLED,RETURNED
payments.notifications.acceptedStatuses = COMPLETED
invoices.extractinvoices.scheduling.cronexpression = 1 0 0 1/1 * ? *
mockserver.url = ${PAYPAL_MOCKSERVER_URL}
invoices.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
invoices.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
invoices.hyperwallet.api.server = ${PAYPAL_HYPERWALLET_API_SERVER}
invoices.hyperwallet.api.username = ${PAYPAL_HYPERWALLET_API_USERNAME}
invoices.hyperwallet.api.password = ${PAYPAL_HYPERWALLET_API_PASSWORD}
invoices.operator.commissions.bankAccount.token.DEFAULT = ${PAYPAL_HYPERWALLET_OPERATOR_BANK_ACCOUNT_TOKEN_DEFAULT:}
invoices.payments.queue = notifications.payments.queue
invoices.hyperwallet.api.hyperwalletprogram.token.DEFAULT = ${PAYPAL_HYPERWALLET_PROGRAM_TOKEN_PAYMENTS_DEFAULT:DEFAULT}
invoices.operator.commissions.enabled = ${PAYPAL_HYPERWALLET_OPERATOR_COMMISSIONS_ENABLED:true}
invoices.operator.creditNotes.enabled = ${PAYPAL_HYPERWALLET_OPERATOR_CREDIT_NOTES_ENABLED:true}
payments.notifications.failureStatuses = FAILED,RECALLED,RETURNED
payments.notifications.acceptedStatuses = COMPLETED
invoices.extractinvoices.scheduling.cronexpression = ${PAYPAL_HYPERWALLET_EXTRACT_INVOICES_CRON_EXPRESSION:1 0 0 1/1 * ? *}
mockserver.url = ${PAYPAL_MOCKSERVER_URL}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public enum KYCRejectionReasonTypeEnum {

private static final String HEADER = "There is an issue with verifying your details in Hyperwallet. Please ensure that you: <br /><ul>";

private static final String FOOTER = "</ul><br />For more information on document requirements please refer to the <a href=https://docs.hyperwallet.com/content/payee-requirements/v1/payee-verification/required-data Hypwerwallet> guidelines</a>.";
private static final String FOOTER = "</ul><br />For more information on document requirements please refer to the <a href=\"https://docs.hyperwallet.com/content/payee-requirements/v1/payee-verification/required-data\">Hyperwallet guidelines</a>.";

private KYCRejectionReasonTypeEnum(final String reason) {
this.reason = reason;
Expand Down
14 changes: 7 additions & 7 deletions kyc/src/main/resources/kyc.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
kyc.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
kyc.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
kyc.hyperwallet.api.server = ${PAYPAL_HYPERWALLET_API_SERVER}
kyc.hyperwallet.api.username = ${PAYPAL_HYPERWALLET_API_USERNAME}
kyc.hyperwallet.api.password = ${PAYPAL_HYPERWALLET_API_PASSWORD}
kyc.users.hyperwallet.queue = notifications.users.kyc.queue
kyc.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
kyc.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
kyc.hyperwallet.api.server = ${PAYPAL_HYPERWALLET_API_SERVER}
kyc.hyperwallet.api.username = ${PAYPAL_HYPERWALLET_API_USERNAME}
kyc.hyperwallet.api.password = ${PAYPAL_HYPERWALLET_API_PASSWORD}
kyc.users.hyperwallet.queue = notifications.users.kyc.queue
kyc.hyperwallet.api.hyperwalletprogram.token.DEFAULT = ${PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT}
kyc.documentsextract.scheduling.cronexpression = 1 30 0 1/1 * ? *
kyc.documentsextract.scheduling.cronexpression = ${PAYPAL_HYPERWALLET_EXTRACT_DOCUMENTS_CRON_EXPRESSION:1 30 0 1/1 * ? *}
24 changes: 10 additions & 14 deletions reports/src/main/resources/reports.properties
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
reports.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
reports.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
reports.hmc.financialRepoLocation = /home/reports/
reports.extractreports.scheduling.cronexpression = 1 0 0 1/1 * ? *
reports.financialReport.header = braintreeCommerceOrderId,miraklOrderId,miraklSellerId,miraklTransactionLineId,miraklTransactionTime,TransactionType,braintreeAmount,miraklDebitAmount,miraklCreditAmount,currencyIsoCode,braintreeTransactionId,braintreeTransactionTime
reports.financialReport.prefixFileName = financialReport
reports.server.hmcServerUri = ${PAYPAL_CONNECTOR_SERVER_URL}
reports.braintree.environment = sandbox

# Uncomment for PRODUCTION
#reports.braintree.environment = production
reports.braintree.merchantId = ${PAYPAL_BRAINTREE_MERCHANT_ID}
reports.braintree.publicKey = ${PAYPAL_BRAINTREE_PUBLIC_KEY}
reports.braintree.privateKey = ${PAYPAL_BRAINTREE_PRIVATE_KEY}
reports.mirakl.operatorApiKey = ${PAYPAL_MIRAKL_OPERATOR_API_KEY}
reports.mirakl.environment = ${PAYPAL_MIRAKL_ENVIRONMENT}
reports.hmc.financialRepoLocation = /home/reports/
reports.financialReport.header = braintreeCommerceOrderId,miraklOrderId,miraklSellerId,miraklTransactionLineId,miraklTransactionTime,TransactionType,braintreeAmount,miraklDebitAmount,miraklCreditAmount,currencyIsoCode,braintreeTransactionId,braintreeTransactionTime
reports.financialReport.prefixFileName = financialReport
reports.server.hmcServerUri = ${PAYPAL_CONNECTOR_SERVER_URL}
reports.braintree.environment = ${PAYPAL_BRAINTREE_REPORT_ENVIRONMENT}
reports.braintree.merchantId = ${PAYPAL_BRAINTREE_MERCHANT_ID}
reports.braintree.publicKey = ${PAYPAL_BRAINTREE_PUBLIC_KEY}
reports.braintree.privateKey = ${PAYPAL_BRAINTREE_PRIVATE_KEY}

8 changes: 4 additions & 4 deletions sellers/src/main/resources/sellers.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sellers.mirakl.environment = ${PAYPAL_MIRAKL_E
sellers.hyperwallet.api.server = ${PAYPAL_HYPERWALLET_API_SERVER}
sellers.hyperwallet.api.username = ${PAYPAL_HYPERWALLET_API_USERNAME}
sellers.hyperwallet.api.password = ${PAYPAL_HYPERWALLET_API_PASSWORD}
sellers.hyperwallet.api.hyperwalletprogram.token.DEFAULT = ${PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT}
sellers.extractsellers.scheduling.cronexpression = 0 0 0 1/1 * ? *
sellers.extractprofessionalsellers.scheduling.cronexpression = 0 0 0 1/1 * ? *
sellers.bankaccountextract.scheduling.cronexpression = 0 30 0 1/1 * ? *
sellers.hyperwallet.api.hyperwalletprogram.token.DEFAULT = ${PAYPAL_HYPERWALLET_PROGRAM_TOKEN_USERS_DEFAULT}
sellers.extractsellers.scheduling.cronexpression = ${PAYPAL_HYPERWALLET_EXTRACT_SELLERS_CRON_EXPRESSION:0 0 0 1/1 * ? *}
sellers.extractprofessionalsellers.scheduling.cronexpression = ${PAYPAL_HYPERWALLET_EXTRACT_PROFESSIONAL_SELLERS_CRON_EXPRESSION:0 0 0 1/1 * ? *}
sellers.bankaccountextract.scheduling.cronexpression = ${PAYPAL_HYPERWALLET_BANK_ACCOUNT_EXTRACT_CRON_EXPRESSION:0 30 0 1/1 * ? *}
Loading

0 comments on commit 4520c5b

Please sign in to comment.