正在查看: Chaupal v3.2 应用的 m.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Chaupal v3.2 应用的 m.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yupptv.ott.fragments;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.InputFilter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import androidx.appcompat.widget.AppCompatEditText;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.razorpay.R;
import com.yupptv.ott.OTTApplication;
import com.yupptv.ott.enums.ScreenType;
import com.yupptv.ottsdk.OttSDK;
import com.yupptv.ottsdk.managers.Payment.PaymentManager;
import com.yupptv.ottsdk.managers.Preferences.PreferenceManager;
import com.yupptv.ottsdk.managers.User.UserManager;
import com.yupptv.ottsdk.model.Error;
import com.yupptv.ottsdk.model.PackagePreInfo;
import com.yupptv.ottsdk.model.SignUPWithPaymentResponse;
import com.yupptv.ottsdk.model.payments.CCDetails;
import com.yupptv.ottsdk.model.payments.OrderIdResponse;
import com.yupptv.ottsdk.model.payments.OrderStatusResponse;
import com.yupptv.ottsdk.utils.OttLog;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;
public class m extends l {
private static final String T0 = m.class.getSimpleName();
AppCompatEditText A;
private TextView A0;
AppCompatEditText B;
private TextView B0;
private Spinner C;
private TextView C0;
private Spinner D;
private Activity E;
private View F;
private CheckBox F0;
private Resources G;
private OttSDK H;
RecyclerView H0;
private k I0;
private Bundle M;
private AppCompatButton R0;
private AppCompatButton S0;
private String W;
private ProgressBar Y;
private TextView f0;
private TextView g0;
private TextView h0;
private TextView i0;
private TextView j0;
private TextView k0;
private TextView l0;
private TextView m0;
private TextView n0;
private LinearLayout o0;
private LinearLayout p0;
private LinearLayout q0;
private LinearLayout r0;
private TextView t0;
private TextView u0;
private TextView v0;
private TextView w0;
private TextView x0;
AppCompatEditText y;
private TextView y0;
AppCompatEditText z;
private TextView z0;
public boolean I = false;
public boolean J = false;
private long K = 60000;
private long L = 0;
private String N = "";
private String O = "";
private String P = "";
private String Q = "";
private String R = "";
private String S = "";
private String T = "";
private String U = "";
private String V = "";
private Long X = 0L;
final Handler Z = new Handler();
private String e0 = "";
private String s0 = "";
private String D0 = "";
private String E0 = "";
private List<CCDetails> G0 = new ArrayList();
private int J0 = 0;
private String K0 = "";
private String L0 = "";
private String M0 = "";
private String N0 = "";
private final Runnable O0 = new b();
PaymentManager.PaymentCallback<OrderIdResponse> P0 = new c();
View.OnClickListener Q0 = new d();
class a implements AdapterView.OnItemSelectedListener {
a() {
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
m.this.D0 = (String) adapterView.getItemAtPosition(i);
TextView textView = (TextView) view;
if (i <= 0 || textView == null) {
m.this.n0.setVisibility(4);
} else {
textView.setTextColor(m.this.G.getColor(2131099844));
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
}
class b implements Runnable {
b() {
}
@Override
public void run() {
OttLog.error(m.T0, "checking order status " + m.this.L);
if (m.this.getActivity() == null) {
m mVar = m.this;
mVar.I = true;
mVar.J = false;
mVar.m1();
m.this.Z.removeCallbacks(this);
return;
}
m mVar2 = m.this;
if (!mVar2.I && mVar2.L < m.this.K) {
m mVar3 = m.this;
mVar3.k1(mVar3.e0);
m.this.L += 10000;
m.this.Z.postDelayed(this, 10000L);
return;
}
m mVar4 = m.this;
mVar4.I = false;
mVar4.J = true;
mVar4.Z.removeCallbacks(this);
if (m.this.L >= m.this.K) {
m mVar5 = m.this;
mVar5.I = true;
mVar5.J = false;
mVar5.m1();
if (m.this.getActivity() != null) {
Toast.makeText((Context) m.this.getActivity(), 2131952634, 1).show();
}
}
}
}
class c implements PaymentManager.PaymentCallback<OrderIdResponse> {
c() {
}
@Override
public void onSuccess(OrderIdResponse orderIdResponse) {
if (orderIdResponse != null) {
m.this.L0 = orderIdResponse.getTargetParams().getMsg1();
m.this.M0 = orderIdResponse.getTargetParams().getMsg2();
m.this.N0 = orderIdResponse.getTargetParams().getMsg3();
m.this.e0(orderIdResponse.getOrderId());
}
}
@Override
public void onFailure(Error error) {
m.this.m1();
m mVar = m.this;
mVar.J = false;
Toast.makeText((Context) mVar.getActivity(), (CharSequence) error.getMessage(), 1).show();
}
}
class d implements View.OnClickListener {
class a implements UserManager.UserCallback<SignUPWithPaymentResponse> {
a() {
}
@Override
public void onSuccess(SignUPWithPaymentResponse signUPWithPaymentResponse) {
m.this.m1();
m mVar = m.this;
mVar.J = false;
if (mVar.getActivity() == null || m.this.getActivity().isFinishing()) {
return;
}
m.this.t1(cc.c.h0, true, signUPWithPaymentResponse.getLoginResponse() == null ? "" : signUPWithPaymentResponse.getLoginResponse().getMessage(), cc.c.F1);
m.this.t1(cc.c.i0, true, signUPWithPaymentResponse.getLoginResponse() == null ? "" : signUPWithPaymentResponse.getLoginResponse().getMessage(), cc.c.G1);
m mVar2 = m.this;
mVar2.s1(cc.c.B0, mVar2.W, "", Boolean.TRUE);
Bundle bundle = new Bundle();
bundle.putBoolean("IS_PAYMENT_SUCCESS", true);
bundle.putString(hd.r.y0, m.this.T);
bundle.putString("PAYMENT_SUCCESS_MESSAGE1", signUPWithPaymentResponse.getMessage());
bundle.putString("PAYMENT_SUCCESS_MESSAGE2", signUPWithPaymentResponse.getSubscriptionMessage());
bundle.putString("PAYMENT_SUCCESS_MESSAGE3", signUPWithPaymentResponse.getFreeTrailMessage());
j1 j1Var = new j1();
j1Var.setArguments(bundle);
m.this.getActivity().getSupportFragmentManager().q().r(2131428566, j1Var, "paymentSuccess").j();
}
@Override
public void onFailure(Error error) {
m.this.m1();
m mVar = m.this;
mVar.J = false;
if (mVar.getActivity() == null || m.this.getActivity().isFinishing()) {
return;
}
m mVar2 = m.this;
mVar2.s1(cc.c.B0, mVar2.W, error.getMessage(), Boolean.FALSE);
Bundle bundle = new Bundle();
bundle.putBoolean("IS_PAYMENT_SUCCESS", false);
bundle.putString("PAYMENT_SUCCESS_MESSAGE1", error.getMessage());
bundle.putString("PAYMENT_SUCCESS_MESSAGE2", error.getDetails() != null ? error.getDetails().getDescription() : "");
j1 j1Var = new j1();
j1Var.setArguments(bundle);
m.this.getActivity().getSupportFragmentManager().q().r(2131428566, j1Var, "paymentSuccess").g("paymentSuccess").j();
}
}
class b implements PaymentManager.PaymentCallback<OrderIdResponse> {
b() {
}
@Override
public void onSuccess(OrderIdResponse orderIdResponse) {
m.this.p1(orderIdResponse);
}
@Override
public void onFailure(Error error) {
m.this.o1(error);
}
}
class c implements PaymentManager.PaymentCallback<OrderIdResponse> {
c() {
}
@Override
public void onSuccess(OrderIdResponse orderIdResponse) {
m.this.p1(orderIdResponse);
}
@Override
public void onFailure(Error error) {
m.this.o1(error);
}
}
d() {
}
@Override
public void onClick(View view) {
int id2 = view.getId();
if (id2 == 2131427451) {
hd.u.Y(m.this.getActivity(), ScreenType.ADD_NEWCARD, null);
return;
}
if (id2 != 2131427854) {
if (id2 != 2131429242) {
return;
}
hd.u.e0(m.this.getActivity(), hd.r.d1, null);
return;
}
if (m.this.getActivity() != null) {
m.this.getActivity().X();
m.this.getActivity().hideKeyBoard(m.this.F);
}
if (m.this.q0.getVisibility() != 0) {
if (m.this.J0 < 0) {
Toast.makeText((Context) m.this.getActivity(), (CharSequence) "Please select any of the above cards", 1).show();
return;
}
m.this.q1();
m.this.J = true;
JSONObject jSONObject = new JSONObject();
try {
Toast.makeText((Context) m.this.getActivity(), (CharSequence) m.this.getActivity().getResources().getString(2131952630), 1).show();
jSONObject.put("packages", m.this.N);
jSONObject.put("gateway", ((CCDetails) m.this.G0.get(m.this.J0)).getGateway());
jSONObject.put("userPaymentId", ((CCDetails) m.this.G0.get(m.this.J0)).getPaymentProfileInfoId().toString());
if (m.this.S.equalsIgnoreCase(hd.r.j0)) {
m.this.H.getPaymentManager().upgradePackage(jSONObject, m.this.P0);
} else {
m.this.H.getPaymentManager().changePackage(jSONObject, m.this.P0);
}
return;
} catch (Exception unused) {
return;
}
}
m.this.f0.setVisibility(8);
m.this.g0.setVisibility(8);
m.this.h0.setVisibility(8);
m.this.l0.setVisibility(8);
m.this.i0.setVisibility(8);
m.this.j0.setVisibility(8);
String str = m.this.D0 + m.this.E0.substring(2, 4);
if (m.this.y.getText().toString().trim().length() == 0) {
m.this.y.requestFocus();
m.this.f0.setVisibility(0);
m.this.f0.setText(m.this.G.getString(2131952081));
return;
}
if (m.this.z.getText().length() == 0) {
m.this.z.requestFocus();
m.this.g0.setVisibility(0);
m.this.g0.setText(m.this.G.getString(2131952082));
return;
}
if (m.this.D0.length() > 2) {
m.this.D.requestFocus();
m.this.h0.setVisibility(0);
m.this.h0.setText(m.this.G.getString(2131952080));
return;
}
if (m.this.E0.length() > 4) {
m.this.C.requestFocus();
m.this.l0.setVisibility(0);
m.this.l0.setText(m.this.G.getString(2131952078));
return;
}
String sb2 = new StringBuilder(str).insert(2, '/').toString();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/yy");
simpleDateFormat.setLenient(false);
try {
if (simpleDateFormat.parse(sb2).before(new Date())) {
m.this.h0.setVisibility(0);
m.this.h0.setText(m.this.G.getString(2131952080));
return;
}
String trim = m.this.A.getText().toString().trim();
if (trim.length() == 0 || trim.length() < 3 || trim.equalsIgnoreCase("000") || trim.equalsIgnoreCase("0000")) {
m.this.A.requestFocus();
m.this.i0.setVisibility(0);
m.this.i0.setText(m.this.G.getString(2131952077));
return;
}
if (m.this.Q != null && !m.this.Q.equalsIgnoreCase(hd.r.E) && m.this.B.getText().length() == 0) {
m.this.B.requestFocus();
m.this.j0.setVisibility(0);
m.this.j0.setText(m.this.G.getString(2131952058));
return;
}
if (m.this.z.getText().length() == 0 || m.this.A.getText().length() == 0) {
Toast.makeText((Context) m.this.getActivity(), 2131952327, 1).show();
return;
}
OttLog.error("card no: ", "" + Long.parseLong(m.this.z.getText().toString()));
Integer.parseInt(m.this.A.getText().toString());
m.this.q1();
m.this.J = true;
JSONObject jSONObject2 = new JSONObject();
PreferenceManager g = hd.a.a.g(OTTApplication.o());
try {
jSONObject2.put("packages", m.this.N);
jSONObject2.put("gateway", m.this.Q);
jSONObject2.put("cvv", m.this.A.getText());
jSONObject2.put("card_number", m.this.z.getText());
jSONObject2.put("expiration_date", sb2);
jSONObject2.put("currency", m.this.s0);
jSONObject2.put("line1", "address");
jSONObject2.put("address", "address");
m mVar = m.this;
jSONObject2.put("card_type", mVar.j1(mVar.z.getText().toString()));
jSONObject2.put("first_name", m.this.y.getText());
jSONObject2.put("last_name", m.this.y.getText());
if (m.this.Q.equalsIgnoreCase(hd.r.E)) {
jSONObject2.put("transaction_type", "3dsecure");
}
if (m.this.Q.equalsIgnoreCase(hd.r.F)) {
jSONObject2.put("zip_code", m.this.B.getText());
} else {
jSONObject2.put("postal_code", m.this.B.getText());
}
jSONObject2.put("remember", "true");
if (g.getIpInfo() != null && g.getIpInfo().getCountryCode() != null && !g.getIpInfo().getCountryCode().isEmpty()) {
jSONObject2.put("country", g.getIpInfo().getCountryCode());
}
if (g.getIpInfo() != null && g.getIpInfo().getCity() != null && !g.getIpInfo().getCity().isEmpty()) {
jSONObject2.put("city", g.getIpInfo().getCity());
}
if (g.getIpInfo() != null && g.getIpInfo().getRegion() != null && !g.getIpInfo().getRegion().isEmpty()) {
jSONObject2.put("state", g.getIpInfo().getRegion());
}
} catch (JSONException unused2) {
}
if (g.getLoggedUser() == null && hd.e0.m > 0) {
hd.a.a.b(OTTApplication.o()).getUserManager().signupWithPaymentComplete(hd.e0.m, null, jSONObject2, new a());
return;
}
if (m.this.Q.equalsIgnoreCase(hd.r.F)) {
if (m.this.S.equalsIgnoreCase(hd.r.j0)) {
m.this.H.getPaymentManager().upgradePackage(jSONObject2, m.this.P0);
return;
} else {
m.this.H.getPaymentManager().changePackage(jSONObject2, m.this.P0);
return;
}
}
if (hd.a.a.b(OTTApplication.o()) == null || g.getSystemFeaturesData() == null || g.getSystemFeaturesData().getSystemFeatures() == null || g.getSystemFeaturesData().getSystemFeatures().getEncryptApisList() == null || g.getSystemFeaturesData().getSystemFeatures().getEncryptApisList().getFields() == null || g.getSystemFeaturesData().getSystemFeatures().getEncryptApisList().getFields().getPayment() == null || !g.getSystemFeaturesData().getSystemFeatures().getEncryptApisList().getFields().getPayment().equalsIgnoreCase("true")) {
m.this.H.getPaymentManager().getOrderId(jSONObject2, new c());
} else {
m.this.H.getPaymentManager().getOrderIdEnc(jSONObject2, new b());
}
} catch (ParseException unused3) {
m.this.h0.setVisibility(0);
m.this.h0.setText(m.this.G.getString(2131952080));
}
}
}
class e implements PaymentManager.PaymentCallback<OrderStatusResponse> {
e() {
}
@Override
public void onSuccess(OrderStatusResponse orderStatusResponse) {
Bundle bundle;
if (m.this.getActivity() == null) {
m mVar = m.this;
mVar.I = true;
mVar.J = false;
mVar.m1();
m mVar2 = m.this;
mVar2.Z.removeCallbacks(mVar2.O0);
}
bundle = new Bundle();
String upperCase = orderStatusResponse.getStatus().toUpperCase();
upperCase.hashCode();
switch (upperCase) {
case "F":
m.this.m1();
m mVar3 = m.this;
mVar3.I = true;
mVar3.J = false;
Handler handler = mVar3.Z;
if (handler != null) {
handler.removeCallbacks(mVar3.O0);
}
m mVar4 = m.this;
mVar4.s1(cc.c.B0, mVar4.W, orderStatusResponse.getMessage(), Boolean.FALSE);
bundle.putBoolean("IS_PAYMENT_SUCCESS", false);
bundle.putString("PAYMENT_SUCCESS_MESSAGE1", orderStatusResponse.getMessage());
bundle.putString("PAYMENT_SUCCESS_MESSAGE2", "");
j1 j1Var = new j1();
j1Var.setArguments(bundle);
if (m.this.getActivity() != null) {
m.this.getActivity().getSupportFragmentManager().q().r(2131428566, j1Var, "paymentSuccess").g("paymentSuccess").j();
break;
}
break;
case "P":
m.this.m1();
m mVar5 = m.this;
mVar5.I = false;
mVar5.J = true;
Toast.makeText((Context) mVar5.getActivity(), (CharSequence) orderStatusResponse.getMessage(), 0).show();
break;
case "S":
m.this.m1();
m mVar6 = m.this;
mVar6.I = true;
mVar6.J = false;
Handler handler2 = mVar6.Z;
if (handler2 != null) {
handler2.removeCallbacks(mVar6.O0);
}
m mVar7 = m.this;
mVar7.s1(cc.c.B0, mVar7.W, "", Boolean.TRUE);
bundle.putBoolean("IS_PAYMENT_SUCCESS", true);
bundle.putString(hd.r.y0, m.this.T);
bundle.putString("PAYMENT_SUCCESS_MESSAGE1", m.this.L0);
bundle.putString("PAYMENT_SUCCESS_MESSAGE2", m.this.M0);
bundle.putString("PAYMENT_SUCCESS_MESSAGE3", m.this.N0);
j1 j1Var2 = new j1();
j1Var2.setArguments(bundle);
if (m.this.getActivity() != null) {
m.this.getActivity().getSupportFragmentManager().q().r(2131428566, j1Var2, "paymentSuccess").j();
break;
}
break;
}
}
@Override
public void onFailure(Error error) {
m.this.m1();
m mVar = m.this;
mVar.J = false;
mVar.I = true;
if (mVar.getActivity() == null) {
m mVar2 = m.this;
mVar2.I = true;
mVar2.m1();
m mVar3 = m.this;
mVar3.Z.removeCallbacks(mVar3.O0);
return;
}
m mVar4 = m.this;
mVar4.s1(cc.c.B0, mVar4.W, error.getMessage(), Boolean.FALSE);
Bundle bundle = new Bundle();
bundle.putBoolean("IS_PAYMENT_SUCCESS", false);
bundle.putString("PAYMENT_SUCCESS_MESSAGE1", error.getMessage());
bundle.putString("PAYMENT_SUCCESS_MESSAGE2", error.getDetails() != null ? error.getDetails().getDescription() : "");
j1 j1Var = new j1();
j1Var.setArguments(bundle);
if (m.this.getActivity() != null) {
m.this.getActivity().getSupportFragmentManager().q().r(2131428566, j1Var, "paymentSuccess").g("paymentSuccess").j();
}
}
}
class f implements PaymentManager.PaymentCallback<PackagePreInfo> {
f() {
}
@Override
public void onSuccess(PackagePreInfo packagePreInfo) {
if (packagePreInfo != null) {
if (packagePreInfo.getNextBillingDate() != null && packagePreInfo.getNextBillingDate().trim().length() > 0) {
m.this.y0.setText(m.this.getString(2131952994));
m.this.z0.setText(packagePreInfo.getNextBillingDate());
} else if (packagePreInfo.getRefundAmount() != null) {
m.this.y0.setText(m.this.getString(2131952709));
m.this.z0.setText("$" + packagePreInfo.getRefundAmount());
} else {
m.this.y0.setVisibility(8);
}
if (packagePreInfo.getMessage() == null || packagePreInfo.getMessage().trim().length() <= 0) {
m.this.B0.setVisibility(8);
} else {
m.this.B0.setText(packagePreInfo.getMessage());
m.this.B0.setVisibility(0);
}
}
}
@Override
public void onFailure(Error error) {
m.this.B0.setVisibility(8);
if (m.this.X.longValue() <= 0) {
m.this.z0.setVisibility(8);
m.this.y0.setVisibility(8);
return;
}
m.this.z0.setText(hd.j.b("" + m.this.X, "dd MMMM, yyyy"));
m.this.y0.setText(m.this.getString(2131952994));
m.this.z0.setVisibility(0);
m.this.y0.setVisibility(0);
}
}
class g implements PaymentManager.PaymentCallback<List<CCDetails>> {
g() {
}
@Override
public void onSuccess(List<CCDetails> list) {
m.this.b0(false);
if (list == null || list.size() == 0) {
m.this.q0.setVisibility(0);
m.this.r0.setVisibility(8);
m.this.S0.setVisibility(8);
return;
}
if (m.this.G0 != null) {
m.this.G0.clear();
}
if (m.this.G0 == null) {
m.this.G0 = new ArrayList();
}
m.this.G0.addAll(list);
m.this.q0.setVisibility(8);
m.this.r0.setVisibility(8);
m.this.S0.setVisibility(0);
m.this.p0.setVisibility(0);
m.this.H0.setVisibility(0);
m mVar = m.this;
mVar.H0.setLayoutManager(new LinearLayoutManager(mVar.getContext(), 1, false));
m.this.H0.setHasFixedSize(true);
m mVar2 = m.this;
mVar2.I0 = new k(mVar2, null);
m mVar3 = m.this;
mVar3.H0.setAdapter(mVar3.I0);
}
@Override
public void onFailure(Error error) {
m.this.b0(false);
m.this.q0.setVisibility(0);
m.this.r0.setVisibility(8);
m.this.S0.setVisibility(8);
}
}
class h extends ArrayAdapter<String> {
final Spinner a;
h(Context context, int i, List list, Spinner spinner) {
super(context, i, list);
this.a = spinner;
}
@Override
public View getDropDownView(int i, View view, @NonNull ViewGroup viewGroup) {
if (m.this.getActivity() != null) {
m.this.getActivity().hideKeyBoard(m.this.F);
}
this.a.requestFocus();
this.a.setFocusable(true);
this.a.setFocusableInTouchMode(true);
m.this.m0.setVisibility(0);
View dropDownView = super.getDropDownView(i, view, viewGroup);
((TextView) dropDownView).setBackgroundColor(m.this.getActivity().getResources().getColor(2131100417));
return dropDownView;
}
}
class i implements AdapterView.OnItemSelectedListener {
i() {
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
m.this.E0 = (String) adapterView.getItemAtPosition(i);
TextView textView = (TextView) view;
if (i <= 0 || textView == null) {
m.this.m0.setVisibility(4);
} else {
textView.setTextColor(m.this.G.getColor(2131099844));
}
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
}
class j extends ArrayAdapter<String> {
final Spinner a;
j(Context context, int i, List list, Spinner spinner) {
super(context, i, list);
this.a = spinner;
}
@Override
public View getDropDownView(int i, View view, @NonNull ViewGroup viewGroup) {
if (m.this.getActivity() != null) {
m.this.getActivity().hideKeyBoard(m.this.F);
}
this.a.requestFocus();
this.a.setFocusable(true);
this.a.setFocusableInTouchMode(true);
m.this.n0.setVisibility(0);
View dropDownView = super.getDropDownView(i, view, viewGroup);
((TextView) dropDownView).setBackgroundColor(m.this.getActivity().getResources().getColor(2131100417));
return dropDownView;
}
}
private class k extends RecyclerView.Adapter<a> {
class a extends RecyclerView.c0 {
private ImageView a;
private ImageView b;
private TextView c;
private AppCompatButton d;
private RelativeLayout e;
class ViewOnClickListenerC0065a implements View.OnClickListener {
final k a;
ViewOnClickListenerC0065a(k kVar) {
this.a = kVar;
}
@Override
public void onClick(View view) {
a aVar = a.this;
m.this.J0 = aVar.getAdapterPosition();
k.this.notifyDataSetChanged();
}
}
class b implements View.OnClickListener {
final k a;
class C0066a implements PaymentManager.PaymentCallback<OrderIdResponse> {
C0066a() {
}
@Override
public void onSuccess(OrderIdResponse orderIdResponse) {
if (orderIdResponse != null) {
m.this.e0(orderIdResponse.getOrderId());
}
}
@Override
public void onFailure(Error error) {
m.this.m1();
if (m.this.getActivity() == null || m.this.getActivity().isFinishing() || error == null) {
return;
}
Toast.makeText((Context) m.this.getActivity(), (CharSequence) error.getMessage(), 1).show();
}
}
b(k kVar) {
this.a = kVar;
}
@Override
public void onClick(View view) {
JSONObject jSONObject = new JSONObject();
try {
Toast.makeText((Context) m.this.getActivity(), (CharSequence) m.this.getActivity().getResources().getString(2131952630), 1).show();
jSONObject.put("packages", m.this.N);
jSONObject.put("gateway", ((CCDetails) m.this.G0.get(m.this.J0)).getGateway());
jSONObject.put("userPaymentId", ((CCDetails) m.this.G0.get(m.this.J0)).getPaymentProfileInfoId().toString());
m.this.H.getPaymentManager().getEncryptedOrderId(jSONObject, new C0066a());
} catch (Exception unused) {
}
}
}
public a(View view) {
super(view);
view.setOnClickListener(new ViewOnClickListenerC0065a(k.this));
this.e = (RelativeLayout) view.findViewById(2131429414);
this.b = (ImageView) view.findViewById(2131429413);
this.a = (ImageView) view.findViewById(2131429296);
this.c = (TextView) view.findViewById(2131429416);
AppCompatButton findViewById = view.findViewById(2131429106);
this.d = findViewById;
findViewById.setOnClickListener(new b(k.this));
}
}
private k() {
}
public void onBindViewHolder(a aVar, int i) {
String partialCreditCard = ((CCDetails) m.this.G0.get(i)).getPartialCreditCard();
if (partialCreditCard.contains("XXXX")) {
partialCreditCard = partialCreditCard.replace("XXXX", "XXXX - XXXX - XXXX - ");
}
aVar.c.setText(partialCreditCard);
com.bumptech.glide.b.u(aVar.e.getContext()).u(m.this.K0 + ((CCDetails) m.this.G0.get(i)).getCardType() + ".png").b0(2131231140).P0(y2.d.i()).j(2131231140).F0(aVar.b);
if (i == m.this.J0) {
aVar.e.setBackground(m.this.getResources().getDrawable(2131232534));
aVar.a.setImageResource(2131231567);
} else {
aVar.e.setBackground(m.this.getResources().getDrawable(2131232533));
aVar.a.setImageResource(2131231564);
}
}
public a onCreateViewHolder(ViewGroup viewGroup, int i) {
View inflate = LayoutInflater.from(viewGroup.getContext()).inflate(2131624420, viewGroup, false);
inflate.setFocusableInTouchMode(false);
inflate.setFocusable(false);
return new a(inflate);
}
public int getItemCount() {
if (m.this.G0 == null) {
return 0;
}
return m.this.G0.size();
}
k(m mVar, b bVar) {
this();
}
}
public String j1(String str) {
if (str != null && str.length() >= 13) {
String substring = str.substring(0, 4);
if (Pattern.compile("^4.*").matcher(substring).matches()) {
return "visa";
}
if (Pattern.compile("^5[1-5].*").matcher(substring).matches()) {
return "mastercard";
}
if (Pattern.compile("^3[47].*").matcher(substring).matches()) {
return "amex";
}
if (Pattern.compile("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65).*").matcher(substring).matches()) {
return "discover";
}
if (Pattern.compile("^36.*").matcher(substring).matches()) {
return "diners";
}
if (Pattern.compile("^30[0-5].*").matcher(substring).matches()) {
return "diners - darte blanche";
}
if (Pattern.compile("^35(2[89]|[3-8][0-9]).*").matcher(substring).matches()) {
return "jcb";
}
if (Pattern.compile("^(4026|417500|4508|4844|491(3|7)).*").matcher(substring).matches()) {
return "visa electron";
}
}
return "";
}
public void k1(String str) {
hd.a.a.b(OTTApplication.o()).getPaymentManager().getOrderStatus(str, new e());
}
private String l1(String str) {
str.hashCode();
switch (str) {
case "D":
case "d":
return getString(2131951973);
case "M":
case "m":
return getString(2131952404);
case "W":
case "w":
return getString(2131952993);
case "Y":
case "y":
return getString(2131952997);
case "HY":
case "Hy":
case "hy":
return getString(2131952280);
default:
return str;
}
}
public void o1(Error error) {
m1();
this.J = false;
Toast.makeText((Context) getActivity(), (CharSequence) error.getMessage(), 1).show();
}
public void p1(OrderIdResponse orderIdResponse) {
if (orderIdResponse != null) {
if (!this.Q.equalsIgnoreCase(hd.r.E)) {
if (this.Q.equalsIgnoreCase(hd.r.H)) {
e0(orderIdResponse.getOrderId());
return;
}
return;
}
if (orderIdResponse.getTargetParams() == null || orderIdResponse.getTargetParams().getAcsUrl() == null || orderIdResponse.getTargetParams().getAcsUrl().length() <= 0) {
e0(orderIdResponse.getOrderId());
return;
}
m1();
getActivity().a0();
String str = "http://viusasa-web-888884590.eu-central-1.elb.amazonaws.com/iveri-payment.html?acs_url=" + orderIdResponse.getTargetParams().getAcsUrl() + "&pareq=" + orderIdResponse.getTargetParams().getPAReq() + "&md=" + orderIdResponse.getTargetParams().getRequestId() + "&term_url=" + orderIdResponse.getTargetParams().getTermUrl();
hd.h.b(T0, "redirection url : " + str);
hd.u.i0(getActivity(), orderIdResponse.getOrderId(), str, this.Q, this);
}
}
private void r1(String str) {
try {
cc.d.d().f(str);
} catch (NullPointerException unused) {
}
}
public void s1(String str, String str2, String str3, Boolean bool) {
try {
HashMap hashMap = new HashMap();
if (str2 != null && str2.trim().length() > 0) {
hashMap.put(cc.c.J0, str2);
}
hd.h.b("TAG", "#ATTRIBUTE_PACKAGE_NAME : " + str2);
if (str3 != null && str3.trim().length() > 0) {
hashMap.put(cc.c.E0, str3);
}
hashMap.put(cc.c.O0, l1(this.V));
hashMap.put(cc.c.K0, this.U);
hashMap.put(cc.c.M0, this.S);
hashMap.put(cc.c.N0, this.Q);
if (bool != null) {
hashMap.put(cc.c.P0, bool.booleanValue() ? cc.c.a1 : cc.c.b1);
}
cc.c.d().m(ScreenType.PAYMENTS, null, null, null, str, cc.c.M1, hashMap);
} catch (NullPointerException unused) {
}
}
public void t1(String str, boolean z, String str2, String str3) {
try {
HashMap hashMap = new HashMap();
try {
hashMap.put(cc.c.E0, str2);
hd.h.b("TAG", "#ATTRIBUTE_REASON : " + str2);
} catch (Exception unused) {
}
hd.h.b("SIGNUP_EVENTS", "" + str + " " + str2 + " " + str3);
cc.c.d().m(ScreenType.SIGNUP, null, null, null, str, str3, hashMap);
} catch (Exception unused2) {
}
}
public void e0(String str) {
if (str == null || str.length() < 1) {
return;
}
this.L = 0L;
this.I = false;
this.e0 = str;
this.Z.postDelayed(this.O0, 1000L);
}
public void m1() {
ProgressBar progressBar = this.Y;
if (progressBar != null) {
progressBar.setVisibility(8);
if (getActivity() == null || getActivity().isFinishing() || getActivity() == null) {
return;
}
getActivity().b0(false);
}
}
void n1() {
this.t0 = (TextView) this.F.findViewById(2131428368);
this.u0 = (TextView) this.F.findViewById(2131428361);
this.o0 = (LinearLayout) this.F.findViewById(2131429109);
this.q0 = (LinearLayout) this.F.findViewById(2131428922);
this.r0 = (LinearLayout) this.F.findViewById(2131429410);
this.Y = (ProgressBar) this.F.findViewById(R.id.progressBar);
this.y = this.F.findViewById(2131428881);
this.z = this.F.findViewById(2131427694);
this.D = (Spinner) this.F.findViewById(2131427687);
this.A = this.F.findViewById(2131427931);
this.C = (Spinner) this.F.findViewById(2131427691);
this.B = this.F.findViewById(2131430018);
this.k0 = (TextView) this.F.findViewById(2131430020);
this.v0 = (TextView) this.F.findViewById(2131429631);
this.w0 = (TextView) this.F.findViewById(2131429031);
this.x0 = (TextView) this.F.findViewById(2131429032);
this.A0 = (TextView) this.F.findViewById(2131429702);
String salesTaxText = hd.a.a.c(OTTApplication.o()).getSalesTaxText();
if (salesTaxText == null || salesTaxText.trim().length() <= 0) {
this.A0.setVisibility(8);
} else {
this.A0.setText(salesTaxText);
this.A0.setVisibility(0);
}
this.y0 = (TextView) this.F.findViewById(2131428299);
this.z0 = (TextView) this.F.findViewById(2131428298);
this.B0 = (TextView) this.F.findViewById(2131429009);
this.C0 = (TextView) this.F.findViewById(2131429715);
this.j0 = (TextView) this.F.findViewById(2131430019);
this.n0 = (TextView) this.F.findViewById(2131427688);
this.m0 = (TextView) this.F.findViewById(2131427692);
this.f0 = (TextView) this.F.findViewById(2131427705);
this.g0 = (TextView) this.F.findViewById(2131427695);
this.h0 = (TextView) this.F.findViewById(2131427686);
this.l0 = (TextView) this.F.findViewById(2131427690);
this.F0 = (CheckBox) this.F.findViewById(2131427755);
RecyclerView findViewById = this.F.findViewById(2131429418);
this.H0 = findViewById;
if (findViewById != null) {
findViewById.setVisibility(8);
}
LinearLayout linearLayout = (LinearLayout) this.F.findViewById(2131429415);
this.p0 = linearLayout;
linearLayout.setVisibility(8);
this.i0 = (TextView) this.F.findViewById(2131427684);
this.R0 = this.F.findViewById(2131427854);
this.S0 = this.F.findViewById(2131427451);
this.R0.setOnClickListener(this.Q0);
this.S0.setOnClickListener(this.Q0);
this.w0.setText(this.O + " Plan");
if (this.P.equalsIgnoreCase("M")) {
this.x0.setText("$" + this.R + "/month");
} else {
this.x0.setText(this.R + "/annual");
}
if (this.H == null) {
this.H = OttSDK.getNewInstance(getActivity(), hd.e.z);
}
if (this.H != null) {
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("gateway", this.Q);
jSONObject.put("packages", this.N);
} catch (JSONException unused) {
}
this.H.getPaymentManager().getPackagePreInfo(jSONObject, new f());
b0(true);
this.H.getPaymentManager().getCCDetails("braintree", new g());
}
ArrayList arrayList = new ArrayList();
arrayList.add("Expiry Year");
int i2 = Calendar.getInstance().get(1);
for (int i3 = i2; i3 <= i2 + 100; i3++) {
arrayList.add(Integer.toString(i3));
}
Spinner spinner = (Spinner) this.F.findViewById(2131427691);
h hVar = new h(getActivity(), 2131624454, arrayList, spinner);
spinner.setPrompt("Expiry Year");
hVar.setDropDownViewResource(2131624454);
spinner.setAdapter((SpinnerAdapter) hVar);
spinner.setOnItemSelectedListener(new i());
ArrayList arrayList2 = new ArrayList();
Spinner spinner2 = (Spinner) this.F.findViewById(2131427687);
arrayList2.add("Expiry Month");
for (int i4 = 1; i4 <= 12; i4++) {
if (i4 < 10) {
arrayList2.add("0" + i4);
} else {
arrayList2.add(String.valueOf(i4));
}
}
j jVar = new j(getActivity(), 2131624454, arrayList2, spinner2);
spinner2.setPrompt("Expiry Month");
jVar.setDropDownViewResource(2131624454);
spinner2.setAdapter((SpinnerAdapter) jVar);
spinner2.setOnItemSelectedListener(new a());
}
public void onActivityResult(int i2, int i3, Intent intent) {
super.onActivityResult(i2, i3, intent);
}
public void onAttach(Context context) {
super.onAttach(context);
this.E = getActivity();
this.G = context.getResources();
this.H = hd.a.a.b(OTTApplication.o());
}
public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
super.onCreateView(layoutInflater, viewGroup, bundle);
this.F = layoutInflater.inflate(2131624146, (ViewGroup) null);
this.M = getArguments();
this.K0 = hd.a.a.c(OTTApplication.o()).getSavedCardsImagePath();
Bundle bundle2 = this.M;
if (bundle2 != null) {
this.N = bundle2.getString(hd.r.Q);
this.O = this.M.getString(hd.r.V);
this.P = this.M.getString(hd.r.Y);
this.Q = this.M.getString(hd.r.S);
if (this.M.containsKey(hd.r.i0)) {
this.S = this.M.getString(hd.r.i0);
}
if (this.M.containsKey(hd.r.c0)) {
this.X = Long.valueOf(this.M.getLong(hd.r.c0));
}
if (this.M.containsKey(hd.r.y0)) {
this.T = this.M.getString(hd.r.y0);
}
if (this.M.containsKey(hd.r.X)) {
this.s0 = this.M.getString(hd.r.X);
}
if (this.M.containsKey(hd.r.U)) {
this.R = String.valueOf(this.M.getDouble(hd.r.U));
}
if (this.M.containsKey(hd.r.V)) {
this.W = this.M.getString(hd.r.V);
}
if (this.M.containsKey(hd.r.Z)) {
this.U = this.M.getString(hd.r.Z);
}
if (this.M.containsKey(hd.r.Y)) {
this.V = this.M.getString(hd.r.Y);
}
}
n1();
String str = this.Q;
if (str != null && str.equalsIgnoreCase(hd.r.E)) {
AppCompatEditText appCompatEditText = this.A;
if (appCompatEditText != null) {
appCompatEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(3)});
}
this.j0.setVisibility(8);
this.B.setVisibility(8);
this.k0.setVisibility(8);
if (Build.VERSION.SDK_INT < 21) {
this.o0.setVisibility(8);
}
}
r1(cc.d.d0);
return this.F;
}
public void onDestroy() {
super.onDestroy();
Handler handler = this.Z;
if (handler != null) {
handler.removeCallbacks(this.O0);
}
}
public void onResume() {
super.onResume();
getActivity().getSupportActionBar().E();
}
public void q1() {
ProgressBar progressBar = this.Y;
if (progressBar != null) {
progressBar.setVisibility(0);
if (getActivity() != null) {
getActivity().b0(true);
}
}
}
}