Ir para o conteúdo

Migrating from Pix SDK to PhastPay SDK

Step-by-Step

Removing the pix-sdk Library

Manual Installation

  • Remove the file pix-sdk-vx.x.x.x.aar from the libs folder, if it exists.

GitHub Packages Installation

  • Remove the GitHub Packages configuration from your build.gradle file, if it was added previously.
maven {
    val githubProperties = Properties()
    githubProperties.load(FileInputStream(File("github.properties")))

    val gprUser = githubProperties.getProperty("USER")
    val token = githubProperties.getProperty("TOKEN")
    name = "GitHubPackages"
    url = uri("https://maven.pkg.github.com/paystore/pix-sdk")

    credentials {
        username = gprUser
        password = token
    }
}
  • Remove the pix-sdk dependency:
implementation("com.phoebus.libraries:pix-sdk:latest")

Adding phastpay-sdk Library

  • Create a folder named libs inside the app/ directory, if it doesn’t already exist.

  • Download the latest .aar file from the GitHub repository and add it to the libs folder.

  • Add the dependency in your build.gradle file, depending on your project style:

implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))   
implementation("com.google.code.gson:gson:2.10.1")
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.google.code.gson:gson:2.10.1'

Code Replacement

  • Replace the PixClient import:
- import com.phoebus.pix.sdk.PixClient
+ import com.phoebus.phastpay.sdk.client.PixClient
- import com.phoebus.pix.sdk.PixClient;
+ import com.phoebus.phastpay.sdk.client.PixClient;
  • Rebuild your project.