Demo entry 6708092

1

   

Submitted by anonymous on Feb 01, 2018 at 05:45
Language: Java. Code size: 1.9 kB.

package com.SingTel.mWallet.vts.service;

import com.SingTel.mWallet.OneAppApplication;
import com.visa.cbp.sdk.facade.VisaPaymentSDK;
import com.visa.cbp.sdk.facade.data.TokenKey;
import com.visa.cbp.sdk.facade.data.TokenStatus;

import android.annotation.TargetApi;
import android.content.Context;
import android.nfc.cardemulation.HostApduService;
import android.os.Build;
import android.os.Bundle;

@TargetApi(Build.VERSION_CODES.KITKAT)
public class VisaHostApduService extends HostApduService {

	public static final String ACTION_TRANSACTION_COMPLETED_SUCCESSFULLY_MANUAL_MODE = "ACTION_TRANSACTION_COMPLETED_SUCCESSFULLY_MANUAL_MODE"; 
	public static final String ACTION_TRANSACTION_INITIATED = "ACTION_TRANSACTION_INITIATED"; 
	private byte[] CBP_ERROR_INVALID_CARD = {(byte) 0x69, (byte) 0x86}; 
	
	private Context mContext;

	private VisaPaymentSDK visaPaymentSDK; 
	private OneAppApplication walletApplication;
	
	private TokenKey selectedToken;
	private TokenStatus tokenStatus; 
			
	private boolean tokensExist = false; 
	private boolean isPaymentComplete; 
	
	@Override
	public byte[] processCommandApdu(byte[] apduBuffer, Bundle bundle) {

		mContext = getApplicationContext(); 
		walletApplication = (OneAppApplication) mContext; 
		long before = System.currentTimeMillis(); 
		
		if ( visaPaymentSDK == null ) { 
			
			/*
			if(!walletApplication.retrieveBooleanFromPreference (AppConstants.TRANSACTION_INITIATION_STATUS)){
				Intent transactionInitiatedIntent = new Intent(ACTION_TRANSACTION_INITIATED); 
				LocalBroadcastManager.getInstance(this).sendBroadcast (transactionInitiatedIntent); 
				walletApplication.saveBooleanInSharedPreference (AppConstants.TRANSACTION_INITIATION_STATUS, true); 
				return null;
			}
			*/
		}
		
		return null;
	}

	@Override
	public void onDeactivated(int reason) {
		// TODO Auto-generated method stub

	}
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).