PiA Netaxept Android SDK is a library that provides the native In-App interaction of performing the Netaxept payment directly from an app on the Android device and minimizes PCI DSS requirements for you.
PiA - Netaxept iOS SDK can also be found here
![]() |
![]() |
---|
In your build.gradle
application level file, add:
implementation('eu.nets.pia:pia-sdk:1.5.0') { transitive = true; changing=true; }
Important: for the release version of your .apk, add the following rules in your application's proguard-rules.pro
file:
#Rules required by Card.Io library
-keep class eu.nets.pia.cardio.** { *; }
-dontwarn eu.nets.pia.cardio.**
Note: the library is available through both jcenter()
and mavenCentral()
repositories.
If you encounter any blockers when integrating the Netaxept - Android SDK
, feel free to check the Frequently Asked Questions page. If any of these answers does not fit your question, don't hesitate to contact us.
Minimum supported Android version is 5.0 - Due to PCI DSS requirements and known vulnerabilities in secure protocols less than TLS 1.2, TLS 1.2 is the only secure protocol available when connecting towards Netaxept. For this reason, we don't support the Android versions lower than 5.0 which are NOT enabled/supported TLS 1.2 by default. For more information, you can check the details from Netaxept.
These permissions are handled inside the binary, and your integration won't require any additional changes.
PiA SDK will require the internet permissions to be fully operational.
<uses-permission android:name="android.permission.INTERNET" />
CardIo library integrated by PiA SDK will also require permission for Camera and Vibrate.
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
We have provided a Sample Application to help you understand the use cases of the SDK functionalities. All you need to do is to setup your Back-End solution with Netaxept (see more), get the source code (check ReadMe on how to do basic setup) and then run it.
Supported payment methods:
- Cards: Visa, Mastercard, American Express, Diners, JCB, Maestro, Dankort, PayPal
- Vipps
- Swish
- Mobile wallets (MobilePay) โ available soon
Depending on your selected payment method, the SDK can be launched in multiple functionalities: Register Card, Basic Payment, Easy Payment, PayPal Payment etc. Please check our full documentation to see more.
In the example below, the SDK is launched to perform a payment with a new card.
- Create you own RegisterPayment handler, implementing the SDK's
RegisterPaymentHandler
public class RegisterPaymentHandlerImpl implements RegisterPaymentHandler {
@Override
public TransactionInfo doRegisterPaymentRequest(boolean saveCard) {
PaymentFlowCache paymentFlowCache = PaymentFlowCache.getInstance();
PaymentRegisterRequest paymentRegisterRequest = paymentFlowCache.getPaymentRegisterRequest();
paymentRegisterRequest.setStoreCard(saveCard);
MerchantRestClient.getInstance().registerPayment(paymentRegisterRequest);
if (!paymentFlowCache.isFinishedWithError()) {
PaymentRegisterResponse paymentRegisterResponse = paymentFlowCache.getPaymentRegisterResponse();
return new TransactionInfo(paymentRegisterResponse.getTransactionId(),
paymentRegisterResponse.getRedirectOK());
}
return null;
}
}
- Initialize and launch SDK to perform payment:
public class MainActivity extends AppCompatActivity {
private RegisterPaymentHandler mRegisterPaymentHandler;
private static final String CURRENCY = "EUR";
private static final String ORDER_NUMBER = "PiaSDK-Android";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mRegisterPaymentHandler = new RegisterPaymentHandlerImpl();
}
private MerchantInfo getMerchantInfo() {
boolean testMode = true; //Notify the SDK to use the test environment
return new MerchantInfo(BuildConfig.MERCHANT_ID, testMode);
}
private OrderInfo getOrderInfo() {
String priceString = mPriceView.getText().toString();
double price = priceString.isEmpty() ? 0 : Double.parseDouble(priceString);
return new OrderInfo(
price,
CURRENCY
);
}
private void callPiaSDK(PaymentMethod method) {
Bundle bundle = new Bundle();
bundle.putParcelable(PiaActivity.BUNDLE_MERCHANT_INFO, getMerchantInfo());
bundle.putParcelable(PiaActivity.BUNDLE_ORDER_INFO, getOrderInfo());
PiaSDK.getInstance().start(MainActivity.this, bundle, mRegisterPaymentHandler);
}
}
- In the activity which launched the SDK, override the
onActivityResult()
to handle the SDK result:
...
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode != PiaSDK.PIA_SDK_REQUEST) {
super.onActivityResult(requestCode, resultCode, data);
return;
}
//in case user cancelLed
Bundle bundle = new Bundle();
if (resultCode == RESULT_CANCELED) {
rollbackTransaction();
return;
}
if (resultCode == RESULT_OK) {
PiaResult result = data.getParcelableExtra(PiaActivity.BUNDLE_COMPLETE_RESULT);
if (result.isSuccess()) {
//in case of success, commit the payment
mRestClient.commitPayment(
mPaymentCache.getPaymentRegisterResponse().getTransactionId()
);
} else {
// Otherwise, handle the failure case
}
}
}
...
If you have any question or feedback, please contact us via email: [email protected]
Please check License file.