All integration options require a Spreedly account and an environment key. See Create Your API Credentials for details.
This library is not publicly published and must be built and delivered via your own maven repository or local setup.
See the documentation for details on how to customize the form.
See also the sample usage in the demo app
See the documentation on the Composable functions
If you prefer a completely customized payment method collection and selection experience, you can use the Core SDK and SpreedlyClient
For example, to create a new credit card payment method with Spreedly, create and configure a CreditCardInfo
object, and send is using SpreedlyClient
Constructors:
CreditCardInfo(@NonNull String: fullName, @NonNull SpreedlySecureOpaqueString: number, @Nullable SpreedlySecureOpaqueString: verificationValue, @NonNull int: year, @NonNull int: month);
SpreedlyClient.newInstance(@NonNull String envKey, @NonNull String envSecret,@NonNull boolean test)
Example code:
CreditCardInfo info = new CreditCardInfo("Full Name", new SpreedlySecureOpaqueString("4111111111111111"), new SpreedlySecureOpaqueString("432"), 2025, 12);
SpreedlyClient client = SpreedlyClient.newInstance("your key", "your secret", true);
client.createCreditCardPaymentMethod(info, null, null).subscribe(new SingleObserver<TransactionResult<PaymentMethodResult>>() {
@Override
public void onSubscribe(@NonNull Disposable d) {
}
@Override
public void onSuccess(TransactionResult<PaymentMethodResult> trans) {
try {
if (trans.succeeded) {
Log.i("Spreedly", "trans.result.token: " + trans.result.token);
//do something with trans result
} else {
Log.e("Spreedly", "trans.message: " + trans.message);
// do something with error
}
} finally {
//finish
}
}
@Override
public void onError(@NonNull Throwable e) {
Log.e("Spreedly", e.getMessage(), e);
//do something with error
}
});
./gradlew :core-kmm:detektAndroidRelease :core-kmm:test :securewidgets-compose:detekt :securewidgets-compose:lintRelease