Angular: ERROR rejection in promise - Safari only (iOS) - ios

I'm developing a mobile web app with Angular and ionic which parses a RSS in form of a XML with the 'rss-parser' library.
Everything works fine on PC (Chrome, Edge) and on Android. But if I try to open it in Safari on my iPhone, I get the following error:
ERROR {"rejection": {}, "promise": {"__zone_symbol__state": 0, "__zone_symbol__value": "(Circular TypeError)"}, "zone": {"_parent": {"_parent": null, "_name": "<root>", "_properties": {}, "_zoneDelegate": {"_taskCounts": {"microTask": 0, "macroTask": 0, "eventTask": 0}, "zone": "(Circular Y)", "_parentDelegate": null, "_forkZS": null, "_forkDlgt": null, "_forkCurrZone": null, "_interceptZS": null, "_interceptDlgt": null, "_interceptCurrZone": null, "_invokeZS": null, "_invokeDlgt": null, "_invokeCurrZone": null, "_handleErrorZS": null, "_handleErrorDlgt": null, "_handleErrorCurrZone": null, "_scheduleTaskZS": null, "_scheduleTaskDlgt": null, "_scheduleTaskCurrZone": null, "_invokeTaskZS": null, "_invokeTaskDlgt": null, "_invokeTaskCurrZone": null, "_cancelTaskZS": null, "_cancelTaskDlgt": null, "_cancelTaskCurrZone": null, "_hasTaskZS": null, "_hasTaskDlgt": null, "_hasTaskDlgtOwner": null, "_hasTaskCurrZone": null}}, "_name": "angular", "_properties": {"isAngularZone": true}, "_zoneDelegate": {"_taskCounts": {"microTask": 0, "macroTask": 0, "eventTask": 72}, "zone": "(Circular Y)", "_parentDelegate": "(Circular D)", "_forkZS": null, "_forkDlgt": null, "_forkCurrZone": null, "_interceptZS": null, "_interceptDlgt": null, "_interceptCurrZone": null, "_invokeZS": {"name": "angular", "properties": "(Circular Object)", "onInvokeTask": onInvokeTask(), "onInvoke": onInvoke(), "onHasTask": onHasTask(), "onHandleError": onHandleError()}, "_invokeDlgt": "(Circular D)", "_invokeCurrZone": "(Circular Y)", "_handleErrorZS": "(Circular Object)", "_handleErrorDlgt": "(Circular D)", "_handleErrorCurrZone": "(Circular Y)", "_scheduleTaskZS": {"name": "", "onHasTask": onHasTask(), "onScheduleTask": onScheduleTask(), "onInvokeTask": onInvokeTask(), "onCancelTask": onCancelTask()}, "_scheduleTaskDlgt": "(Circular D)", "_scheduleTaskCurrZone": "(Circular Y)", "_invokeTaskZS": "(Circular Object)", "_invokeTaskDlgt": "(Circular D)", "_invokeTaskCurrZone": "(Circular Y)", "_cancelTaskZS": "(Circular Object)", "_cancelTaskDlgt": "(Circular D)", "_cancelTaskCurrZone": "(Circular Y)", "_hasTaskZS": "(Circular Object)", "_hasTaskDlgt": "(Circular D)", "_hasTaskDlgtOwner": "(Circular D)", "_hasTaskCurrZone": "(Circular Y)"}}, "task": {"_zone": "(Circular Y)", "runCount": 0, "_zoneDelegates": null, "_state": "notScheduled", "type": "microTask", "source": "Promise.then", "data": {"__zone_symbol__state": true, "__zone_symbol__value": undefined}, "scheduleFn": undefined, "cancelFn": undefined, "callback": function(), "invoke": function()}}
This is everything I can see on my iPhone using vConsole (I don't have a Mac to debug it properly).
I've tested deploying my app on an Oracle cloud VM (linux) and Azure. Both don't work...
What I'm doing is simply call the method parseURL from rss-parser passing the XML url:
apiUrl = 'https://rss.app/feeds/OMITTING.xml/';
async parseUrl() {
let feed: any;
await this.parser.parseURL(this.apiUrl)
.then(result => {
console.log('Result ok: ');
console.log(result);
feed = result;
})
.catch (error => {
throw(error);
});
console.log('Out: ');
console.log(feed);
return feed!.items;
}
What makes me confused is that it works if I append "https://cors-anywhere.herokuapp.com/" to the URL, which makes me think it has something to do with CORS. But why does it happen only in Safari??
As a last try, I've created my own cors-anywhere instance on a linux server and ran it with "node server.js".
Also in this case, my app works everywhere except on Safari.
Do you know what I'm missing here? This is driving me crazy since one day.

Related

How to check if object is empty in Alasql

I have this example here and i'm trying to only query the empty mongodb array
var data = [{
"dynamic_env": null,
"mission_critical": null,
"chart-version": null,
"app-url": null,
"mongodb": {},
"nightly_shutdown": false,
"external_values": null,
"external_values_source": null,
"external_values_path": null,
"atlas_database": null,
"allow_db_restore": null,
"on-demand": false,
"helm_timeout": null,
"aws-account": null,
"post": [],
"pre": [],
"atlas_project": null,
"istio-enabled": false,
"env_subscription": null,
"istio-auth-policy": null,
"version": null,
"e2e-tests-script": [],
"morning_startup": true,
"project_dst": null,
"cred": null,
"dataset": null,
"project_src": null,
"Env": {
"identifier": "cm-infra-ci-core1#admin365-infra-stg-eks#admin365-cm-infra-ci-core1",
"title": "cm-infra-ci-core1"
},
"namespace": "admin365-cm-infra-ci-core1",
"cluster": {
"identifier": "admin365-infra-stg-eks#infra-stg",
"title": "admin365-infra-stg-eks"
},
"Service": {
"identifier": "user-data-management-gdpr-fetch",
"title": "user-data-management-gdpr-fetch"
},
"team": null,
"$identifier": "user-data-management-gdpr-fetch#cm-infra-ci-core1#admin365-cm-infra-ci-core1",
"$title": "user-data-management-gdpr-fetch#cm-infra-ci-core1"
},
{
"dynamic_env": null,
"mission_critical": null,
"chart-version": null,
"app-url": null,
"mongodb": {a: 123},
"nightly_shutdown": false,
"external_values": null,
"external_values_source": null,
"external_values_path": null,
"atlas_database": null,
"allow_db_restore": null,
"on-demand": false,
"helm_timeout": null,
"aws-account": null,
"post": [],
"pre": [],
"atlas_project": null,
"istio-enabled": false,
"env_subscription": null,
"istio-auth-policy": null,
"version": null,
"e2e-tests-script": [],
"morning_startup": true,
"project_dst": null,
"cred": null,
"dataset": null,
"project_src": null,
"Env": {
"identifier": "cm-infra-ci-core1#admin365-infra-stg-eks#admin365-cm-infra-ci-core1",
"title": "cm-infra-ci-core1"
},
"namespace": "admin365-cm-infra-ci-core1",
"cluster": {
"identifier": "admin365-infra-stg-eks#infra-stg",
"title": "admin365-infra-stg-eks"
},
"Service": {
"identifier": "user-data-management-gdpr-fetch",
"title": "user-data-management-gdpr-fetch"
},
"team": null,
"$identifier": "user-data-management-gdpr-fetch#cm-infra-ci-core1#admin365-cm-infra-ci-core1",
"$title": "user-data-management-gdpr-fetch#cm-infra-ci-core1"
}];
var res = alasql(`SELECT * FROM ? WHERE ('mongodb'->() = {})`,[data]);
console.log(res.length); // [{"a":1,"b":40},{"a":2,"b":20}]
Add a user-defined function that returns the number of keys in the object, then query it:
alasql.fn.keylen = function(x) { return Object.keys(x).length; }
var res = alasql(`SELECT * FROM ? WHERE keylen(mongodb) = 0`,[data]);

MS Graph API Teams Call Record explained

General Call Record Understanding
We're using the Microsoft Teams Graph API to analyse calls made through Microsoft Teams. We've setup a notification web hook that subscribes to the call records using the Graph API and then uses some more API calls to retrieve the call and user information for the received call. That's all working quite well (despite the time delay - but that's OK). What we struggle with ist the information retrieved from the Call Record API. We receive following data for example (UUIDs, names and phone numbers anonymised):
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords(sessions())/$entity",
"id": "00000000-0000-0000-0000-000000000000",
"version": 1,
"type": "groupCall",
"modalities": [
"audio",
"screenSharing"
],
"lastModifiedDateTime": "2021-10-18T11:16:03.5458861Z",
"startDateTime": "2021-10-18T10:55:33.712657Z",
"endDateTime": "2021-10-18T10:57:23.1331192Z",
"joinWebUrl": null,
"organizer": {
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+49XXXXXXXX",
"displayName": null,
"tenantId": null
},
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null
},
"participants": [
{
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Firstname Lastname",
"tenantId": "00000000-0000-0000-0000-000000000000"
}
},
{
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": null
}
},
{
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+49XXXXXXXX",
"displayName": null,
"tenantId": null
},
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null
},
{
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+49XXXXXXXX",
"displayName": null,
"tenantId": null
},
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null
},
{
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": "00000000-0000-0000-0000-000000000000"
}
},
{
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": "00000000-0000-0000-0000-000000000000"
}
}
],
"sessions#odata.context": "https://graph.microsoft.com/v1.0/$metadata#communications/callRecords('00000000-0000-0000-0000-000000000000')/sessions",
"sessions": [
{
"id": "403139dd-b5c1-457e-a5aa-b07e8c2bcc58",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:40.552989Z",
"endDateTime": "2021-10-18T10:57:23.1331192Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": null
}
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
},
{
"id": "b538ce68-cd12-4b22-b127-69b73a183e78",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:41.5686724Z",
"endDateTime": "2021-10-18T10:57:23.1331192Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": null
}
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
},
{
"id": "beb5c088-70f6-4b77-8a47-fbef0f3b6707",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:36.2402487Z",
"endDateTime": "2021-10-18T10:57:23.055049Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+49XXXXXXXX",
"displayName": null,
"tenantId": null
},
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
},
{
"id": "c1fce6ee-8ac6-4680-a079-8384665aeba0",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:53.0392071Z",
"endDateTime": "2021-10-18T10:57:23.1331192Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": null
}
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
},
{
"id": "ce6e4e5d-77ff-421a-9b28-670dd691a119",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:36.2402487Z",
"endDateTime": "2021-10-18T10:55:52.4142559Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": "MicrosoftTeamsCallQueueService (20211014.1)",
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": "00000000-0000-0000-0000-000000000000"
}
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
},
{
"id": "00000000-0000-0000-0000-000000000000",
"modalities": [
"audio"
],
"startDateTime": "2021-10-18T10:55:33.712657Z",
"endDateTime": "2021-10-18T10:57:23.0157168Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"user": null,
"acsUser": null,
"spoolUser": null,
"phone": {
"id": "+49XXXXXXXX",
"displayName": null,
"tenantId": null
},
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": "MicrosoftTeamsCallQueueService (20211014.1)",
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": null,
"tenantId": "00000000-0000-0000-0000-000000000000"
}
}
}
},
{
"id": "e4f20c64-9343-4d67-b47b-9ba5e34ab373",
"modalities": [
"audio",
"screenSharing"
],
"startDateTime": "2021-10-18T10:55:51.8360806Z",
"endDateTime": "2021-10-18T10:57:23.1331192Z",
"failureInfo": null,
"caller": {
"#odata.type": "#microsoft.graph.callRecords.participantEndpoint",
"feedback": null,
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": "CallSignalingAgent (27/1.4.00.26376//;release_ktolskiy2/hook_R22.2021.22.01.56;releases/CL2021.R22)",
"applicationVersion": null,
"platform": "windows",
"productFamily": "teams"
},
"identity": {
"acsUser": null,
"spoolUser": null,
"phone": null,
"guest": null,
"encrypted": null,
"onPremises": null,
"acsApplicationInstance": null,
"spoolApplicationInstance": null,
"applicationInstance": null,
"application": null,
"device": null,
"user": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Firstname Lastname",
"tenantId": "00000000-0000-0000-0000-000000000000"
}
}
},
"callee": {
"#odata.type": "#microsoft.graph.callRecords.serviceEndpoint",
"userAgent": {
"#odata.type": "#microsoft.graph.callRecords.clientUserAgent",
"headerValue": null,
"applicationVersion": null,
"platform": "unknown",
"productFamily": "unknown"
}
}
}
]
}
To be able to get our heads around the data, we visualise the call sessions like this:
Our interpretation for this call is:
+49XXXXXXXX calls the Call Queue call queue at 12:55:33
at 12:55:51 Firstname Lastname picks up the call from the queue
the call ends at 12:57:23.
Is this correct?
Failure Info
Next thing we encountered is the failureInfo information on a call record session. For some calls that are listed as failed in the Teams Call Record CSV export (administration user interface) we receive no failure info (but the total call duration is 0 seconds), while for others that are listed as successful in the CSV export we receive a failure info such as
"failureInfo": {
"reason": "Other",
"stage": "callSetup"
}
These calls then have a sensible call duration.
Does anybody know of any issues with the failure information or what's the deal with this information?
We're analysing the calls rather extensively but currently we use our own interpretation of the call record sessions to determine what type of call it was, who picked up the call, who could have picked up the call, etc. But unfortunately there's not much information around (at least I could not find any) that describes the nature of these call record sessions: what they represent, what types of services we can encounter (bots, apps, etc.), which information you can extract from them and which not. Is just guessing at the moment for us.
I'd be really grateful for any hint, link, nudge in the right direction to get a better understanding of these call records.

