Loading...
allprojects {
repositories {
jcenter()
}
}dependencies {
implementation 'com.globalpayments.android:globalpayments-android-sdk:1.0'
}You can find a test suite of code samples for using the Android SDK in our GitHub repository.
You can find the latest SDK documentation under SDKs & Libraries. For a full list of test cards, see our Test Cards article. Code examples can be found in the API Explorer.
/// Prepare required configuration
GpApiConfig config = new GpApiConfig();
config.setServiceUrl("Service Url"); //(Sandbox URL: "https://apis.sandbox.globalpay.com/ucp")
config.setAppId("Your application ID");
config.setAppKey("Your application key");
/// Add config to container
ServicesContainer.configureService(config);
/// Prepare card
CreditCardData card = new CreditCardData();
card.setNumber("4111111111111111");
card.setExpMonth(12);
card.setExpYear(2025);
card.setCvn("123");
// Execute operation
Transaction transaction = card.charge(new BigDecimal("19.99"))
.withCurrency("USD")
.execute();| Card Number | Card Type | Expiration Date | Security Code |
|---|---|---|---|
| 4263970000005262 | Visa | 12/2025 | 123 |
| 2223000010005780 | MasterCard | 12/2025 | 900 |
| 5425230000004415 | MasterCard | 12/2025 | 123 |