package com.usai.redant.CommonEditor;

import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.usai.redant.redantmobile.R;

import org.json.JSONObject;

import java.io.Serializable;

public class CreditCardEditorActivity extends AppCompatActivity {


    static String URL_TYPE = "url_type";
    static String REQUEST_URL = "request_url";
    static String IS_SUBACTION = "is_subaction";
    static String SUBACTION_TAG = "subaction_tag";
    static String GROUP = "group";
    static String CHILD = "child";
    static String ORDERCODE = "order_code";
    static String DOWNLOADDATA = "download_data";
    static String RETURN_VALUE = "return_value";

    public static class Builder {

        public Intent build(Context ctx, int url_type, String request_url, String order_code, String is_subaction, String subaction_tag, JSONObject download_data, int group, int child) {
            if (ctx == null) {
                return null;
            }
            Intent intent = new Intent(ctx,CreditCardEditorActivity.class);

            intent.putExtra(URL_TYPE ,url_type);

            if (request_url != null) {
                intent.putExtra(REQUEST_URL,request_url);
            }
            if (is_subaction != null) {
                intent.putExtra(IS_SUBACTION,is_subaction);
            }
            if (subaction_tag != null) {
                intent.putExtra(SUBACTION_TAG,subaction_tag);
            }
            if (order_code != null) {
                intent.putExtra(ORDERCODE,order_code);
            }
            if (download_data != null) {
                intent.putExtra(DOWNLOADDATA,download_data.toString());
            }

            intent.putExtra(GROUP,group);
            intent.putExtra(CHILD,child);


            return intent;
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_credit_card_editor);
    }
}