Getting access to a hash - Ruby

I'm trying to get to data that I found in a binding.pry --- Here is is
[#<Stripe::Card:0x3fc1da530e18 id=card_1A4KjTLcGwfBVD0DjTHzDqsO> JSON: {
"id": "card_1A4KjTLcGwfBVD0DjTHzDqsO",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": "42424",
"address_zip_check": "pass",
"brand": "Visa",
"country": "US",
"customer": "cus_AP91mImLV1GIrS",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 4,
"exp_year": 2024,
"fingerprint": "U2Lh3jtN9G5jgtxm",
"funding": "credit",
"last4": "4242",
"metadata": {},
"name": null,
"tokenization_method": null
}]
I get all that data when I type this in the console: context.customer.sources.data
I've tried getting the object like this: context.customer.sources.data[:object] but that gives me this error => TypeError: no implicit conversion of Symbol into Integer
How do I get to that data?
Because it's an array. so you should visit like context.customer.sources.data[0][:object] or context.customer.sources.data[0].object

how to handle the below data

The problwm what iam facing is ..when ever iam passing the values like array inside the dictionyy..it is showing me the error -1005 connection was lost..and when ever i dont pass the values the response is getting successfully created but inthe server side database the ofiice price details and office contact information and office document is not saving ..can any one help me how to handle thanks in advance
[
{
"OfficePrice": [
{
"office": 1,
"making_charge": 1,
"wastage": 1,
"weight_by": 1,
"credit_period": 1,
"cartage_price_type": null,
"cartage_price": null,
"diamond_price": 1,
"amethyst_price": 1,
"amber_price": 1,
"sapphire_price": 1,
"emerald_price": null,
"ruby_price": null,
"id": 1,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
}
],
"OfficeContactPerson": [
{
"office": 1,
"contact_name": null,
"designation": "ASDF",
"department": "234",
"mobile": "1231231231",
"email": null,
"incharge_status": null,
"created_by": null,
"modified_by": null,
"id": 1,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
},
{
"office": 1,
"contact_name": null,
"designation": "ASDF",
"department": "ASDF",
"mobile": "1231231231",
"email": null,
"incharge_status": null,
"created_by": null,
"modified_by": null,
"id": 2,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
}
],
"OfficeBank": [
{
"office": 1,
"bank": 2,
"branch": null,
"city": null,
"account_type": 1,
"ifsc_code": "12123",
"account_number": "12234",
"account_name": "asdfasd",
"id": 3,
"createdAt": "2016-04-16T14:18:39.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
}
],
"OfficeDocument": [
{
"office": 1,
"document_original": null,
"document_stored_name": null,
"id": 1,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
}
],
"city": {
"name": "Bengalore",
"id": 1,
"createdAt": null,
"updatedAt": "2016-04-16T16:02:53.000Z"
},
"state": {
"name": "Karnataga",
"id": 1,
"createdAt": null,
"updatedAt": "2016-04-16T16:02:53.000Z"
},
"district": {
"name": "BGL",
"id": 1,
"createdAt": null,
"updatedAt": "2016-04-16T16:02:53.000Z"
},
"name": "kkk",
"short_name": "asdf",
"shop_no": "1",
"door_no": "11",
"floor": "1",
"building": "1",
"street": "1",
"area": "1",
"main": "1",
"pincode": "1",
"telephone": "1",
"hallmarking": null,
"payment_by": null,
"delivered_to": null,
"active_status": null,
"delete_status": null,
"created_by": null,
"modified_by": null,
"office_photo_original": null,
"office_photo_stored_name": null,
"cin_path": null,
"vat": null,
"pan": null,
"others": "123123",
"id": 1,
"createdAt": "2016-04-15T08:41:08.000Z",
"updatedAt": "2016-04-16T14:18:39.000Z"
}
the dictionary can't save null values.
The NSDictionay format doesn't support null vales. Thats why its returning error.
The only possible solution for this is to update server database ,change null values to 0 or "NULL"(in double quotes). it will solve your issue.

Stripe response manipulation in Grails

Hi i have the below response for Stripe in my Grails 2.5.1 application , how i can read and manipulate it using Grails .
Response :
<com.stripe.model.Charge#1467160391 id=ch_17bcduFKvYH0sAt4OMSKjOzA> JSON: { "amount": 7200, "created": 1454790414, "currency": "egp", "id": "ch_17bcduFKvYH0sAt4OMSKjOzA", "livemode": false, "paid": true, "refunded": false, "disputed": null, "captured": true, "description": "customer#sample.org", "statement_description": null, "failure_message": null, "failure_code": null, "amount_refunded": 0, "customer": null, "invoice": null, "refunds": { "data": [], "total_count": 0, "has_more": false, "url": "/v1/charges/ch_17bcduFKvYH0sAt4OMSKjOzA/refunds", "count": null }, "card": null, "dispute": null, "balance_transaction": "txn_17bcduFKvYH0sAt4qSSDZ7Bj", "metadata": {} }

Resources