I'm trying to get to the next level of information from a jSon response. I can get "code", but I need to get the "result" and some other information that's under "payload".
I don't have a ton of experience with this, so any help would be appreciated!
Here's my code
Dim jason As String = str
Dim parsejson As New JObject
parsejson = JObject.Parse(jason)
Dim theResponseYo As String = parsejson.SelectToken("code").ToString()
MsgBox("You are: " + theResponseYo)
Here's the json I'm parsing:
{
"code": "200",
"status": "success",
"exchange-id": "xxxxxxx",
"payload": {
"transaction": {
"amount": "2.30",
"id": "115340330",
"created": "2022-07-26 20:07:21.157",
"type": "SALE",
"result": "APPROVED",
"card": "XXXXXXXXXXXX1111",
"csc": "999",
"authorization-code": "TAS185",
"batch-string-id": "10",
"display-message": "Transaction approved",
"result-code": "000",
"exp-date": "1222",
"card-type": "VISA",
"sales-tax-amount": "3.00",
"last-four": "1111",
"service-fee": "1.00",
"merchant-id": "12345567",
"terminal-id": "10011111",
"level3": {
"vat-tax-amount": "0.00",
"vat-tax-rate": "0.00",
"order-date": "20220726",
"discount-amount": "0.00",
"destination-country-code": "USA",
"freight-amount": "0.00",
"duty-amount": "0.00",
"level3-items": {
"level3-items": [
{
"item-description": "PRODUCT",
"item-commodity-code": "UPC",
"item-quantity": "1.00",
"item-unit-of-measure": "EA",
"item-product-code": "MATERIAL",
"item-tax-rate": "0.00",
"item-discount": "0.00",
"item-discount-rate": "0.00"
}
]
}
}
},
"payloadType": "transaction"
}
}