Categories
Mastering Development

It’s impossible to iterate this JSON. I cannot find examples of how to parse this type of JSON file

I can use a simple JSON file to parse and output JSON data, e.g., [ { "id": "1", "firstName": "John", "lastName": "Doe" }, { "id": "2", "firstName": "Mary", "lastName": "Peterson" }, { "id": "3", "firstName": "George", "lastName": "Hansen" } ] However, when I try to use a larger JSON file, it returns an undefined. How […]

Categories
CMS Magento Mastering Development

How to pass the card details for the Magento API [POST]: V1/carts/mine/payment-information for the payment method stripe_payments_checkout_card

I have an iOS native app which communicates through Magento Rest APIs with my Magento Store, I would like to know how to pass the card details (Token, CVV, Exp Year, Exp Month, Last 4) in JSON format for the payment method "method":"stripe_payments_checkout_card" in the Magento API: [POST] V1/carts/mine/payment-information Note: I use the Stripe Official […]

Categories
Cryptocurrency Ethereum Mastering Development

Students certification architecture

I recently did a course on uDemy and get the first concepts. I’m starting to build a real-life app for a training center. I want to register in the blockchain that Jhon Doe, ID (document) xxxx, approved the course "Master of blockchain" at specific date, and also register the "expiration date" for the certification/permission. In […]

Categories
Mastering Development Software

best practice posting complex object to api

i am trying to figure out what is the best practice on doing POST calls when creating new complex objects. example assume this is the complex object i wish to send: { "firstname": "John", "lastname": "Doe", "mainEmployer": {"name": "Imaginary LLC", "website": "www.imaginary.com"} } essentially the above is 2 models in one. person model: { "firstname": […]

Categories
CMS Magento Mastering Development

Error when trying to add an order via the API

The url for shipping is: V1/guest-carts//payment-information https://store.upc.tax/rest/default/V1/guest-carts/5Shn4DiClYehFeJpq0lzwGy78O4e5I7h/payment-information I try to add a purchase order with a guest cart, it throws the following error: { "message": "\"%fieldName\" is required. Enter and try again.", "parameters": { "fieldName": "email" } } The json that I send is composed as follows: { "paymentMethod": { "method": "banktransfer" }, "billing_address": { […]

Categories
Mastering Development

Convert a nested JSON string to Pandas dataframes (and add “foreign key” to relate them)

I have a CSV file which contains the following columns: customer_id: precisely that. report_date: the date of creation of the report. json_report: a JSON object The JSON object is something like this: { "Person": { "Name": { "FirstName": "John", "LastName": "Doe" }, "Accounts": { "Account": [ {"AccountNumber":123, "AccountStatus": "G"}, {"AccountNumber":137, "AccountStatus": "B"}, {"AccountNumber":593, "AccountStatus": "VB"} […]

Categories
Mastering Development

how to get certain key value to output in coldfusion/cfml?

I am trying to output certain key values to show. But for some reason it is not working out. Basically, I am converting this query statement into api call. But for some reason I cant get a certain key value from the api call or a json file. Can anyone tell me what I have […]

Categories
Mastering Development

How to model a Swift dictionary property on a Realm object?

How should I model a dictionary property on a Realm object so when encoded to JSON I can get this: { “firstName”: “John”, “lastName”: “Doe”, “favoriteThings”: { “car”: “Audi R8”, “fruit”: “strawberries” “tree” : “Oak” } } I tried creating a new Object FavoriteThings with ‘key’ and ‘value’ properties as I’ve seen elsewhere… public class […]

Categories
Mastering Development

Change property names in an object that contains arrays of objects

I am currently in a situation where there are certain properties in an object that I would like to change to snake case. At the moment I can change the names of properties in this object if they are not in a nested object or in an object in an array. This is my function […]

Categories
Development

Do I need to create a Unit Test Case class for a Struct in Swift?

I wonder if there is a need to create a Unit Test Case class or even a separate unit test method to test a Model of it is a Struct? I trying to follow the TDD to create a Signup feature for my mobile app. On a piece of paper, I have sketched what I […]