package com.bytedance.globalpayment.iap.common.ability.model;

import X.0HH;
import com.bytedance.covode.number.Covode;
import com.bytedance.globalpayment.iap.model.IapPaymentMethod;
import org.json.JSONException;
import org.json.JSONObject;

public class OrderInfo {
    public String mExtraPayload;
    public IapPaymentMethod mIapPaymentMethod;
    public String mOrderId;
    public String mProductId;
    public String mUserId;

    static {
        Covode.recordClassIndex(27047);
    }

    public OrderInfo() {
    }

    public String getExtraPayload() {
        return this.mExtraPayload;
    }

    public IapPaymentMethod getIapPaymentMethod() {
        return this.mIapPaymentMethod;
    }

    public String getOrderId() {
        return this.mOrderId;
    }

    public String getProductId() {
        return this.mProductId;
    }

    public String getUserId() {
        return this.mUserId;
    }

    public JSONObject toJson() {
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("productId", this.mProductId);
            jSONObject.put("orderId", this.mOrderId);
            jSONObject.put("userId", this.mUserId);
            jSONObject.put("extraPayload", this.mExtraPayload);
            jSONObject.put("paymentMethod", this.mIapPaymentMethod.channelName);
        } catch (JSONException e) {
            0HH.LIZ(e);
        }
        return jSONObject;
    }

    public String toString() {
        return "OrderInfo{mProductId='" + this.mProductId + '\'' + ", mOrderId='" + this.mOrderId + '\'' + ", mUserId='" + this.mUserId + '\'' + ", mExtraPayload='" + this.mExtraPayload + '\'' + '}';
    }

    public OrderInfo setExtraPayload(String str) {
        this.mExtraPayload = str;
        return this;
    }

    public OrderInfo setIapPaymentMethod(IapPaymentMethod iapPaymentMethod) {
        this.mIapPaymentMethod = iapPaymentMethod;
        return this;
    }

    public OrderInfo setOrderId(String str) {
        this.mOrderId = str;
        return this;
    }

    public OrderInfo setProductId(String str) {
        this.mProductId = str;
        return this;
    }

    public OrderInfo setUserId(String str) {
        this.mUserId = str;
        return this;
    }

    public OrderInfo(OrderData orderData) {
        this.mProductId = orderData.getProductId();
        this.mOrderId = orderData.getOrderId();
        this.mUserId = orderData.getUserId();
        this.mExtraPayload = orderData.getIapPayRequest().LJIIJ;
        this.mIapPaymentMethod = orderData.getIapPaymentMethod();
    }
}
