I am attempting to retrieve the PAY_TYPE value from the callback_details object by using JSON.parse() function to convert a string into an object. However, I keep encountering an error related to the question's title.
Here is my code snippet:
<td class="text-xs-left">{{props.item.payment_method}}<br>({{JSON.parse(props.item.callback_details).PAY_TYPE}})</td>
Inside the data() method:
data(){
return{
loading: false,
startDate: '',
endDate: '',
startMenu: false,
endMenu: false,
pagination:{
rowsPerPage: -1
},
orders:[],
payment:[],
list1: [],
list2: [],
payment_headers:[
{ text: this.$translate('merchant'), value: 'merchant' },
{ text: this.$translate('shop_owner'), value: 'shop_owner', sortable: false },
{ text: this.$translate('platform_fee'), value: 'platformFee', sortable: false },
{ text: this.$translate('total_earning'), value: '', sortable: false }
],
details_headers:[
{ text: this.$translate('shop_name'), value: 'shop_name' },
{ text: this.$translate('date'), value: 'created' },
{ text: this.$translate('buyer_yippi'), value: 'yippiWallet' },
{ text: this.$translate('purchase'), value: 'yippsAmount', sortable: false },
{ text: this.$translate('payment_type'), value: 'payment_method', sortable: false},
{ text: this.$translate('platform_fee'), value: 'platformFee', sortable: false },
{ text: this.$translate('earning_fee'), value: '', sortable: false }
],
json:{},
count: 0,
tableSettingsOne: {
descending: true,
sortBy: null,
rowsPerPage: 25,
pageSizes: [
{"text":"5","value":5},
{"text":"10","value":10},
{"text":"25","value":25},
{"text":"50","value":50},
{"text":"All","value":-1}
]
},
tableSettingsTwo: {
descending: true,
sortBy: null,
rowsPerPage: 25,
pageSizes: [
{"text":"5","value":5},
{"text":"10","value":10},
{"text":"25","value":25},
{"text":"50","value":50},
{"text":"All","value":-1}
]
}
}
In order to display the PAY_TYPE from the callback_details:
callback_details: "{"TXN_ID":"262439","PAY_TYPE":"VISAMASTER","STATUS_INFO":"2003267b9029b3b"}"
However, I keep receiving the following errors:
[Vue warn]: Error in render: "TypeError: Cannot read property 'PAY_TYPE' of null"
TypeError: Cannot read property 'PAY_TYPE' of null
If anyone knows how to resolve this issue, your help would be greatly appreciated. Thank you.