正在查看: bbinstant v6.24.0 应用的 PaytmPGService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: bbinstant v6.24.0 应用的 PaytmPGService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.paytm.pgsdk;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import java.util.Map;
public class PaytmPGService {
private static final String PRODUCTION_CANCEL_TRANSACTION_URL = "https://secure.paytm.in/oltp/HANDLER_INTERNAL/CANCEL_TXN";
private static final String PRODUCTION_CAS_URL = "https://secure.paytm.in/oltp-web/generateChecksum";
private static final String PRODUCTION_PG_URL = "https://secure.paytm.in/oltp-web/processTransaction";
private static final String PRODUCTION_STATUS_QUERY_URL = "https://secure.paytm.in/oltp/HANDLER_INTERNAL/TXNSTATUS";
private static final String STAGING_CANCEL_TRANSACTION_URL = "https://pguat.paytm.com/oltp/HANDLER_INTERNAL/CANCEL_TXN";
private static final String STAGING_CAS_URL = "https://pguat.paytm.com:8448/CAS/ChecksumGenerator";
private static final String STAGING_PG_URL = "https://pguat.paytm.com/oltp-web/processTransaction";
private static final String STAGING_STATUS_QUERY_URL = "https://pguat.paytm.com/oltp/HANDLER_INTERNAL/TXNSTATUS";
private static volatile PaytmPGService mService;
protected volatile String mCancelTransactionURL;
public volatile a mCertificate;
public volatile b mOrder;
protected volatile String mPGURL;
protected volatile c mPaymentTransactionCallback;
protected volatile d mRefundCallback;
protected volatile f mStatusQueryCallback;
private volatile String mStatusQueryURL;
private volatile boolean mbServiceRunning;
private ApplicationInfo getApplicationinfo(Context context) {
try {
return context.getPackageManager().getApplicationInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e2) {
e2.printStackTrace();
return null;
}
}
public static synchronized PaytmPGService getProductionService() {
PaytmPGService service;
synchronized (PaytmPGService.class) {
service = getService();
service.mStatusQueryURL = PRODUCTION_STATUS_QUERY_URL;
service.mCancelTransactionURL = PRODUCTION_CANCEL_TRANSACTION_URL;
service.mPGURL = PRODUCTION_PG_URL;
}
return service;
}
protected static synchronized PaytmPGService getService() {
PaytmPGService paytmPGService;
synchronized (PaytmPGService.class) {
try {
if (mService == null) {
PaytmUtility.debugLog("Creating an instance of Paytm PG Service...");
mService = new PaytmPGService();
PaytmUtility.debugLog("Created a new instance of Paytm PG Service.");
}
} catch (Exception e2) {
PaytmUtility.printStackTrace(e2);
}
paytmPGService = mService;
}
return paytmPGService;
}
public static synchronized PaytmPGService getStagingService() {
PaytmPGService service;
synchronized (PaytmPGService.class) {
service = getService();
service.mStatusQueryURL = STAGING_STATUS_QUERY_URL;
service.mCancelTransactionURL = STAGING_CANCEL_TRANSACTION_URL;
service.mPGURL = STAGING_PG_URL;
}
return service;
}
public void enableLog(Context context) {
ApplicationInfo applicationinfo = getApplicationinfo(context);
if (applicationinfo == null) {
Log.setEnableDebugLog(false);
return;
}
int i2 = applicationinfo.flags & 2;
applicationinfo.flags = i2;
Log.setEnableDebugLog(i2 != 0);
}
public synchronized void initialize(b bVar, a aVar) {
this.mOrder = bVar;
this.mCertificate = aVar;
}
public synchronized void startPaymentTransaction(Context context, boolean z, boolean z2, c cVar) {
try {
try {
enableLog(context);
if (!PaytmUtility.isNetworkAvailable(context)) {
stopService();
cVar.networkNotAvailable();
} else if (this.mbServiceRunning) {
PaytmUtility.debugLog("Service is already running.");
} else {
Bundle bundle = new Bundle();
if (this.mOrder != null) {
for (Map.Entry<String, String> entry : this.mOrder.getRequestParamMap().entrySet()) {
PaytmUtility.debugLog(entry.getKey() + " = " + entry.getValue());
bundle.putString(entry.getKey(), entry.getValue());
}
}
PaytmUtility.debugLog("Starting the Service...");
Intent intent = new Intent(context, (Class<?>) PaytmPGActivity.class);
intent.putExtra("Parameters", bundle);
intent.putExtra("HIDE_HEADER", z);
intent.putExtra("SEND_ALL_CHECKSUM_RESPONSE_PARAMETERS_TO_PG_SERVER", z2);
this.mbServiceRunning = true;
this.mPaymentTransactionCallback = cVar;
((Activity) context).startActivity(intent);
PaytmUtility.debugLog("Service Started.");
}
} catch (Exception e2) {
stopService();
PaytmUtility.printStackTrace(e2);
}
} catch (Throwable th) {
throw th;
}
}
protected synchronized void stopService() {
mService = null;
PaytmUtility.debugLog("Service Stopped.");
}
}