Giter Site home page Giter Site logo

Array of objects parsing about qs HOT 5 CLOSED

ljharb avatar ljharb commented on April 27, 2024
Array of objects parsing

from qs.

Comments (5)

nlf avatar nlf commented on April 27, 2024

The problem here is that paypal uses bracket notation [0] for arrays, but dot notation object.property for object properties, while qs only supports bracket notation.

In order to fully support payloads like paypal sends, qs needs to be modified to allow for dot notation in object properties. It's on my list of possible new features.

from qs.

longuniquename avatar longuniquename commented on April 27, 2024

@nlf, thank you for quick response. OK, I'll be waiting for this feature )

from qs.

longuniquename avatar longuniquename commented on April 27, 2024

Native querystring module gives this response:

{
    "transaction[0].is_primary_receiver":          "true",
    "transaction[0].id_for_sender_txn":            "1EN35283R74763703",
    "log_default_shipping_address_in_transaction": "false",
    "transaction[0].receiver":                     "[email protected]",
    "action_type":                                 "PAY",
    "ipn_notification_url":                        "http://staging.mercherdev.com/ipn",
    "transaction[1].paymentType":                  "SERVICE",
    "transaction[0].amount":                       "USD 107.00",
    "charset":                                     "windows-1252",
    "transaction_type":                            "Adaptive Payment PAY",
    "transaction[1].id_for_sender_txn":            "7XF42668MS476925V",
    "transaction[1].is_primary_receiver":          "false",
    "transaction[0].status":                       "Completed",
    "notify_version":                              "UNVERSIONED",
    "transaction[0].id":                           "90E58532R7615693H",
    "cancel_url":                                  "http://staging.mercherdev.com/test",
    "transaction[1].status_for_sender_txn":        "Completed",
    "transaction[1].receiver":                     "[email protected]",
    "verify_sign":                                 "AFcWxV21C7fd0v3bYYYRCpSSRl31AW50ZrxhpTVKQjEObfEFfTcdVouU",
    "sender_email":                                "[email protected]",
    "fees_payer":                                  "PRIMARYRECEIVER",
    "transaction[0].status_for_sender_txn":        "Completed",
    "return_url":                                  "http://staging.mercherdev.com/test",
    "transaction[0].paymentType":                  "GOODS",
    "transaction[1].amount":                       "USD 2.00",
    "reverse_all_parallel_payments_on_error":      "true",
    "tracking_id":                                 "31",
    "transaction[1].pending_reason":               "NONE",
    "pay_key":                                     "AP-10U799054T2106106",
    "transaction[1].id":                           "6XR12273235492049",
    "transaction[0].pending_reason":               "NONE",
    "status":                                      "COMPLETED",
    "transaction[1].status":                       "Completed",
    "test_ipn":                                    "1",
    "payment_request_date":                        "Mon Oct 06 09:00:28 PDT 2014"
}

For now I'll try to parse these keys into objects. But it would be great to have it supported by your module.

from qs.

nlf avatar nlf commented on April 27, 2024

Closed via #47

from qs.

hueniverse avatar hueniverse commented on April 27, 2024

So... this is not marked with a release, is actually a breaking change (see hapijs/hapi#2718) and the comment above is referencing back this issue.

This is a pretty big change. I am not sure what to do about this now as it is breaking code for hapi users.

from qs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.