This file contains hidden or 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
| addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") | |
| addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") | |
| addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.0.0") |
This file contains hidden or 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
| name := "merchant-wallet-manager" | |
| lazy val akkaVersion = "2.6.17" | |
| lazy val akkaHttpVersion = "10.2.6" | |
| lazy val sharedSettings = Seq( | |
| organization := "com.lepltd", | |
| version := "1.0.0", | |
| scalaVersion := "2.13.6", | |
| trapExit := false, | |
| scalacOptions ++= Seq( |
This file contains hidden or 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
| mwManager { | |
| app { | |
| host = "0.0.0.0" | |
| port = 9000 | |
| } | |
| postgres { | |
| user=${?LOCAL_DATABASE_USER} | |
| password=${?LOCAL_DATABASE_PASSWORD} | |
| database="merchant_wallet_manager_db" | |
| port=${?LOCAL_DATABASE_PORT} |
This file contains hidden or 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
| version: '3.3' | |
| services: | |
| db: | |
| container_name: mysql8 | |
| image: mysql:8.0 | |
| command: mysqld --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci | |
| restart: always | |
| environment: | |
| MYSQL_DATABASE: 'db' | |
| # So you don't have to use root, but you can if you like |
This file contains hidden or 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
| libraryDependencies ++= Seq( | |
| "com.github.daddykotex" %% "courier" % courierVersion, | |
| "com.typesafe.akka" %% "akka-http" % akkaHttpVersion, | |
| "com.typesafe.akka" %% "akka-http-spray-json" % akkaHttpVersion, | |
| "com.typesafe.akka" %% "akka-actor-typed" % akkaVersion, | |
| "com.typesafe.akka" %% "akka-actor-testkit-typed" % akkaVersion % Test, | |
| "com.typesafe.akka" %% "akka-stream" % akkaVersion, | |
| "com.typesafe.akka" %% "akka-persistence-query" % akkaVersion, | |
| "ch.qos.logback" % "logback-classic" % "1.2.5", | |
| "io.spray" %% "spray-json" % "1.3.6", |
This file contains hidden or 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
| object EmailService { | |
| case class EmailModel(toEmail: String, subject: String, body: String) | |
| sealed trait Command | |
| case class SendEmailCommand(email: EmailModel, replyTo: ActorRef[Response]) extends Command { | |
| def sendEmail(email: EmailModel): Future[Unit] = { | |
This file contains hidden or 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
| object PeriodHelper { | |
| def computeEndDate(periodNum: Long, periodType: RecurringInterval) = { | |
| val days: Long = periodType match { | |
| case RecurringInterval.DAY => 1 * periodNum | |
| case RecurringInterval.WEEK => 7 * periodNum | |
| case RecurringInterval.MONTH => 28 * periodNum | |
| case RecurringInterval.YEAR => 365 * periodNum | |
| case _ => 0 * periodNum | |
| } |
This file contains hidden or 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
| version: '3.1' | |
| services: | |
| zookeeper: | |
| image: confluentinc/cp-zookeeper:5.2.2 | |
| hostname: zookeeper | |
| container_name: zookeeper | |
| ports: | |
| - "2181:2181" | |
| environment: | |
| ZOOKEEPER_CLIENT_PORT: 2181 |
This file contains hidden or 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
| def payment_transactions(conn, params)do | |
| pay_provider = params["provider"] | |
| #check pay provider | |
| if pay_provider == "paystack" do | |
| pay_status = check_paystack_status(transaction_ref) | |
This file contains hidden or 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
| defp check_paystack_status(reference_id) do | |
| secret_key = | |
| Application.get_env(:project_name, :paystack_config)[:secret_key] | |
| verify_url = | |
| "https://api.paystack.co/transaction/verify/#{reference_id}" | |
| headers = ['Authorization': "Bearer #{secret_key}"] |