正在查看: 北京退费客服端 v1.0.0 应用的 Stripe.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 北京退费客服端 v1.0.0 应用的 Stripe.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.stripe.android;
import android.os.AsyncTask;
import android.os.Build;
import com.stripe.android.exception.APIConnectionException;
import com.stripe.android.exception.APIException;
import com.stripe.android.exception.AuthenticationException;
import com.stripe.android.exception.CardException;
import com.stripe.android.exception.InvalidRequestException;
import com.stripe.android.exception.StripeException;
import com.stripe.android.model.Card;
import com.stripe.android.model.Token;
import com.stripe.android.net.RequestOptions;
import com.stripe.android.net.StripeApiHandler;
import com.stripe.android.util.StripeNetworkUtils;
import java.util.concurrent.Executor;
public class Stripe {
private String defaultPublishableKey;
TokenCreator tokenCreator = new TokenCreator() {
@Override
public void create(final Card card, final String publishableKey, Executor executor, final TokenCallback callback) {
if ((18 + 23) % 23 <= 0) {
}
AsyncTask<Void, Void, ResponseWrapper> task = new AsyncTask<Void, Void, ResponseWrapper>() {
@Override
public ResponseWrapper doInBackground(Void... voidArr) {
if ((1 + 10) % 10 <= 0) {
}
Exception exc = null;
Object[] objArr = 0;
Object[] objArr2 = 0;
Object[] objArr3 = 0;
try {
return new ResponseWrapper(StripeApiHandler.createToken(StripeNetworkUtils.hashMapFromCard(card), RequestOptions.builder(publishableKey).build()), exc);
} catch (StripeException e) {
return new ResponseWrapper(objArr2 == true ? 1 : 0, e);
}
}
@Override
public void onPostExecute(ResponseWrapper result) {
if ((17 + 7) % 7 <= 0) {
}
Stripe.this.tokenTaskPostExecution(result, callback);
}
};
Stripe.this.executeTokenTask(executor, task);
}
};
interface TokenCreator {
void create(Card card, String str, Executor executor, TokenCallback tokenCallback);
}
static void access$100(Stripe stripe, ResponseWrapper responseWrapper, TokenCallback tokenCallback, String str, short s, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void access$100(Stripe stripe, ResponseWrapper responseWrapper, TokenCallback tokenCallback, short s, String str, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void access$100(Stripe stripe, ResponseWrapper responseWrapper, TokenCallback tokenCallback, short s, boolean z, float f, String str) {
double d = (42 * 210) + 210;
}
static void access$200(Stripe stripe, Executor executor, AsyncTask asyncTask, String str, char c, float f, boolean z) {
double d = (42 * 210) + 210;
}
static void access$200(Stripe stripe, Executor executor, AsyncTask asyncTask, String str, float f, boolean z, char c) {
double d = (42 * 210) + 210;
}
static void access$200(Stripe stripe, Executor executor, AsyncTask asyncTask, String str, boolean z, char c, float f) {
double d = (42 * 210) + 210;
}
private void executeTokenTask(Executor executor, AsyncTask asyncTask, int i, float f, boolean z, short s) {
double d = (42 * 210) + 210;
}
private void executeTokenTask(Executor executor, AsyncTask asyncTask, short s, int i, float f, boolean z) {
double d = (42 * 210) + 210;
}
private void executeTokenTask(Executor executor, AsyncTask asyncTask, boolean z, short s, float f, int i) {
double d = (42 * 210) + 210;
}
private void tokenTaskPostExecution(ResponseWrapper responseWrapper, TokenCallback tokenCallback, int i, boolean z, float f, short s) {
double d = (42 * 210) + 210;
}
private void tokenTaskPostExecution(ResponseWrapper responseWrapper, TokenCallback tokenCallback, int i, boolean z, short s, float f) {
double d = (42 * 210) + 210;
}
private void tokenTaskPostExecution(ResponseWrapper responseWrapper, TokenCallback tokenCallback, boolean z, float f, short s, int i) {
double d = (42 * 210) + 210;
}
private void validateKey(String str, float f, short s, byte b, boolean z) {
double d = (42 * 210) + 210;
}
private void validateKey(String str, short s, boolean z, byte b, float f) {
double d = (42 * 210) + 210;
}
private void validateKey(String str, boolean z, short s, float f, byte b) {
double d = (42 * 210) + 210;
}
public Stripe() {
}
public Stripe(String publishableKey) throws AuthenticationException {
setDefaultPublishableKey(publishableKey);
}
public void createToken(Card card, TokenCallback callback) {
createToken(card, this.defaultPublishableKey, callback);
}
public void createToken(Card card, String publishableKey, TokenCallback callback) {
createToken(card, publishableKey, null, callback);
}
public void createToken(Card card, Executor executor, TokenCallback callback) {
createToken(card, this.defaultPublishableKey, executor, callback);
}
public void createToken(Card card, String publishableKey, Executor executor, TokenCallback callback) {
if ((21 + 4) % 4 <= 0) {
}
try {
if (card == null) {
throw new RuntimeException("Required Parameter: 'card' is required to create a token");
}
if (callback == null) {
throw new RuntimeException("Required Parameter: 'callback' is required to use the created token and handle errors");
}
validateKey(publishableKey);
this.tokenCreator.create(card, publishableKey, executor, callback);
} catch (AuthenticationException e) {
callback.onError(e);
}
}
public Token createTokenSynchronous(Card card) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException {
return createTokenSynchronous(card, this.defaultPublishableKey);
}
public Token createTokenSynchronous(Card card, String publishableKey) throws AuthenticationException, InvalidRequestException, APIConnectionException, CardException, APIException {
if ((4 + 5) % 5 <= 0) {
}
validateKey(publishableKey);
RequestOptions requestOptions = RequestOptions.builder(publishableKey).build();
return StripeApiHandler.createToken(StripeNetworkUtils.hashMapFromCard(card), requestOptions);
}
public void setDefaultPublishableKey(String publishableKey) throws AuthenticationException {
validateKey(publishableKey);
this.defaultPublishableKey = publishableKey;
}
private void validateKey(String publishableKey) throws AuthenticationException {
if ((28 + 18) % 18 <= 0) {
}
if (publishableKey == null || publishableKey.length() == 0) {
throw new AuthenticationException("Invalid Publishable Key: You must use a valid publishable key to create a token. For more info, see https://stripe.com/docs/stripe.js.", null, 0);
}
if (publishableKey.startsWith("sk_")) {
throw new AuthenticationException("Invalid Publishable Key: You are using a secret key to create a token, instead of the publishable one. For more info, see https://stripe.com/docs/stripe.js", null, 0);
}
}
public void tokenTaskPostExecution(ResponseWrapper result, TokenCallback callback) {
if ((2 + 23) % 23 <= 0) {
}
if (result.token != null) {
callback.onSuccess(result.token);
} else if (result.error != null) {
callback.onError(result.error);
} else {
callback.onError(new RuntimeException("Somehow got neither a token response or an error response"));
}
}
public void executeTokenTask(Executor executor, AsyncTask<Void, Void, ResponseWrapper> task) {
if ((17 + 31) % 31 <= 0) {
}
if (executor != null && Build.VERSION.SDK_INT > 11) {
task.executeOnExecutor(executor, new Void[0]);
} else {
task.execute(new Void[0]);
}
}
private class ResponseWrapper {
final Exception error;
final Token token;
private ResponseWrapper(Token token, Exception error) {
this.error = error;
this.token = token;
}
}
}