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

Refactor code to Kotlin #11

Open
wants to merge 10 commits 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
103 changes: 71 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,83 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# Built application files
*.apk
*.ap_
*.aab

# User-specific stuff:
# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml

# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# Gradle:
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
# Android Studio 3 in .gitignore file.
.idea/caches
.idea/modules.xml
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
.idea/navEditor.xml

# Mongo Explorer plugin:
.idea/mongoSettings.xml
# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore

## File-based project format:
*.iws
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild

## Plugin-specific files:
# Google Services (e.g. APIs or Firebase)
# google-services.json

# IntelliJ
/out/
# Freeline
freeline.py
freeline/
freeline_project_description.json

# mpeltonen/sbt-idea plugin
.idea_modules/
# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md

# JIRA plugin
atlassian-ide-plugin.xml
# Version control
vcs.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 18 additions & 16 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 12 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,20 @@ Una vez que haya recopilado la información de un cliente, tendrá que intercamb

## Creación de Token desde un formulario personalizado

Puede crear tokens utilizando el método utilizando el método de instancia Culqi createToken
Puede crear tokens utilizando el método utilizando el método getToken() del API enviando un objeto Card
Pasando el número de la tarjeta, cvv, la fecha de vencimiento y un correo

```java
Card card = new Card(“411111111111111”, “123”, 9, 2020, “wm@wm.com”);

Token token = new Token("{CODIGO COMERCIO}");

token.createToken(getApplicationContext(), card, new TokenCallback() {
@Override
public void onSuccess(JSONObject token) {
// get Token
token.get("id").toString()
}
@Override
public void onError(Exception error) {
}
});
```Kotlin
mTokenRestDataStore.getToken(Card(
card_number = etMainCardNumber.text.toString(),
cvv = etMainCVV.text.toString(),
expiration_month = "09",
expiration_year = 2020,
email = etMainEmail.text.toString()
)

//El CODIGO DEL COMERCIO se ingresa en build.gradle dentro de la carpeta app (Se reemplaza el <CODIGO COMERCIO> por el CODIGO DEL COMERCIO
//buildConfigField('String', 'AUTHORIZATION', '"Bearer <CODIGO COMERCIO>"')
```

## Usando Tokens
Expand Down
Loading