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.aarfrom thelibsfolder, if it exists.
GitHub Packages Installation¶
- Remove the GitHub Packages configuration from your
build.gradlefile, 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-sdkdependency:
implementation("com.phoebus.libraries:pix-sdk:latest")
Adding phastpay-sdk Library¶
-
Create a folder named
libsinside theapp/directory, if it doesn’t already exist. -
Download the latest
.aarfile from the GitHub repository and add it to thelibsfolder. -
Add the dependency in your
build.gradlefile, 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
PixClientimport:
- 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.