To add a co-badge card to Samsung Wallet, use the addCobadgeCard() method, provided by the CardManager (for the Samsung Pay SDK for Android) or SamsungPaySdkFlutter (for the Samsung Pay SDK for Flutter) class. As a co-badge card combines 2 payment networks, you must provide the card details for 2 different networks to provision the card. As you can provide the necessary card details without customer input, this method allows direct provisioning without switching between apps:
NoteIf your app is running on a Samsung Watch, create a WatchManager class instead of CardManager.
Gather the necessary card and wallet details in separate provisioning payloads for the primary and secondary card network, following the card networks' requirements.
Call the addCobadgeCard() method. The result is delivered to the AddCardListener interface, which provides the following events:
onSuccess(): Called when the operation is successful and returns information and status for the provisioned co-badge card.
onFail(): Called when the operation fails.
The following code snippet is an example of using the addCobadgeCard() method:
Samsung Pay SDK for Android:
String cardType = Card.CARD_TYPE_CREDIT;
String primaryTokenizationProvider = AddCardInfo.PROVIDER_ABCD;
// Provide your primary card network payload
String testPrimaryPayload = "ThisIsTestPrimaryPayloadCardInfo1234567890";
String secondaryTokenizationProvider = AddCardInfo.PROVIDER_EFGH;
// Provide your secondary card network payload
String testSecondaryPayload = "ThisIsTestSecondaryPayloadCardInfo1234567890";
Bundle primaryCardDetail = new Bundle();
primaryCardDetail.putString(AddCardInfo.EXTRA_PROVISION_PAYLOAD, testPrimaryPayload);
AddCardInfo primaryAddCardInfo = new AddCardInfo(cardType, primaryTokenizationProvider, primaryCardDetail);
Bundle secondaryCardDetail = new Bundle();
secondaryCardDetail.putString(AddCardInfo.EXTRA_PROVISION_PAYLOAD, testSecondaryPayload);
AddCardInfo secondaryAddCardInfo = new AddCardInfo(cardType, secondaryTokenizationProvider, secondaryCardDetail);
cardManager.addCobadgeCard(primaryAddCardInfo, secondaryAddCardInfo, new AddCardListener() {
@Override
public void onSuccess(int status, Card card) {
Log.d(TAG, "onSuccess callback is called");
}
@Override
public void onFail(int error, Bundle errorData ) {
Log.d(TAG, "onFail callback is called");
// Check extra error codes in the errorData bundle, such as
// SamsungPay.EXTRA_ERROR_REASON or SamsungPay.EXTRA_REQUEST_ID (if provided)
}
})
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.