iOS initialization
Overview
D1Task is the main entry point to D1 SDK. It should be called as soon as the issuer application is launched or at the earliest possible time.
Configure the D1 SDK
Provide configuration parameters
If the issuer application enables D1 Card Display or D1 Physical Card services, then the
ConfigParams.buildConfigCore(consumerID)parameter is required forD1Task.configure.If the issuer application enables D1 Tokenization or D1 Push services, then the
ConfigParams.buildConfigCore(consumerID)andConfigParams.buildConfigCard(activity, oemPayType, serviceId, visaClientAppId)parameters are required forD1Task.configure, where theserviceIdparameter is only required for Samsung Pay andvisaClientAppIdparameter is only required for the Visa payment network.
Examples
// Ask Thales delivery team for the following information
String d1ServiceUrl = "https://www.123.com";
String issuerID = "IssuerID";
byte[] rsaExponent = new byte[]{};
byte[] rsaModulus = new byte[]{};
String digitalCardUrl = "https://www.456.com";
Context applicationContext = null; // Issuer application should assign the application context.
// Initialize all necessary settings for D1 SDK.
D1Task d1Task = new D1Task.Builder()
.setContext(applicationContext)
.setD1ServiceURL(d1ServiceUrl)
.setIssuerID(issuerID)
.setD1ServiceRSAExponent(rsaExponent)
.setD1ServiceRSAModulus(rsaModulus)
.setDigitalCardURL(digitalCardUrl)
.build();
// Initialize the required SDKs.
// Application is required to provide consumerId.
String consumerID = "consumerID";
D1Params coreConfig = ConfigParams.buildConfigCore(consumerID);
// Required for Card Processing & Wallet Pay
// Since D1 SDK 3.2.0 version, the first parameter activity is not mandatory during configuration part, user should assign it when calling D1PushWallet.addDigitalCardToOEM() API, which is used to receive callback. D1Task.handleCardResult
// Third parameter is mandatory for Samsung Pay Service ID (Samsung Pay only).
// Last parameter is Visa Client App ID, if the value is not set, then it is assumed that the value is similar with Issuer ID.
D1Params cardConfig = ConfigParams.buildConfigCard(null, OEMPayType.GOOGLE_PAY, null, "visaClientAppId");
D1Task.ConfigCallback<Void> configCallback = new D1Task.ConfigCallback<Void>() {
@Override
public void onSuccess(@Nullable Void ignored) {
// D1 configuration is successful.
}
@Override
public void onError(@NonNull List<D1Exception> exceptions) {
// D1 configuration failed, check the exception for more details.
}
};
d1Task.configure(configCallback, coreConfig, cardConfig);Wallet-specific requirements
Google Pay
For Google Pay, the Activity.onActivityResult() method must be overridden in order to pass the content back to the SDK for further processing.
Samsung Pay
For Samsung Pay, the Samsung Service ID must be specified in the buildConfigCard parameter. The value must be synchronized with that in the Samsung Developer Portal.
Last updated
Was this helpful?