mardi 23 octobre 2018

How to increment the data in the encrypted format in laravel

Find below the json data:

I have to apply discount price to the number of packages added, but the API returns the data as given below.

      stdClass Object
      ( 
       [d372356e79cae5872e8bcba4f2247537] => stdClass Object
        (
        [rowId] => d372356e79cae5872e8bcba4f2247537
        [id] => 528aFgyGJqMFAg393bSCsmv6kaGk54TuM7WdD2YR6t4Wo2gf32
        [name] => linux
        [quantity] => 1
        [price] => 1962
        [options] => stdClass Object
            (
                [package] => Super Lite
                [bicycle] => triennially
                [gid] => 1
                [type] => hosting
                [os] => 
                [fields_id] => 0
                [addons] => Array
                    (
                    )

                [addons_id] => Array
                    (
                    )

                [discount_code] => 
                [discount_price] => 
                [discount_percentage] => 
            )

        [tax] => 353.16
        [subtotal] => 1962
        [model] => 
        [created_at] => 1540360795
        [updated_at] => 1540360833
    )

[79ba998c997a61be569e1ca85ba46fad] => stdClass Object
    (
        [rowId] => 79ba998c997a61be569e1ca85ba46fad
        [id] => ZNHIYaAmCchvPyNdM9u68R9ldfEGkI77noG6LzZLqSFR5Q12Zf
        [name] => linux
        [quantity] => 1
        [price] => 3096
        [options] => stdClass Object
            (
                [package] => Super Lite
                [bicycle] => biennially
                [gid] => 1
                [type] => hosting
                [os] => 
                [fields_id] => 0
                [addons] => Array
                    (
                    )

                [addons_id] => Array
                    (
                    )

                [discount_code] => 
                [discount_price] => 
                [discount_percentage] => 
            )

        [tax] => 557.28
        [subtotal] => 3096
        [model] => 
        [created_at] => 1540360810
        [updated_at] => 1540360810
    )

)

From the above data I need to add discount amount to all packages. But I getting the array as starting with row Id.So suggest me a solution to increment the rowId, because the API returns the row Id in the encrypted format.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire