gerritvankuipers / aspjson

Classic ASP JSON Class Reading/Writing
78 stars 40 forks source link

Help for retrieve node #25

Closed csdragon2003 closed 2 years ago

csdragon2003 commented 2 years ago

Immagine 2022-10-14 115654

I need help because I can't get the elements inside "captures",

For Each purchase_units In oJSON.data("purchase_units") Set purchase_units = oJSON.data("purchase_units").item(purchase_units) Next

I can get the values ​​inside "purchase_units" but I don't know how to read inside "captures", I have made many attempts but I don't understand how to do it.

Would anyone know how to give me a hand?

csdragon2003 commented 2 years ago

{ "id": "123465789", "intent": "CAPTURE", "status": "COMPLETED", "purchase_units": [ { "reference_id": "ID-ORDINE-SEGRETO", "amount": { "currency_code": "EUR", "value": "0.10" }, "payee": { "email_address": "sb-test@business.example.com", "merchant_id": "HHAASS22" }, "shipping": { "name": { "full_name": "John Doe" }, "address": { "address_line_1": "Via Unit? d'Italia", "admin_area_2": "Napoli", "admin_area_1": "Napoli", "postal_code": "80127", "country_code": "IT" } }, "payments": { "captures": [ { "id": "45135854445", "status": "COMPLETED", "amount": { "currency_code": "EUR", "value": "0.10" }, "final_capture": true, "seller_protection": { "status": "ELIGIBLE", "dispute_categories": [ "ITEM_NOT_RECEIVED", "UNAUTHORIZED_TRANSACTION" ] }, "create_time": "2022-10-20T09:44:42Z", "update_time": "2022-10-20T09:44:42Z" } ] } } ], "payer": { "name": { "given_name": "John", "surname": "Doe" }, "email_address": "sb-test@personal.example.com", "payer_id": "CGUFLGA62JPNN", "address": { "country_code": "IT" } }, "create_time": "2022-10-20T09:44:33Z", "update_time": "2022-10-20T09:44:42Z", "links": [ { "href": "https://api.sandbox.paypal.com/v2/checkout/orders/TEST", "rel": "self", "method": "GET" } ] }

<% For Each purchase_units In oJSON.data("purchase_units") Set purchase_units = oJSON.data("purchase_units").item(purchase_units) For Each capturesArr In purchase_units.item("payments").item("captures")

        Set captures = purchase_units.item("payments").item("captures")
        For Each othernode In purchase_units.item("payments").item("captures")
            response.write "?"
        next
    Next
Next

%>

Any idea to retrive All node down of "captures" ?