package kz.com.aman.kassa.bank;

object JsonForExternalCall {

    fun getPaymentCardJson(authToken: String, amount: String): String {
        return """{
            "credentials" : {
                "authorizationToken": "$authToken"
            },
            "operationData" : {
                "instrument": "CARD",
                "amountData" : {
                    "currencyCode": "398",
                    "amount": "$amount",
                    "amountExponent": "2"
                },
                "goods" : {
                    "product": [{
                        "name": "Товар",
                        "price": "$amount",
                        "quantity": "1",
                        "quantityExponent": "0",
                        "taxRate": "TAX_20",
                        "accountingSubject": "PRODUCT"
                    }]
                }
            }
        }"""
    }

    fun getRefundCardJson(authToken: String, terminalId: String, operDay: String, transNum: String, amount: String): String {
        return """{
            "credentials" :{
                "authorizationToken": "$authToken"
            },
            "operationData" :{
                "instrument": "CARD",
                "amountData" : {
                    "currencyCode": "348",
                    "amount": "$amount",
                    "amountExponent": "2"
                },
                "parentTransaction" : {
                    "terminalId": "$terminalId",
                    "operationDay": "$operDay",
                    "transactionNumber": "$transNum"
                }
            }
        }"""
    }

    fun getCloseDayJson(authToken: String): String {
        return """{
            "credentials" : {
                "authorizationToken": "$authToken"
            }
        }"""
    }

    fun getOperationsListJson(authToken: String): String {
        return """{
            "credentials" : {
                "authorizationToken": "$authToken"
            },
            "operationData": {
                "params": {
                    "offset": "0",
                    "limit": "20"
                },
                "filter": {
                    "transactionTypes": [PAYMENT, REFUND]
                }
            }
        }"""
    }

    fun getReversalJson(authToken: String, terminalId: String, operDay: String, transNum: String): String {
        return """{
            "credentials" : {
                "authorizationToken": "$authToken"
            },
            "operationData" : {
                "parentTransaction" : {
                    "terminalId": "$terminalId",
                    "operationDay": "$operDay",
                    "transactionNumber": "$transNum"
                }
            }
        }"""
    }

//    fun getPaymentCashJson(authToken: String): String {
//        return """{
//            "credentials" : {
//                "authorizationToken": "$authToken"
//            },
//            "operationData" : {
//                "instrument": "CASH",
//                "amountData" : {
//                    "currencyCode": "643",
//                    "amount": "6000",
//                    "amountExponent": "2"
//                },
//                "goods" : {
//                    "product": [{
//                        "name": "Печеньки",
//                        "price": "3000",
//                        "quantity": "2",
//                        "quantityExponent": "0",
//                        "taxRate": "TAX_20",
//                        "accountingSubject": "PRODUCT"
//                    }]
//                }
//            }
//        }"""
//    }

//
//    fun getRefundCashJson(authToken: String, terminalId: String, operDay: String, transNum: String): String {
//        return """{
//            "credentials" :{
//                "authorizationToken": "$authToken"
//            },
//            "operationData" :{
//                "instrument": "CASH",
//                "amountData" : {
//                    "currencyCode": "643",
//                    "amount": "6000",
//                    "amountExponent": "2"
//                },
//                "parentTransaction" : {
//                    "terminalId": "$terminalId",
//                    "operationDay": "$operDay",
//                    "transactionNumber": "$transNum"
//                }
//            }
//        }"""
//    }

   

}