SDK Programming Guide
  • 3.3.9 Getting wallet information from Samsung Pay
  • Partner apps: Issuer

  • The SamsungPay class furnishes the getWalletInfo() API method, which is called to request wallet information from Samsung Pay app prior to calling the addCard() API, if needed. When the Add to Samsung Pay button is pressed, the issuer app can call the getWalletInfo() API method prior to calling the addCard() API. Issuer apps use this information to uniquely identify the user and the Samsung Pay app on a particular device (wallet device master ID, device ID, and so on).

  • void getWalletInfo(List<String> keys, StatusListener callback)
    
  • The following example illustrates the use of getWalletInfo():
  • public void doWalletInfo() {
    		Bundle bundle = new Bundle();
    		bundle.putString(SamsungPay.EXTRA_ISSUER_NAME, 
    "issuer name");
    		bundle.putString(SamsungPay.PARTNER_SERVICE_TYPE, SamsungPay.ServiceType.APP2APP.toString());
    
    		final PartnerInfo partnerInfo = new PartnerInfo(SID, bundle);
    
    		SamsungPay spay = new SamsungPay(context, partnerInfo);
    
    		// Bundle keys added to get wallet information from Samsung Pay.
    		ArrayList<String> keys = new ArrayList<>();
    		keys.add(SamsungPay.WALLET_DM_ID);
    		keys.add(SamsungPay.DEVICE_ID);
    
    		spay.getWalletInfo(keys, new StatusListener() {
    			@Override
    			public void onSuccess(int status, Bundle walletData) {
    				// The success code and invoked wallet information.
    			}
    
    			@Override
    			public void onFail(int error, Bundle errorData ) {
    				// On any failure to get wallet information.
    				// Error code and message in case of failure.
    			}
            });
        }