From 15428cf11045b7c9b1745a21742ff6716aca65b6 Mon Sep 17 00:00:00 2001 From: Son Dang Date: Thu, 10 Sep 2020 23:44:40 +0700 Subject: [PATCH 1/2] Update gjson to latest version v1.6.1 Current gjson version is 1.1.3 which lacks several features such as: - Modifier `@flatten` to transform a json `[1, [2, 3]]` to `[1, 2, 3]` https://github.com/tidwall/gjson/blob/master/SYNTAX.md#modifiers - Join multipaths https://github.com/tidwall/gjson/blob/master/SYNTAX.md#multipaths Upgrading to latest version of gjson will resolve above issues. --- go.mod | 5 +- go.sum | 6 + vendor/github.com/tidwall/gjson/README.md | 172 ++- vendor/github.com/tidwall/gjson/SYNTAX.md | 277 ++++ vendor/github.com/tidwall/gjson/gjson.go | 1338 +++++++++++++---- vendor/github.com/tidwall/gjson/gjson_gae.go | 10 - vendor/github.com/tidwall/gjson/gjson_ngae.go | 73 - vendor/github.com/tidwall/gjson/go.mod | 8 + vendor/github.com/tidwall/gjson/go.sum | 4 + vendor/github.com/tidwall/match/match.go | 29 +- vendor/github.com/tidwall/pretty/README.md | 2 +- vendor/github.com/tidwall/pretty/pretty.go | 36 +- vendor/modules.txt | 7 +- 13 files changed, 1526 insertions(+), 441 deletions(-) create mode 100644 vendor/github.com/tidwall/gjson/SYNTAX.md delete mode 100644 vendor/github.com/tidwall/gjson/gjson_gae.go delete mode 100644 vendor/github.com/tidwall/gjson/gjson_ngae.go create mode 100644 vendor/github.com/tidwall/gjson/go.mod create mode 100644 vendor/github.com/tidwall/gjson/go.sum diff --git a/go.mod b/go.mod index fbbd62b80af..7c500a697b8 100644 --- a/go.mod +++ b/go.mod @@ -60,9 +60,8 @@ require ( github.com/spf13/cobra v0.0.4-0.20180629152535-a114f312e075 github.com/spf13/pflag v1.0.1 github.com/stretchr/testify v1.2.2 - github.com/tidwall/gjson v1.1.3 - github.com/tidwall/match v1.0.0 // indirect - github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51 + github.com/tidwall/gjson v1.6.1 + github.com/tidwall/pretty v1.0.2 github.com/ugorji/go v1.1.7 // indirect github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862 github.com/valyala/bytebufferpool v1.0.0 // indirect diff --git a/go.sum b/go.sum index fd7b88abaf0..5209983b69b 100644 --- a/go.sum +++ b/go.sum @@ -135,10 +135,16 @@ github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7 github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/tidwall/gjson v1.1.3 h1:u4mspaByxY+Qk4U1QYYVzGFI8qxN/3jtEV0ZDb2vRic= github.com/tidwall/gjson v1.1.3/go.mod h1:c/nTNbUr0E0OrXEhq1pwa8iEgc2DOt4ZZqAt1HtCkPA= +github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws= +github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0= github.com/tidwall/match v1.0.0 h1:Ym1EcFkp+UQ4ptxfWlW+iMdq5cPH5nEuGzdf/Pb7VmI= github.com/tidwall/match v1.0.0/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51 h1:BP2bjP495BBPaBcS5rmqviTfrOkN5rO5ceKAMRZCRFc= github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10 h1:4zp+5ElNBLy5qmaDFrbVDolQSOtPmquw+W6EMNEpi+k= github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/urfave/negroni v0.3.1-0.20180130044549-22c5532ea862 h1:o3gEt3MZ4RRJUzO8qtPd31kJYU3m/ga9re5xbjVFUvA= diff --git a/vendor/github.com/tidwall/gjson/README.md b/vendor/github.com/tidwall/gjson/README.md index 70240d99279..4108deb3789 100644 --- a/vendor/github.com/tidwall/gjson/README.md +++ b/vendor/github.com/tidwall/gjson/README.md @@ -55,6 +55,9 @@ Prichard ## Path Syntax +Below is a quick overview of the path syntax, for more complete information please +check out [GJSON Syntax](SYNTAX.md). + A path is a series of keys separated by a dot. A key may contain special wildcard characters '\*' and '?'. To access an array value use the index as the key. @@ -68,9 +71,9 @@ The dot and wildcard characters can be escaped with '\\'. "children": ["Sara","Alex","Jack"], "fav.movie": "Deer Hunter", "friends": [ - {"first": "Dale", "last": "Murphy", "age": 44}, - {"first": "Roger", "last": "Craig", "age": 68}, - {"first": "Jane", "last": "Murphy", "age": 47} + {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]}, + {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]}, + {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]} ] } ``` @@ -87,45 +90,24 @@ The dot and wildcard characters can be escaped with '\\'. "friends.1.last" >> "Craig" ``` -You can also query an array for the first match by using `#[...]`, or find all matches with `#[...]#`. -Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators and the simple pattern matching `%` operator. +You can also query an array for the first match by using `#(...)`, or find all +matches with `#(...)#`. Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` +comparison operators and the simple pattern matching `%` (like) and `!%` +(not like) operators. ``` -friends.#[last=="Murphy"].first >> "Dale" -friends.#[last=="Murphy"]#.first >> ["Dale","Jane"] -friends.#[age>45]#.last >> ["Craig","Murphy"] -friends.#[first%"D*"].last >> "Murphy" +friends.#(last=="Murphy").first >> "Dale" +friends.#(last=="Murphy")#.first >> ["Dale","Jane"] +friends.#(age>45)#.last >> ["Craig","Murphy"] +friends.#(first%"D*").last >> "Murphy" +friends.#(first!%"D*").last >> "Craig" +friends.#(nets.#(=="fb"))#.first >> ["Dale","Roger"] ``` -## JSON Lines - -There's support for [JSON Lines](http://jsonlines.org/) using the `..` prefix, which treats a multilined document as an array. - -For example: - -``` -{"name": "Gilbert", "age": 61} -{"name": "Alexa", "age": 34} -{"name": "May", "age": 57} -{"name": "Deloise", "age": 44} -``` - -``` -..# >> 4 -..1 >> {"name": "Alexa", "age": 34} -..3 >> {"name": "Deloise", "age": 44} -..#.name >> ["Gilbert","Alexa","May","Deloise"] -..#[name="May"].age >> 57 -``` - -The `ForEachLines` function will iterate through JSON lines. - -```go -gjson.ForEachLine(json, func(line gjson.Result) bool{ - println(line.String()) - return true -}) -``` +*Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was +changed in v1.3.0 as to avoid confusion with the new +[multipath](SYNTAX.md#multipaths) syntax. For backwards compatibility, +`#[...]` will continue to work until the next major release.* ## Result Type @@ -193,6 +175,118 @@ result.Int() int64 // -9223372036854775808 to 9223372036854775807 result.Uint() int64 // 0 to 18446744073709551615 ``` +## Modifiers and path chaining + +New in version 1.2 is support for modifier functions and path chaining. + +A modifier is a path component that performs custom processing on the +json. + +Multiple paths can be "chained" together using the pipe character. +This is useful for getting results from a modified query. + +For example, using the built-in `@reverse` modifier on the above json document, +we'll get `children` array and reverse the order: + +``` +"children|@reverse" >> ["Jack","Alex","Sara"] +"children|@reverse|0" >> "Jack" +``` + +There are currently the following built-in modifiers: + +- `@reverse`: Reverse an array or the members of an object. +- `@ugly`: Remove all whitespace from a json document. +- `@pretty`: Make the json document more human readable. +- `@this`: Returns the current element. It can be used to retrieve the root element. +- `@valid`: Ensure the json document is valid. +- `@flatten`: Flattens an array. +- `@join`: Joins multiple objects into a single object. + +### Modifier arguments + +A modifier may accept an optional argument. The argument can be a valid JSON +document or just characters. + +For example, the `@pretty` modifier takes a json object as its argument. + +``` +@pretty:{"sortKeys":true} +``` + +Which makes the json pretty and orders all of its keys. + +```json +{ + "age":37, + "children": ["Sara","Alex","Jack"], + "fav.movie": "Deer Hunter", + "friends": [ + {"age": 44, "first": "Dale", "last": "Murphy"}, + {"age": 68, "first": "Roger", "last": "Craig"}, + {"age": 47, "first": "Jane", "last": "Murphy"} + ], + "name": {"first": "Tom", "last": "Anderson"} +} +``` + +*The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. +Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information.* + +### Custom modifiers + +You can also add custom modifiers. + +For example, here we create a modifier that makes the entire json document upper +or lower case. + +```go +gjson.AddModifier("case", func(json, arg string) string { + if arg == "upper" { + return strings.ToUpper(json) + } + if arg == "lower" { + return strings.ToLower(json) + } + return json +}) +``` + +``` +"children|@case:upper" >> ["SARA","ALEX","JACK"] +"children|@case:lower|@reverse" >> ["jack","alex","sara"] +``` + +## JSON Lines + +There's support for [JSON Lines](http://jsonlines.org/) using the `..` prefix, which treats a multilined document as an array. + +For example: + +``` +{"name": "Gilbert", "age": 61} +{"name": "Alexa", "age": 34} +{"name": "May", "age": 57} +{"name": "Deloise", "age": 44} +``` + +``` +..# >> 4 +..1 >> {"name": "Alexa", "age": 34} +..3 >> {"name": "Deloise", "age": 44} +..#.name >> ["Gilbert","Alexa","May","Deloise"] +..#(name="May").age >> 57 +``` + +The `ForEachLines` function will iterate through JSON lines. + +```go +gjson.ForEachLine(json, func(line gjson.Result) bool{ + println(line.String()) + return true +}) +``` + ## Get nested array values Suppose you want all the last names from the following json: @@ -226,7 +320,7 @@ for _, name := range result.Array() { You can also query an object inside an array: ```go -name := gjson.Get(json, `programmers.#[lastName="Hunter"].firstName`) +name := gjson.Get(json, `programmers.#(lastName="Hunter").firstName`) println(name.String()) // prints "Elliotte" ``` diff --git a/vendor/github.com/tidwall/gjson/SYNTAX.md b/vendor/github.com/tidwall/gjson/SYNTAX.md new file mode 100644 index 00000000000..5ea0407f5ae --- /dev/null +++ b/vendor/github.com/tidwall/gjson/SYNTAX.md @@ -0,0 +1,277 @@ +# GJSON Path Syntax + +A GJSON Path is a text string syntax that describes a search pattern for quickly retreiving values from a JSON payload. + +This document is designed to explain the structure of a GJSON Path through examples. + +- [Path structure](#path-structure) +- [Basic](#basic) +- [Wildcards](#wildcards) +- [Escape Character](#escape-character) +- [Arrays](#arrays) +- [Queries](#queries) +- [Dot vs Pipe](#dot-vs-pipe) +- [Modifiers](#modifiers) +- [Multipaths](#multipaths) + +The definitive implemenation is [github.com/tidwall/gjson](https://github.com/tidwall/gjson). +Use the [GJSON Playground](https://gjson.dev) to experiment with the syntax online. + + +## Path structure + +A GJSON Path is intended to be easily expressed as a series of components seperated by a `.` character. + +Along with `.` character, there are a few more that have special meaning, including `|`, `#`, `@`, `\`, `*`, and `?`. + +## Example + +Given this JSON + +```json +{ + "name": {"first": "Tom", "last": "Anderson"}, + "age":37, + "children": ["Sara","Alex","Jack"], + "fav.movie": "Deer Hunter", + "friends": [ + {"first": "Dale", "last": "Murphy", "age": 44, "nets": ["ig", "fb", "tw"]}, + {"first": "Roger", "last": "Craig", "age": 68, "nets": ["fb", "tw"]}, + {"first": "Jane", "last": "Murphy", "age": 47, "nets": ["ig", "tw"]} + ] +} +``` + +The following GJSON Paths evaluate to the accompanying values. + +### Basic + +In many cases you'll just want to retreive values by object name or array index. + +```go +name.last "Anderson" +name.first "Tom" +age 37 +children ["Sara","Alex","Jack"] +children.0 "Sara" +children.1 "Alex" +friends.1 {"first": "Roger", "last": "Craig", "age": 68} +friends.1.first "Roger" +``` + +### Wildcards + +A key may contain the special wildcard characters `*` and `?`. +The `*` will match on any zero+ characters, and `?` matches on any one character. + +```go +child*.2 "Jack" +c?ildren.0 "Sara" +``` + +### Escape character + +Special purpose characters, such as `.`, `*`, and `?` can be escaped with `\`. + +```go +fav\.movie "Deer Hunter" +``` + +You'll also need to make sure that the `\` character is correctly escaped when hardcoding a path in source code. + +```go +res := gjson.Get(json, "fav\\.movie") // must escape the slash +res := gjson.Get(json, `fav\.movie`) // no need to escape the slash + +``` + +### Arrays + +The `#` character allows for digging into JSON Arrays. + +To get the length of an array you'll just use the `#` all by itself. + +```go +friends.# 3 +friends.#.age [44,68,47] +``` + +### Queries + +You can also query an array for the first match by using `#(...)`, or find all matches with `#(...)#`. +Queries support the `==`, `!=`, `<`, `<=`, `>`, `>=` comparison operators, +and the simple pattern matching `%` (like) and `!%` (not like) operators. + +```go +friends.#(last=="Murphy").first "Dale" +friends.#(last=="Murphy")#.first ["Dale","Jane"] +friends.#(age>45)#.last ["Craig","Murphy"] +friends.#(first%"D*").last "Murphy" +friends.#(first!%"D*").last "Craig" +``` + +To query for a non-object value in an array, you can forgo the string to the right of the operator. + +```go +children.#(!%"*a*") "Alex" +children.#(%"*a*")# ["Sara","Jack"] +``` + +Nested queries are allowed. + +```go +friends.#(nets.#(=="fb"))#.first >> ["Dale","Roger"] +``` + +*Please note that prior to v1.3.0, queries used the `#[...]` brackets. This was +changed in v1.3.0 as to avoid confusion with the new [multipath](#multipaths) +syntax. For backwards compatibility, `#[...]` will continue to work until the +next major release.* + +### Dot vs Pipe + +The `.` is standard separator, but it's also possible to use a `|`. +In most cases they both end up returning the same results. +The cases where`|` differs from `.` is when it's used after the `#` for [Arrays](#arrays) and [Queries](#queries). + +Here are some examples + +```go +friends.0.first "Dale" +friends|0.first "Dale" +friends.0|first "Dale" +friends|0|first "Dale" +friends|# 3 +friends.# 3 +friends.#(last="Murphy")# [{"first": "Dale", "last": "Murphy", "age": 44},{"first": "Jane", "last": "Murphy", "age": 47}] +friends.#(last="Murphy")#.first ["Dale","Jane"] +friends.#(last="Murphy")#|first +friends.#(last="Murphy")#.0 [] +friends.#(last="Murphy")#|0 {"first": "Dale", "last": "Murphy", "age": 44} +friends.#(last="Murphy")#.# [] +friends.#(last="Murphy")#|# 2 +``` + +Let's break down a few of these. + +The path `friends.#(last="Murphy")#` all by itself results in + +```json +[{"first": "Dale", "last": "Murphy", "age": 44},{"first": "Jane", "last": "Murphy", "age": 47}] +``` + +The `.first` suffix will process the `first` path on each array element *before* returning the results. Which becomes + +```json +["Dale","Jane"] +``` + +But the `|first` suffix actually processes the `first` path *after* the previous result. +Since the previous result is an array, not an object, it's not possible to process +because `first` does not exist. + +Yet, `|0` suffix returns + +```json +{"first": "Dale", "last": "Murphy", "age": 44} +``` + +Because `0` is the first index of the previous result. + +### Modifiers + +A modifier is a path component that performs custom processing on the JSON. + +For example, using the built-in `@reverse` modifier on the above JSON payload will reverse the `children` array: + +```go +children.@reverse ["Jack","Alex","Sara"] +children.@reverse.0 "Jack" +``` + +There are currently the following built-in modifiers: + +- `@reverse`: Reverse an array or the members of an object. +- `@ugly`: Remove all whitespace from JSON. +- `@pretty`: Make the JSON more human readable. +- `@this`: Returns the current element. It can be used to retrieve the root element. +- `@valid`: Ensure the json document is valid. +- `@flatten`: Flattens an array. +- `@join`: Joins multiple objects into a single object. + +#### Modifier arguments + +A modifier may accept an optional argument. The argument can be a valid JSON payload or just characters. + +For example, the `@pretty` modifier takes a json object as its argument. + +``` +@pretty:{"sortKeys":true} +``` + +Which makes the json pretty and orders all of its keys. + +```json +{ + "age":37, + "children": ["Sara","Alex","Jack"], + "fav.movie": "Deer Hunter", + "friends": [ + {"age": 44, "first": "Dale", "last": "Murphy"}, + {"age": 68, "first": "Roger", "last": "Craig"}, + {"age": 47, "first": "Jane", "last": "Murphy"} + ], + "name": {"first": "Tom", "last": "Anderson"} +} +``` + +*The full list of `@pretty` options are `sortKeys`, `indent`, `prefix`, and `width`. +Please see [Pretty Options](https://github.com/tidwall/pretty#customized-output) for more information.* + +#### Custom modifiers + +You can also add custom modifiers. + +For example, here we create a modifier which makes the entire JSON payload upper or lower case. + +```go +gjson.AddModifier("case", func(json, arg string) string { + if arg == "upper" { + return strings.ToUpper(json) + } + if arg == "lower" { + return strings.ToLower(json) + } + return json +}) +"children.@case:upper" ["SARA","ALEX","JACK"] +"children.@case:lower.@reverse" ["jack","alex","sara"] +``` + +### Multipaths + +Starting with v1.3.0, GJSON added the ability to join multiple paths together +to form new documents. Wrapping comma-separated paths between `{...}` or +`[...]` will result in a new array or object, respectively. + +For example, using the given multipath + +``` +{name.first,age,"the_murphys":friends.#(last="Murphy")#.first} +``` + +Here we selected the first name, age, and the first name for friends with the +last name "Murphy". + +You'll notice that an optional key can be provided, in this case +"the_murphys", to force assign a key to a value. Otherwise, the name of the +actual field will be used, in this case "first". If a name cannot be +determined, then "_" is used. + +This results in + +``` +{"first":"Tom","age":37,"the_murphys":["Dale","Jane"]} +``` + + diff --git a/vendor/github.com/tidwall/gjson/gjson.go b/vendor/github.com/tidwall/gjson/gjson.go index 74515ed507c..0b6dcb0981e 100644 --- a/vendor/github.com/tidwall/gjson/gjson.go +++ b/vendor/github.com/tidwall/gjson/gjson.go @@ -2,19 +2,17 @@ package gjson import ( - "encoding/base64" "encoding/json" - "errors" "reflect" "strconv" "strings" - "sync" - "sync/atomic" "time" "unicode/utf16" "unicode/utf8" + "unsafe" "github.com/tidwall/match" + "github.com/tidwall/pretty" ) // Type is Result type @@ -186,8 +184,9 @@ func (t Result) Time() time.Time { } // Array returns back an array of values. -// If the result represents a non-existent value, then an empty array will be returned. -// If the result is not a JSON array, the return value will be an array containing one result. +// If the result represents a non-existent value, then an empty array will be +// returned. If the result is not a JSON array, the return value will be an +// array containing one result. func (t Result) Array() []Result { if t.Type == Null { return []Result{} @@ -210,10 +209,11 @@ func (t Result) IsArray() bool { } // ForEach iterates through values. -// If the result represents a non-existent value, then no values will be iterated. -// If the result is an Object, the iterator will pass the key and value of each item. -// If the result is an Array, the iterator will only pass the value of each item. -// If the result is not a JSON array or object, the iterator will pass back one value equal to the result. +// If the result represents a non-existent value, then no values will be +// iterated. If the result is an Object, the iterator will pass the key and +// value of each item. If the result is an Array, the iterator will only pass +// the value of each item. If the result is not a JSON array or object, the +// iterator will pass back one value equal to the result. func (t Result) ForEach(iterator func(key, value Result) bool) { if !t.Exists() { return @@ -461,11 +461,13 @@ func ParseBytes(json []byte) Result { } func squash(json string) string { - // expects that the lead character is a '[' or '{' + // expects that the lead character is a '[' or '{' or '(' or '"' // squash the value, ignoring all nested arrays and objects. - // the first '[' or '{' has already been read - depth := 1 - for i := 1; i < len(json); i++ { + var i, depth int + if json[0] != '"' { + i, depth = 1, 1 + } + for ; i < len(json); i++ { if json[i] >= '"' && json[i] <= '}' { switch json[i] { case '"': @@ -492,9 +494,12 @@ func squash(json string) string { break } } - case '{', '[': + if depth == 0 { + return json[:i+1] + } + case '{', '[', '(': depth++ - case '}', ']': + case '}', ']', ')': depth-- if depth == 0 { return json[:i+1] @@ -674,7 +679,8 @@ func parseNumber(json string, i int) (int, string) { var s = i i++ for ; i < len(json); i++ { - if json[i] <= ' ' || json[i] == ',' || json[i] == ']' || json[i] == '}' { + if json[i] <= ' ' || json[i] == ',' || json[i] == ']' || + json[i] == '}' { return i, json[s:i] } } @@ -695,6 +701,8 @@ func parseLiteral(json string, i int) (int, string) { type arrayPathResult struct { part string path string + pipe string + piped bool more bool alogok bool arrch bool @@ -710,6 +718,12 @@ type arrayPathResult struct { func parseArrayPath(path string) (r arrayPathResult) { for i := 0; i < len(path); i++ { + if path[i] == '|' { + r.part = path[:i] + r.pipe = path[i+1:] + r.piped = true + return + } if path[i] == '.' { r.part = path[:i] r.path = path[i+1:] @@ -723,100 +737,122 @@ func parseArrayPath(path string) (r arrayPathResult) { r.alogok = true r.alogkey = path[2:] r.path = path[:1] - } else if path[1] == '[' { - r.query.on = true + } else if path[1] == '[' || path[1] == '(' { // query - i += 2 - // whitespace - for ; i < len(path); i++ { - if path[i] > ' ' { + r.query.on = true + if true { + qpath, op, value, _, fi, ok := parseQuery(path[i:]) + if !ok { + // bad query, end now break } - } - s := i - for ; i < len(path); i++ { - if path[i] <= ' ' || - path[i] == '!' || - path[i] == '=' || - path[i] == '<' || - path[i] == '>' || - path[i] == '%' || - path[i] == ']' { - break + r.query.path = qpath + r.query.op = op + r.query.value = value + i = fi - 1 + if i+1 < len(path) && path[i+1] == '#' { + r.query.all = true } - } - r.query.path = path[s:i] - // whitespace - for ; i < len(path); i++ { - if path[i] > ' ' { - break + } else { + var end byte + if path[1] == '[' { + end = ']' + } else { + end = ')' } - } - if i < len(path) { - s = i - if path[i] == '!' { - if i < len(path)-1 && path[i+1] == '=' { - i++ - } - } else if path[i] == '<' || path[i] == '>' { - if i < len(path)-1 && path[i+1] == '=' { - i++ + i += 2 + // whitespace + for ; i < len(path); i++ { + if path[i] > ' ' { + break } - } else if path[i] == '=' { - if i < len(path)-1 && path[i+1] == '=' { - s++ - i++ + } + s := i + for ; i < len(path); i++ { + if path[i] <= ' ' || + path[i] == '!' || + path[i] == '=' || + path[i] == '<' || + path[i] == '>' || + path[i] == '%' || + path[i] == end { + break } } - i++ - r.query.op = path[s:i] + r.query.path = path[s:i] // whitespace for ; i < len(path); i++ { if path[i] > ' ' { break } } - s = i - for ; i < len(path); i++ { - if path[i] == '"' { - i++ - s2 := i - for ; i < len(path); i++ { - if path[i] > '\\' { - continue - } - if path[i] == '"' { - // look for an escaped slash - if path[i-1] == '\\' { - n := 0 - for j := i - 2; j > s2-1; j-- { - if path[j] != '\\' { - break + if i < len(path) { + s = i + if path[i] == '!' { + if i < len(path)-1 && (path[i+1] == '=' || + path[i+1] == '%') { + i++ + } + } else if path[i] == '<' || path[i] == '>' { + if i < len(path)-1 && path[i+1] == '=' { + i++ + } + } else if path[i] == '=' { + if i < len(path)-1 && path[i+1] == '=' { + s++ + i++ + } + } + i++ + r.query.op = path[s:i] + // whitespace + for ; i < len(path); i++ { + if path[i] > ' ' { + break + } + } + s = i + for ; i < len(path); i++ { + if path[i] == '"' { + i++ + s2 := i + for ; i < len(path); i++ { + if path[i] > '\\' { + continue + } + if path[i] == '"' { + // look for an escaped slash + if path[i-1] == '\\' { + n := 0 + for j := i - 2; j > s2-1; j-- { + if path[j] != '\\' { + break + } + n++ + } + if n%2 == 0 { + continue } - n++ - } - if n%2 == 0 { - continue } + break } - break } + } else if path[i] == end { + if i+1 < len(path) && path[i+1] == '#' { + r.query.all = true + } + break } - } else if path[i] == ']' { - if i+1 < len(path) && path[i+1] == '#' { - r.query.all = true - } - break } + if i > len(path) { + i = len(path) + } + v := path[s:i] + for len(v) > 0 && v[len(v)-1] <= ' ' { + v = v[:len(v)-1] + } + r.query.value = v } - if i > len(path) { - i = len(path) - } - v := path[s:i] - for len(v) > 0 && v[len(v)-1] <= ' ' { - v = v[:len(v)-1] - } - r.query.value = v } } } @@ -828,19 +864,145 @@ func parseArrayPath(path string) (r arrayPathResult) { return } +// splitQuery takes a query and splits it into three parts: +// path, op, middle, and right. +// So for this query: +// #(first_name=="Murphy").last +// Becomes +// first_name # path +// =="Murphy" # middle +// .last # right +// Or, +// #(service_roles.#(=="one")).cap +// Becomes +// service_roles.#(=="one") # path +// # middle +// .cap # right +func parseQuery(query string) ( + path, op, value, remain string, i int, ok bool, +) { + if len(query) < 2 || query[0] != '#' || + (query[1] != '(' && query[1] != '[') { + return "", "", "", "", i, false + } + i = 2 + j := 0 // start of value part + depth := 1 + for ; i < len(query); i++ { + if depth == 1 && j == 0 { + switch query[i] { + case '!', '=', '<', '>', '%': + // start of the value part + j = i + continue + } + } + if query[i] == '\\' { + i++ + } else if query[i] == '[' || query[i] == '(' { + depth++ + } else if query[i] == ']' || query[i] == ')' { + depth-- + if depth == 0 { + break + } + } else if query[i] == '"' { + // inside selector string, balance quotes + i++ + for ; i < len(query); i++ { + if query[i] == '\\' { + i++ + } else if query[i] == '"' { + break + } + } + } + } + if depth > 0 { + return "", "", "", "", i, false + } + if j > 0 { + path = trim(query[2:j]) + value = trim(query[j:i]) + remain = query[i+1:] + // parse the compare op from the value + var opsz int + switch { + case len(value) == 1: + opsz = 1 + case value[0] == '!' && value[1] == '=': + opsz = 2 + case value[0] == '!' && value[1] == '%': + opsz = 2 + case value[0] == '<' && value[1] == '=': + opsz = 2 + case value[0] == '>' && value[1] == '=': + opsz = 2 + case value[0] == '=' && value[1] == '=': + value = value[1:] + opsz = 1 + case value[0] == '<': + opsz = 1 + case value[0] == '>': + opsz = 1 + case value[0] == '=': + opsz = 1 + case value[0] == '%': + opsz = 1 + } + op = value[:opsz] + value = trim(value[opsz:]) + } else { + path = trim(query[2:i]) + remain = query[i+1:] + } + return path, op, value, remain, i + 1, true +} + +func trim(s string) string { +left: + if len(s) > 0 && s[0] <= ' ' { + s = s[1:] + goto left + } +right: + if len(s) > 0 && s[len(s)-1] <= ' ' { + s = s[:len(s)-1] + goto right + } + return s +} + type objectPathResult struct { - part string - path string - wild bool - more bool + part string + path string + pipe string + piped bool + wild bool + more bool } func parseObjectPath(path string) (r objectPathResult) { for i := 0; i < len(path); i++ { + if path[i] == '|' { + r.part = path[:i] + r.pipe = path[i+1:] + r.piped = true + return + } if path[i] == '.' { + // peek at the next byte and see if it's a '@', '[', or '{'. r.part = path[:i] - r.path = path[i+1:] - r.more = true + if !DisableModifiers && + i < len(path)-1 && + (path[i+1] == '@' || + path[i+1] == '[' || path[i+1] == '{') { + r.pipe = path[i+1:] + r.piped = true + } else { + r.path = path[i+1:] + r.more = true + } return } if path[i] == '*' || path[i] == '?' { @@ -864,9 +1026,22 @@ func parseObjectPath(path string) (r objectPathResult) { continue } else if path[i] == '.' { r.part = string(epart) - r.path = path[i+1:] + // peek at the next byte and see if it's a '@' modifier + if !DisableModifiers && + i < len(path)-1 && path[i+1] == '@' { + r.pipe = path[i+1:] + r.piped = true + } else { + r.path = path[i+1:] + r.more = true + } r.more = true return + } else if path[i] == '|' { + r.part = string(epart) + r.pipe = path[i+1:] + r.piped = true + return } else if path[i] == '*' || path[i] == '?' { r.wild = true } @@ -883,9 +1058,9 @@ func parseObjectPath(path string) (r objectPathResult) { } func parseSquash(json string, i int) (int, string) { - // expects that the lead character is a '[' or '{' + // expects that the lead character is a '[' or '{' or '(' // squash the value, ignoring all nested arrays and objects. - // the first '[' or '{' has already been read + // the first '[' or '{' or '(' has already been read s := i i++ depth := 1 @@ -916,9 +1091,9 @@ func parseSquash(json string, i int) (int, string) { break } } - case '{', '[': + case '{', '[', '(': depth++ - case '}', ']': + case '}', ']', ')': depth-- if depth == 0 { i++ @@ -934,6 +1109,10 @@ func parseObject(c *parseContext, i int, path string) (int, bool) { var pmatch, kesc, vesc, ok, hit bool var key, val string rp := parseObjectPath(path) + if !rp.more && rp.piped { + c.pipe = rp.pipe + c.piped = true + } for i < len(c.json) { for ; i < len(c.json); i++ { if c.json[i] == '"' { @@ -1082,6 +1261,16 @@ func queryMatches(rp *arrayPathResult, value Result) bool { if len(rpv) > 2 && rpv[0] == '"' && rpv[len(rpv)-1] == '"' { rpv = rpv[1 : len(rpv)-1] } + if !value.Exists() { + return false + } + if rp.query.op == "" { + // the query is only looking for existence, such as: + // friends.#(name) + // which makes sure that the array "friends" has an element of + // "name" that exists + return true + } switch value.Type { case String: switch rp.query.op { @@ -1099,6 +1288,8 @@ func queryMatches(rp *arrayPathResult, value Result) bool { return value.Str >= rpv case "%": return match.Match(value.Str, rpv) + case "!%": + return !match.Match(value.Str, rpv) } case Number: rpvn, _ := strconv.ParseFloat(rpv, 64) @@ -1157,6 +1348,57 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { partidx = int(n) } } + if !rp.more && rp.piped { + c.pipe = rp.pipe + c.piped = true + } + + procQuery := func(qval Result) bool { + if rp.query.all { + if len(multires) == 0 { + multires = append(multires, '[') + } + } + var res Result + if qval.Type == JSON { + res = qval.Get(rp.query.path) + } else { + if rp.query.path != "" { + return false + } + res = qval + } + if queryMatches(&rp, res) { + if rp.more { + left, right, ok := splitPossiblePipe(rp.path) + if ok { + rp.path = left + c.pipe = right + c.piped = true + } + res = qval.Get(rp.path) + } else { + res = qval + } + if rp.query.all { + raw := res.Raw + if len(raw) == 0 { + raw = res.String() + } + if raw != "" { + if len(multires) > 1 { + multires = append(multires, ',') + } + multires = append(multires, raw...) + } + } else { + c.value = res + return true + } + } + return false + } + for i < len(c.json)+1 { if !rp.arrch { pmatch = partidx == h @@ -1184,7 +1426,19 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { if !ok { return i, false } - if hit { + if rp.query.on { + var qval Result + if vesc { + qval.Str = unescape(val[1 : len(val)-1]) + } else { + qval.Str = val[1 : len(val)-1] + } + qval.Raw = val + qval.Type = String + if procQuery(qval) { + return i, true + } + } else if hit { if rp.alogok { break } @@ -1209,24 +1463,8 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { } else { i, val = parseSquash(c.json, i) if rp.query.on { - res := Get(val, rp.query.path) - if queryMatches(&rp, res) { - if rp.more { - res = Get(val, rp.path) - } else { - res = Result{Raw: val, Type: JSON} - } - if rp.query.all { - if len(multires) == 0 { - multires = append(multires, '[') - } else { - multires = append(multires, ',') - } - multires = append(multires, res.Raw...) - } else { - c.value = res - return i, true - } + if procQuery(Result{Raw: val, Type: JSON}) { + return i, true } } else if hit { if rp.alogok { @@ -1248,7 +1486,11 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { } } else { i, val = parseSquash(c.json, i) - if hit { + if rp.query.on { + if procQuery(Result{Raw: val, Type: JSON}) { + return i, true + } + } else if hit { if rp.alogok { break } @@ -1259,7 +1501,15 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { } case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': i, val = parseNumber(c.json, i) - if hit { + if rp.query.on { + var qval Result + qval.Raw = val + qval.Type = Number + qval.Num, _ = strconv.ParseFloat(val, 64) + if procQuery(qval) { + return i, true + } + } else if hit { if rp.alogok { break } @@ -1271,7 +1521,19 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { case 't', 'f', 'n': vc := c.json[i] i, val = parseLiteral(c.json, i) - if hit { + if rp.query.on { + var qval Result + qval.Raw = val + switch vc { + case 't': + qval.Type = True + case 'f': + qval.Type = False + } + if procQuery(qval) { + return i, true + } + } else if hit { if rp.alogok { break } @@ -1287,19 +1549,39 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { case ']': if rp.arrch && rp.part == "#" { if rp.alogok { + left, right, ok := splitPossiblePipe(rp.alogkey) + if ok { + rp.alogkey = left + c.pipe = right + c.piped = true + } var jsons = make([]byte, 0, 64) jsons = append(jsons, '[') - for j, k := 0, 0; j < len(alog); j++ { - _, res, ok := parseAny(c.json, alog[j], true) - if ok { - res := res.Get(rp.alogkey) - if res.Exists() { - if k > 0 { - jsons = append(jsons, ',') + idx := alog[j] + for idx < len(c.json) { + switch c.json[idx] { + case ' ', '\t', '\r', '\n': + idx++ + continue + } + break + } + if idx < len(c.json) && c.json[idx] != ']' { + _, res, ok := parseAny(c.json, idx, true) + if ok { + res := res.Get(rp.alogkey) + if res.Exists() { + if k > 0 { + jsons = append(jsons, ',') + } + raw := res.Raw + if len(raw) == 0 { + raw = res.String() + } + jsons = append(jsons, []byte(raw)...) + k++ } - jsons = append(jsons, []byte(res.Raw)...) - k++ } } } @@ -1311,9 +1593,10 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { if rp.alogok { break } - c.value.Raw = "" + c.value.Type = Number c.value.Num = float64(h - 1) + c.value.Raw = strconv.Itoa(h - 1) c.calcd = true return i + 1, true } @@ -1331,6 +1614,88 @@ func parseArray(c *parseContext, i int, path string) (int, bool) { return i, false } +func splitPossiblePipe(path string) (left, right string, ok bool) { + // take a quick peek for the pipe character. If found we'll split the piped + // part of the path into the c.pipe field and shorten the rp. + var possible bool + for i := 0; i < len(path); i++ { + if path[i] == '|' { + possible = true + break + } + } + if !possible { + return + } + + if len(path) > 0 && path[0] == '{' { + squashed := squash(path[1:]) + if len(squashed) < len(path)-1 { + squashed = path[:len(squashed)+1] + remain := path[len(squashed):] + if remain[0] == '|' { + return squashed, remain[1:], true + } + } + return + } + + // split the left and right side of the path with the pipe character as + // the delimiter. This is a little tricky because we'll need to basically + // parse the entire path. + for i := 0; i < len(path); i++ { + if path[i] == '\\' { + i++ + } else if path[i] == '.' { + if i == len(path)-1 { + return + } + if path[i+1] == '#' { + i += 2 + if i == len(path) { + return + } + if path[i] == '[' || path[i] == '(' { + var start, end byte + if path[i] == '[' { + start, end = '[', ']' + } else { + start, end = '(', ')' + } + // inside selector, balance brackets + i++ + depth := 1 + for ; i < len(path); i++ { + if path[i] == '\\' { + i++ + } else if path[i] == start { + depth++ + } else if path[i] == end { + depth-- + if depth == 0 { + break + } + } else if path[i] == '"' { + // inside selector string, balance quotes + i++ + for ; i < len(path); i++ { + if path[i] == '\\' { + i++ + } else if path[i] == '"' { + break + } + } + } + } + } + } + } else if path[i] == '|' { + return path[:i], path[i+1:], true + } + } + return +} + // ForEachLine iterates through lines of JSON as specified by the JSON Lines // format (http://jsonlines.org/). // Each line is returned as a GJSON Result. @@ -1348,9 +1713,120 @@ func ForEachLine(json string, iterator func(line Result) bool) { } } +type subSelector struct { + name string + path string +} + +// parseSubSelectors returns the subselectors belonging to a '[path1,path2]' or +// '{"field1":path1,"field2":path2}' type subSelection. It's expected that the +// first character in path is either '[' or '{', and has already been checked +// prior to calling this function. +func parseSubSelectors(path string) (sels []subSelector, out string, ok bool) { + modifer := 0 + depth := 1 + colon := 0 + start := 1 + i := 1 + pushSel := func() { + var sel subSelector + if colon == 0 { + sel.path = path[start:i] + } else { + sel.name = path[start:colon] + sel.path = path[colon+1 : i] + } + sels = append(sels, sel) + colon = 0 + start = i + 1 + } + for ; i < len(path); i++ { + switch path[i] { + case '\\': + i++ + case '@': + if modifer == 0 && i > 0 && (path[i-1] == '.' || path[i-1] == '|') { + modifer = i + } + case ':': + if modifer == 0 && colon == 0 && depth == 1 { + colon = i + } + case ',': + if depth == 1 { + pushSel() + } + case '"': + i++ + loop: + for ; i < len(path); i++ { + switch path[i] { + case '\\': + i++ + case '"': + break loop + } + } + case '[', '(', '{': + depth++ + case ']', ')', '}': + depth-- + if depth == 0 { + pushSel() + path = path[i+1:] + return sels, path, true + } + } + } + return +} + +// nameOfLast returns the name of the last component +func nameOfLast(path string) string { + for i := len(path) - 1; i >= 0; i-- { + if path[i] == '|' || path[i] == '.' { + if i > 0 { + if path[i-1] == '\\' { + continue + } + } + return path[i+1:] + } + } + return path +} + +func isSimpleName(component string) bool { + for i := 0; i < len(component); i++ { + if component[i] < ' ' { + return false + } + switch component[i] { + case '[', ']', '{', '}', '(', ')', '#', '|': + return false + } + } + return true +} + +func appendJSONString(dst []byte, s string) []byte { + for i := 0; i < len(s); i++ { + if s[i] < ' ' || s[i] == '\\' || s[i] == '"' || s[i] > 126 { + d, _ := json.Marshal(s) + return append(dst, string(d)...) + } + } + dst = append(dst, '"') + dst = append(dst, s...) + dst = append(dst, '"') + return dst +} + type parseContext struct { json string value Result + pipe string + piped bool calcd bool lines bool } @@ -1362,7 +1838,8 @@ type parseContext struct { // A path is a series of keys searated by a dot. // A key may contain special wildcard characters '*' and '?'. // To access an array value use the index as the key. -// To get the number of elements in an array or to access a child path, use the '#' character. +// To get the number of elements in an array or to access a child path, use +// the '#' character. // The dot and wildcard character can be escaped with '\'. // // { @@ -1388,6 +1865,86 @@ type parseContext struct { // If you are consuming JSON from an unpredictable source then you may want to // use the Valid function first. func Get(json, path string) Result { + if len(path) > 1 { + if !DisableModifiers { + if path[0] == '@' { + // possible modifier + var ok bool + var npath string + var rjson string + npath, rjson, ok = execModifier(json, path) + if ok { + path = npath + if len(path) > 0 && (path[0] == '|' || path[0] == '.') { + res := Get(rjson, path[1:]) + res.Index = 0 + return res + } + return Parse(rjson) + } + } + } + if path[0] == '[' || path[0] == '{' { + // using a subselector path + kind := path[0] + var ok bool + var subs []subSelector + subs, path, ok = parseSubSelectors(path) + if ok { + if len(path) == 0 || (path[0] == '|' || path[0] == '.') { + var b []byte + b = append(b, kind) + var i int + for _, sub := range subs { + res := Get(json, sub.path) + if res.Exists() { + if i > 0 { + b = append(b, ',') + } + if kind == '{' { + if len(sub.name) > 0 { + if sub.name[0] == '"' && Valid(sub.name) { + b = append(b, sub.name...) + } else { + b = appendJSONString(b, sub.name) + } + } else { + last := nameOfLast(sub.path) + if isSimpleName(last) { + b = appendJSONString(b, last) + } else { + b = appendJSONString(b, "_") + } + } + b = append(b, ':') + } + var raw string + if len(res.Raw) == 0 { + raw = res.String() + if len(raw) == 0 { + raw = "null" + } + } else { + raw = res.Raw + } + b = append(b, raw...) + i++ + } + } + b = append(b, kind+2) + var res Result + res.Raw = string(b) + res.Type = JSON + if len(path) > 0 { + res = res.Get(path[1:]) + } + res.Index = 0 + return res + } + } + } + } + var i int var c = &parseContext{json: json} if len(path) >= 2 && path[0] == '.' && path[1] == '.' { @@ -1407,6 +1964,11 @@ func Get(json, path string) Result { } } } + if c.piped { + res := c.value.Get(c.pipe) + res.Index = 0 + return res + } fillIndex(json, c) return c.value } @@ -1424,7 +1986,7 @@ func runeit(json string) rune { } // unescape unescapes a string -func unescape(json string) string { //, error) { +func unescape(json string) string { var str = make([]byte, 0, len(json)) for i := 0; i < len(json); i++ { switch { @@ -1464,7 +2026,8 @@ func unescape(json string) string { //, error) { i += 5 if utf16.IsSurrogate(r) { // need another code - if len(json[i:]) >= 6 && json[i] == '\\' && json[i+1] == 'u' { + if len(json[i:]) >= 6 && json[i] == '\\' && + json[i+1] == 'u' { // we expect it to be correct so just consume it r = utf16.DecodeRune(r, runeit(json[i+2:])) i += 6 @@ -1626,141 +2189,11 @@ func GetMany(json string, path ...string) []Result { // The return value is a Result array where the number of items // will be equal to the number of input paths. func GetManyBytes(json []byte, path ...string) []Result { - return GetMany(string(json), path...) -} - -var fieldsmu sync.RWMutex -var fields = make(map[string]map[string]int) - -func assign(jsval Result, goval reflect.Value) { - if jsval.Type == Null { - return - } - switch goval.Kind() { - default: - case reflect.Ptr: - if !goval.IsNil() { - newval := reflect.New(goval.Elem().Type()) - assign(jsval, newval.Elem()) - goval.Elem().Set(newval.Elem()) - } else { - newval := reflect.New(goval.Type().Elem()) - assign(jsval, newval.Elem()) - goval.Set(newval) - } - case reflect.Struct: - fieldsmu.RLock() - sf := fields[goval.Type().String()] - fieldsmu.RUnlock() - if sf == nil { - fieldsmu.Lock() - sf = make(map[string]int) - for i := 0; i < goval.Type().NumField(); i++ { - f := goval.Type().Field(i) - tag := strings.Split(f.Tag.Get("json"), ",")[0] - if tag != "-" { - if tag != "" { - sf[tag] = i - sf[f.Name] = i - } else { - sf[f.Name] = i - } - } - } - fields[goval.Type().String()] = sf - fieldsmu.Unlock() - } - jsval.ForEach(func(key, value Result) bool { - if idx, ok := sf[key.Str]; ok { - f := goval.Field(idx) - if f.CanSet() { - assign(value, f) - } - } - return true - }) - case reflect.Slice: - if goval.Type().Elem().Kind() == reflect.Uint8 && jsval.Type == String { - data, _ := base64.StdEncoding.DecodeString(jsval.String()) - goval.Set(reflect.ValueOf(data)) - } else { - jsvals := jsval.Array() - slice := reflect.MakeSlice(goval.Type(), len(jsvals), len(jsvals)) - for i := 0; i < len(jsvals); i++ { - assign(jsvals[i], slice.Index(i)) - } - goval.Set(slice) - } - case reflect.Array: - i, n := 0, goval.Len() - jsval.ForEach(func(_, value Result) bool { - if i == n { - return false - } - assign(value, goval.Index(i)) - i++ - return true - }) - case reflect.Map: - if goval.Type().Key().Kind() == reflect.String && goval.Type().Elem().Kind() == reflect.Interface { - goval.Set(reflect.ValueOf(jsval.Value())) - } - case reflect.Interface: - goval.Set(reflect.ValueOf(jsval.Value())) - case reflect.Bool: - goval.SetBool(jsval.Bool()) - case reflect.Float32, reflect.Float64: - goval.SetFloat(jsval.Float()) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - goval.SetInt(jsval.Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - goval.SetUint(jsval.Uint()) - case reflect.String: - goval.SetString(jsval.String()) - } - if len(goval.Type().PkgPath()) > 0 { - v := goval.Addr() - if v.Type().NumMethod() > 0 { - if u, ok := v.Interface().(json.Unmarshaler); ok { - u.UnmarshalJSON([]byte(jsval.Raw)) - } - } - } -} - -var validate uintptr = 1 - -// UnmarshalValidationEnabled provides the option to disable JSON validation -// during the Unmarshal routine. Validation is enabled by default. -// -// Deprecated: Use encoder/json.Unmarshal instead -func UnmarshalValidationEnabled(enabled bool) { - if enabled { - atomic.StoreUintptr(&validate, 1) - } else { - atomic.StoreUintptr(&validate, 0) - } -} - -// Unmarshal loads the JSON data into the value pointed to by v. -// -// This function works almost identically to json.Unmarshal except that -// gjson.Unmarshal will automatically attempt to convert JSON values to any Go -// type. For example, the JSON string "100" or the JSON number 100 can be equally -// assigned to Go string, int, byte, uint64, etc. This rule applies to all types. -// -// Deprecated: Use encoder/json.Unmarshal instead -func Unmarshal(data []byte, v interface{}) error { - if atomic.LoadUintptr(&validate) == 1 { - _, ok := validpayload(data, 0) - if !ok { - return errors.New("invalid json") - } - } - if v := reflect.ValueOf(v); v.Kind() == reflect.Ptr { - assign(ParseBytes(data), v) + res := make([]Result, len(path)) + for i, path := range path { + res[i] = GetBytes(json, path) } - return nil + return res } func validpayload(data []byte, i int) (outi int, ok bool) { @@ -2006,19 +2439,22 @@ func validnumber(data []byte, i int) (outi int, ok bool) { } func validtrue(data []byte, i int) (outi int, ok bool) { - if i+3 <= len(data) && data[i] == 'r' && data[i+1] == 'u' && data[i+2] == 'e' { + if i+3 <= len(data) && data[i] == 'r' && data[i+1] == 'u' && + data[i+2] == 'e' { return i + 3, true } return i, false } func validfalse(data []byte, i int) (outi int, ok bool) { - if i+4 <= len(data) && data[i] == 'a' && data[i+1] == 'l' && data[i+2] == 's' && data[i+3] == 'e' { + if i+4 <= len(data) && data[i] == 'a' && data[i+1] == 'l' && + data[i+2] == 's' && data[i+3] == 'e' { return i + 4, true } return i, false } func validnull(data []byte, i int) (outi int, ok bool) { - if i+3 <= len(data) && data[i] == 'u' && data[i+1] == 'l' && data[i+2] == 'l' { + if i+3 <= len(data) && data[i] == 'u' && data[i+1] == 'l' && + data[i+2] == 'l' { return i + 3, true } return i, false @@ -2032,7 +2468,7 @@ func validnull(data []byte, i int) (outi int, ok bool) { // value := gjson.Get(json, "name.last") // func Valid(json string) bool { - _, ok := validpayload([]byte(json), 0) + _, ok := validpayload(stringBytes(json), 0) return ok } @@ -2043,7 +2479,7 @@ func Valid(json string) bool { // } // value := gjson.Get(json, "name.last") // -// If working with bytes, this method preferred over Valid(string(data)) +// If working with bytes, this method preferred over ValidBytes(string(data)) // func ValidBytes(json []byte) bool { _, ok := validpayload(json, 0) @@ -2108,3 +2544,355 @@ func floatToInt(f float64) (n int64, ok bool) { } return 0, false } + +// execModifier parses the path to find a matching modifier function. +// then input expects that the path already starts with a '@' +func execModifier(json, path string) (pathOut, res string, ok bool) { + name := path[1:] + var hasArgs bool + for i := 1; i < len(path); i++ { + if path[i] == ':' { + pathOut = path[i+1:] + name = path[1:i] + hasArgs = len(pathOut) > 0 + break + } + if path[i] == '|' { + pathOut = path[i:] + name = path[1:i] + break + } + if path[i] == '.' { + pathOut = path[i:] + name = path[1:i] + break + } + } + if fn, ok := modifiers[name]; ok { + var args string + if hasArgs { + var parsedArgs bool + switch pathOut[0] { + case '{', '[', '"': + res := Parse(pathOut) + if res.Exists() { + args = squash(pathOut) + pathOut = pathOut[len(args):] + parsedArgs = true + } + } + if !parsedArgs { + idx := strings.IndexByte(pathOut, '|') + if idx == -1 { + args = pathOut + pathOut = "" + } else { + args = pathOut[:idx] + pathOut = pathOut[idx:] + } + } + } + return pathOut, fn(json, args), true + } + return pathOut, res, false +} + +// unwrap removes the '[]' or '{}' characters around json +func unwrap(json string) string { + json = trim(json) + if len(json) >= 2 && json[0] == '[' || json[0] == '{' { + json = json[1 : len(json)-1] + } + return json +} + +// DisableModifiers will disable the modifier syntax +var DisableModifiers = false + +var modifiers = map[string]func(json, arg string) string{ + "pretty": modPretty, + "ugly": modUgly, + "reverse": modReverse, + "this": modThis, + "flatten": modFlatten, + "join": modJoin, + "valid": modValid, +} + +// AddModifier binds a custom modifier command to the GJSON syntax. +// This operation is not thread safe and should be executed prior to +// using all other gjson function. +func AddModifier(name string, fn func(json, arg string) string) { + modifiers[name] = fn +} + +// ModifierExists returns true when the specified modifier exists. +func ModifierExists(name string, fn func(json, arg string) string) bool { + _, ok := modifiers[name] + return ok +} + +// @pretty modifier makes the json look nice. +func modPretty(json, arg string) string { + if len(arg) > 0 { + opts := *pretty.DefaultOptions + Parse(arg).ForEach(func(key, value Result) bool { + switch key.String() { + case "sortKeys": + opts.SortKeys = value.Bool() + case "indent": + opts.Indent = value.String() + case "prefix": + opts.Prefix = value.String() + case "width": + opts.Width = int(value.Int()) + } + return true + }) + return bytesString(pretty.PrettyOptions(stringBytes(json), &opts)) + } + return bytesString(pretty.Pretty(stringBytes(json))) +} + +// @this returns the current element. Can be used to retrieve the root element. +func modThis(json, arg string) string { + return json +} + +// @ugly modifier removes all whitespace. +func modUgly(json, arg string) string { + return bytesString(pretty.Ugly(stringBytes(json))) +} + +// @reverse reverses array elements or root object members. +func modReverse(json, arg string) string { + res := Parse(json) + if res.IsArray() { + var values []Result + res.ForEach(func(_, value Result) bool { + values = append(values, value) + return true + }) + out := make([]byte, 0, len(json)) + out = append(out, '[') + for i, j := len(values)-1, 0; i >= 0; i, j = i-1, j+1 { + if j > 0 { + out = append(out, ',') + } + out = append(out, values[i].Raw...) + } + out = append(out, ']') + return bytesString(out) + } + if res.IsObject() { + var keyValues []Result + res.ForEach(func(key, value Result) bool { + keyValues = append(keyValues, key, value) + return true + }) + out := make([]byte, 0, len(json)) + out = append(out, '{') + for i, j := len(keyValues)-2, 0; i >= 0; i, j = i-2, j+1 { + if j > 0 { + out = append(out, ',') + } + out = append(out, keyValues[i+0].Raw...) + out = append(out, ':') + out = append(out, keyValues[i+1].Raw...) + } + out = append(out, '}') + return bytesString(out) + } + return json +} + +// @flatten an array with child arrays. +// [1,[2],[3,4],[5,[6,7]]] -> [1,2,3,4,5,[6,7]] +// The {"deep":true} arg can be provide for deep flattening. +// [1,[2],[3,4],[5,[6,7]]] -> [1,2,3,4,5,6,7] +// The original json is returned when the json is not an array. +func modFlatten(json, arg string) string { + res := Parse(json) + if !res.IsArray() { + return json + } + var deep bool + if arg != "" { + Parse(arg).ForEach(func(key, value Result) bool { + if key.String() == "deep" { + deep = value.Bool() + } + return true + }) + } + var out []byte + out = append(out, '[') + var idx int + res.ForEach(func(_, value Result) bool { + if idx > 0 { + out = append(out, ',') + } + if value.IsArray() { + if deep { + out = append(out, unwrap(modFlatten(value.Raw, arg))...) + } else { + out = append(out, unwrap(value.Raw)...) + } + } else { + out = append(out, value.Raw...) + } + idx++ + return true + }) + out = append(out, ']') + return bytesString(out) +} + +// @join multiple objects into a single object. +// [{"first":"Tom"},{"last":"Smith"}] -> {"first","Tom","last":"Smith"} +// The arg can be "true" to specify that duplicate keys should be preserved. +// [{"first":"Tom","age":37},{"age":41}] -> {"first","Tom","age":37,"age":41} +// Without preserved keys: +// [{"first":"Tom","age":37},{"age":41}] -> {"first","Tom","age":41} +// The original json is returned when the json is not an object. +func modJoin(json, arg string) string { + res := Parse(json) + if !res.IsArray() { + return json + } + var preserve bool + if arg != "" { + Parse(arg).ForEach(func(key, value Result) bool { + if key.String() == "preserve" { + preserve = value.Bool() + } + return true + }) + } + var out []byte + out = append(out, '{') + if preserve { + // Preserve duplicate keys. + var idx int + res.ForEach(func(_, value Result) bool { + if !value.IsObject() { + return true + } + if idx > 0 { + out = append(out, ',') + } + out = append(out, unwrap(value.Raw)...) + idx++ + return true + }) + } else { + // Deduplicate keys and generate an object with stable ordering. + var keys []Result + kvals := make(map[string]Result) + res.ForEach(func(_, value Result) bool { + if !value.IsObject() { + return true + } + value.ForEach(func(key, value Result) bool { + k := key.String() + if _, ok := kvals[k]; !ok { + keys = append(keys, key) + } + kvals[k] = value + return true + }) + return true + }) + for i := 0; i < len(keys); i++ { + if i > 0 { + out = append(out, ',') + } + out = append(out, keys[i].Raw...) + out = append(out, ':') + out = append(out, kvals[keys[i].String()].Raw...) + } + } + out = append(out, '}') + return bytesString(out) +} + +// @valid ensures that the json is valid before moving on. An empty string is +// returned when the json is not valid, otherwise it returns the original json. +func modValid(json, arg string) string { + if !Valid(json) { + return "" + } + return json +} + +// getBytes casts the input json bytes to a string and safely returns the +// results as uniquely allocated data. This operation is intended to minimize +// copies and allocations for the large json string->[]byte. +func getBytes(json []byte, path string) Result { + var result Result + if json != nil { + // unsafe cast to string + result = Get(*(*string)(unsafe.Pointer(&json)), path) + // safely get the string headers + rawhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Raw)) + strhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Str)) + // create byte slice headers + rawh := reflect.SliceHeader{Data: rawhi.Data, Len: rawhi.Len} + strh := reflect.SliceHeader{Data: strhi.Data, Len: strhi.Len} + if strh.Data == 0 { + // str is nil + if rawh.Data == 0 { + // raw is nil + result.Raw = "" + } else { + // raw has data, safely copy the slice header to a string + result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) + } + result.Str = "" + } else if rawh.Data == 0 { + // raw is nil + result.Raw = "" + // str has data, safely copy the slice header to a string + result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) + } else if strh.Data >= rawh.Data && + int(strh.Data)+strh.Len <= int(rawh.Data)+rawh.Len { + // Str is a substring of Raw. + start := int(strh.Data - rawh.Data) + // safely copy the raw slice header + result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) + // substring the raw + result.Str = result.Raw[start : start+strh.Len] + } else { + // safely copy both the raw and str slice headers to strings + result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) + result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) + } + } + return result +} + +// fillIndex finds the position of Raw data and assigns it to the Index field +// of the resulting value. If the position cannot be found then Index zero is +// used instead. +func fillIndex(json string, c *parseContext) { + if len(c.value.Raw) > 0 && !c.calcd { + jhdr := *(*reflect.StringHeader)(unsafe.Pointer(&json)) + rhdr := *(*reflect.StringHeader)(unsafe.Pointer(&(c.value.Raw))) + c.value.Index = int(rhdr.Data - jhdr.Data) + if c.value.Index < 0 || c.value.Index >= len(json) { + c.value.Index = 0 + } + } +} + +func stringBytes(s string) []byte { + return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ + Data: (*reflect.StringHeader)(unsafe.Pointer(&s)).Data, + Len: len(s), + Cap: len(s), + })) +} + +func bytesString(b []byte) string { + return *(*string)(unsafe.Pointer(&b)) +} diff --git a/vendor/github.com/tidwall/gjson/gjson_gae.go b/vendor/github.com/tidwall/gjson/gjson_gae.go deleted file mode 100644 index cbe2ab420b7..00000000000 --- a/vendor/github.com/tidwall/gjson/gjson_gae.go +++ /dev/null @@ -1,10 +0,0 @@ -//+build appengine - -package gjson - -func getBytes(json []byte, path string) Result { - return Get(string(json), path) -} -func fillIndex(json string, c *parseContext) { - // noop. Use zero for the Index value. -} diff --git a/vendor/github.com/tidwall/gjson/gjson_ngae.go b/vendor/github.com/tidwall/gjson/gjson_ngae.go deleted file mode 100644 index ff313a78796..00000000000 --- a/vendor/github.com/tidwall/gjson/gjson_ngae.go +++ /dev/null @@ -1,73 +0,0 @@ -//+build !appengine - -package gjson - -import ( - "reflect" - "unsafe" -) - -// getBytes casts the input json bytes to a string and safely returns the -// results as uniquely allocated data. This operation is intended to minimize -// copies and allocations for the large json string->[]byte. -func getBytes(json []byte, path string) Result { - var result Result - if json != nil { - // unsafe cast to string - result = Get(*(*string)(unsafe.Pointer(&json)), path) - result = fromBytesGet(result) - } - return result -} - -func fromBytesGet(result Result) Result { - // safely get the string headers - rawhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Raw)) - strhi := *(*reflect.StringHeader)(unsafe.Pointer(&result.Str)) - // create byte slice headers - rawh := reflect.SliceHeader{Data: rawhi.Data, Len: rawhi.Len} - strh := reflect.SliceHeader{Data: strhi.Data, Len: strhi.Len} - if strh.Data == 0 { - // str is nil - if rawh.Data == 0 { - // raw is nil - result.Raw = "" - } else { - // raw has data, safely copy the slice header to a string - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - } - result.Str = "" - } else if rawh.Data == 0 { - // raw is nil - result.Raw = "" - // str has data, safely copy the slice header to a string - result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) - } else if strh.Data >= rawh.Data && - int(strh.Data)+strh.Len <= int(rawh.Data)+rawh.Len { - // Str is a substring of Raw. - start := int(strh.Data - rawh.Data) - // safely copy the raw slice header - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - // substring the raw - result.Str = result.Raw[start : start+strh.Len] - } else { - // safely copy both the raw and str slice headers to strings - result.Raw = string(*(*[]byte)(unsafe.Pointer(&rawh))) - result.Str = string(*(*[]byte)(unsafe.Pointer(&strh))) - } - return result -} - -// fillIndex finds the position of Raw data and assigns it to the Index field -// of the resulting value. If the position cannot be found then Index zero is -// used instead. -func fillIndex(json string, c *parseContext) { - if len(c.value.Raw) > 0 && !c.calcd { - jhdr := *(*reflect.StringHeader)(unsafe.Pointer(&json)) - rhdr := *(*reflect.StringHeader)(unsafe.Pointer(&(c.value.Raw))) - c.value.Index = int(rhdr.Data - jhdr.Data) - if c.value.Index < 0 || c.value.Index >= len(json) { - c.value.Index = 0 - } - } -} diff --git a/vendor/github.com/tidwall/gjson/go.mod b/vendor/github.com/tidwall/gjson/go.mod new file mode 100644 index 00000000000..c287095fc52 --- /dev/null +++ b/vendor/github.com/tidwall/gjson/go.mod @@ -0,0 +1,8 @@ +module github.com/tidwall/gjson + +go 1.12 + +require ( + github.com/tidwall/match v1.0.1 + github.com/tidwall/pretty v1.0.2 +) diff --git a/vendor/github.com/tidwall/gjson/go.sum b/vendor/github.com/tidwall/gjson/go.sum new file mode 100644 index 00000000000..75e1dd7b723 --- /dev/null +++ b/vendor/github.com/tidwall/gjson/go.sum @@ -0,0 +1,4 @@ +github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc= +github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= +github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= diff --git a/vendor/github.com/tidwall/match/match.go b/vendor/github.com/tidwall/match/match.go index 8885add63c8..fcfe998b5b4 100644 --- a/vendor/github.com/tidwall/match/match.go +++ b/vendor/github.com/tidwall/match/match.go @@ -168,25 +168,14 @@ func Allowable(pattern string) (min, max string) { } } return string(minb), string(maxb) - /* - return - if wild { - r, n := utf8.DecodeLastRune(maxb) - if r != utf8.RuneError { - if r < utf8.MaxRune { - infinite = true - } else { - r++ - if r > 0x7f { - b := make([]byte, 4) - nn := utf8.EncodeRune(b, r) - maxb = append(maxb[:len(maxb)-n], b[:nn]...) - } else { - maxb = append(maxb[:len(maxb)-n], byte(r)) - } - } - } +} + +// IsPattern returns true if the string is a pattern. +func IsPattern(str string) bool { + for i := 0; i < len(str); i++ { + if str[i] == '*' || str[i] == '?' { + return true } - return string(minb), string(maxb), infinite - */ + } + return false } diff --git a/vendor/github.com/tidwall/pretty/README.md b/vendor/github.com/tidwall/pretty/README.md index d2b8864d506..09884692e1c 100644 --- a/vendor/github.com/tidwall/pretty/README.md +++ b/vendor/github.com/tidwall/pretty/README.md @@ -1,7 +1,7 @@ # Pretty [![Build Status](https://img.shields.io/travis/tidwall/pretty.svg?style=flat-square)](https://travis-ci.org/tidwall/prettty) [![Coverage Status](https://img.shields.io/badge/coverage-100%25-brightgreen.svg?style=flat-square)](http://gocover.io/github.com/tidwall/pretty) -[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/tidwall/pretty) +[![GoDoc](https://img.shields.io/badge/api-reference-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/tidwall/pretty) Pretty is a Go package that provides [fast](#performance) methods for formatting JSON for human readability, or to compact JSON for smaller payloads. diff --git a/vendor/github.com/tidwall/pretty/pretty.go b/vendor/github.com/tidwall/pretty/pretty.go index 5b615bc7634..2951c610eaa 100644 --- a/vendor/github.com/tidwall/pretty/pretty.go +++ b/vendor/github.com/tidwall/pretty/pretty.go @@ -186,7 +186,7 @@ func appendPrettyObject(buf, json []byte, i int, open, close byte, pretty bool, if open == '[' || json[i] == '"' { if n > 0 { buf = append(buf, ',') - if width != -1 { + if width != -1 && open == '[' { buf = append(buf, ' ') } } @@ -318,21 +318,25 @@ func hexp(p byte) byte { } // TerminalStyle is for terminals -var TerminalStyle = &Style{ - Key: [2]string{"\x1B[94m", "\x1B[0m"}, - String: [2]string{"\x1B[92m", "\x1B[0m"}, - Number: [2]string{"\x1B[93m", "\x1B[0m"}, - True: [2]string{"\x1B[96m", "\x1B[0m"}, - False: [2]string{"\x1B[96m", "\x1B[0m"}, - Null: [2]string{"\x1B[91m", "\x1B[0m"}, - Append: func(dst []byte, c byte) []byte { - if c < ' ' && (c != '\r' && c != '\n' && c != '\t' && c != '\v') { - dst = append(dst, "\\u00"...) - dst = append(dst, hexp((c>>4)&0xF)) - return append(dst, hexp((c)&0xF)) - } - return append(dst, c) - }, +var TerminalStyle *Style + +func init() { + TerminalStyle = &Style{ + Key: [2]string{"\x1B[94m", "\x1B[0m"}, + String: [2]string{"\x1B[92m", "\x1B[0m"}, + Number: [2]string{"\x1B[93m", "\x1B[0m"}, + True: [2]string{"\x1B[96m", "\x1B[0m"}, + False: [2]string{"\x1B[96m", "\x1B[0m"}, + Null: [2]string{"\x1B[91m", "\x1B[0m"}, + Append: func(dst []byte, c byte) []byte { + if c < ' ' && (c != '\r' && c != '\n' && c != '\t' && c != '\v') { + dst = append(dst, "\\u00"...) + dst = append(dst, hexp((c>>4)&0xF)) + return append(dst, hexp((c)&0xF)) + } + return append(dst, c) + }, + } } // Color will colorize the json. The style parma is used for customizing diff --git a/vendor/modules.txt b/vendor/modules.txt index 5f011f813d6..67ee106050f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -205,13 +205,12 @@ github.com/spf13/pflag ## explicit github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/tidwall/gjson v1.1.3 +# github.com/tidwall/gjson v1.6.1 ## explicit github.com/tidwall/gjson -# github.com/tidwall/match v1.0.0 -## explicit +# github.com/tidwall/match v1.0.1 github.com/tidwall/match -# github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51 +# github.com/tidwall/pretty v1.0.2 ## explicit github.com/tidwall/pretty # github.com/ugorji/go v1.1.7 => github.com/ugorji/go v0.0.0-20180112141927-9831f2c3ac10 From 768cd9ec79aed9e29884a13a16e0ae8b910cb069 Mon Sep 17 00:00:00 2001 From: Son Dang Date: Fri, 11 Sep 2020 00:08:26 +0700 Subject: [PATCH 2/2] Fix test by trimming whitespace --- cmd/testdata/example.js | 356 ++++++++++++++++++++-------------------- 1 file changed, 178 insertions(+), 178 deletions(-) diff --git a/cmd/testdata/example.js b/cmd/testdata/example.js index 96470d6894a..f5d8fe5911e 100644 --- a/cmd/testdata/example.js +++ b/cmd/testdata/example.js @@ -15,34 +15,34 @@ export default function() { // Request #0 res = http.post("https://some-host.example.com/checkout/v3/orders", `{ - "locale": "sv-SE", + "locale": "sv-SE", "merchant_urls": { - "checkout": "https://some-fourth-host.example.com/v1/redirect/checkout", - "confirmation": "https://some-fourth-host.example.com/v1/redirect/confirm", - "push": "https://some-fourth-host.example.com/v1/callback/push/{checkout.order.id}?merchant_id=smi-merchant-all-validation\u0026env=perf", + "checkout": "https://some-fourth-host.example.com/v1/redirect/checkout", + "confirmation": "https://some-fourth-host.example.com/v1/redirect/confirm", + "push": "https://some-fourth-host.example.com/v1/callback/push/{checkout.order.id}?merchant_id=smi-merchant-all-validation\u0026env=perf", "terms": "https://some-fourth-host.example.com/v1/redirect/terms" - }, - "options": {}, - "order_amount": 16278, + }, + "options": {}, + "order_amount": 16278, "order_lines": [ { - "image_url": "https://s3-eu-west-1.amazonaws.com/s3.example.net/my/system-test/images/7.jpg", - "name": "Mediokra Betong Lampa. Tangentbord", - "product_url": "http://aufderharluettgen.info/haven", - "quantity": 1, - "quantity_unit": "kg", - "reference": "jkwedq9f6t", - "tax_rate": 800, - "total_amount": 16278, - "total_discount_amount": 0, - "total_tax_amount": 1206, - "type": "physical", + "image_url": "https://s3-eu-west-1.amazonaws.com/s3.example.net/my/system-test/images/7.jpg", + "name": "Mediokra Betong Lampa. Tangentbord", + "product_url": "http://aufderharluettgen.info/haven", + "quantity": 1, + "quantity_unit": "kg", + "reference": "jkwedq9f6t", + "tax_rate": 800, + "total_amount": 16278, + "total_discount_amount": 0, + "total_tax_amount": 1206, + "type": "physical", "unit_price": 16278 } - ], - "order_tax_amount": 1206, - "purchase_country": "se", - "purchase_currency": "SEK", + ], + "order_tax_amount": 1206, + "purchase_country": "se", + "purchase_currency": "SEK", "shipping_countries": ["AD", "AE", "AG", "AI", "AL", "AM", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BB", "BD", "BE", "BF", "BG", "BH", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BZ", "CA", "CC", "CH", "CK", "CL", "CM", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EH", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GP", "GQ", "GR", "GS", "GT", "GU", "HK", "HM", "HN", "HR", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LC", "LI", "LK", "LS", "LT", "LU", "LV", "MA", "MC", "ME", "MF", "MG", "MH", "MK", "ML", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SR", "ST", "SV", "SX", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TO", "TR", "TT", "TV", "TW", "TZ", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "WF", "WS", "YT", "ZA", "ZM"] }`, { @@ -92,81 +92,81 @@ export default function() { // Request #3 res = http.post("https://some-other-host.example.com/yaco/orders/570714bf-3c2b-452e-90cd-f7c5e552bb25", `{ - "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], - "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], + "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], + "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], "cart": { "items": [ { - "image_url": "${json.cart.items[0].image_url}", - "name": "${json.cart.items[0].name}", - "product_url": "${json.cart.items[0].product_url}", - "quantity": "${json.cart.items[0].quantity}", - "reference": "${json.cart.items[0].reference}", - "tax_rate": "${json.cart.items[0].tax_rate}", - "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", - "total_tax_amount": "${json.cart.items[0].total_tax_amount}", - "type": "${json.cart.items[0].type}", + "image_url": "${json.cart.items[0].image_url}", + "name": "${json.cart.items[0].name}", + "product_url": "${json.cart.items[0].product_url}", + "quantity": "${json.cart.items[0].quantity}", + "reference": "${json.cart.items[0].reference}", + "tax_rate": "${json.cart.items[0].tax_rate}", + "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", + "total_tax_amount": "${json.cart.items[0].total_tax_amount}", + "type": "${json.cart.items[0].type}", "unit_price": "${json.cart.items[0].unit_price}" } - ], - "subtotal": "${json.cart.subtotal}", - "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", - "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.total_price_including_tax}", - "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", - "total_store_credit": "${json.cart.total_store_credit}", - "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", + ], + "subtotal": "${json.cart.subtotal}", + "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", + "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.total_price_including_tax}", + "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", + "total_store_credit": "${json.cart.total_store_credit}", + "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", "total_tax_amount": "${json.cart.total_tax_amount}" - }, + }, "merchant_urls": { - "checkout": "${json.merchant_urls.checkout}", - "confirmation": "${json.merchant_urls.confirmation}", + "checkout": "${json.merchant_urls.checkout}", + "confirmation": "${json.merchant_urls.confirmation}", "terms": "${json.merchant_urls.terms}" - }, + }, "options": { - "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", - "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], - "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", - "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", + "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", + "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], + "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", + "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", "payment_selector_on_load": "${json.options.payment_selector_on_load}" - }, + }, "preview_payment_methods": [ { "data": { "days": "${json.preview_payment_methods[0].data.days}" - }, - "id": "${json.preview_payment_methods[0].id}", + }, + "id": "${json.preview_payment_methods[0].id}", "type": "${json.preview_payment_methods[0].type}" }, { "data": { - "allow_saved_card": "${json.preview_payment_methods[1].data.allow_saved_card}", - "available_cards": ["${json.preview_payment_methods[1].data.available_cards[0]}", "${json.preview_payment_methods[1].data.available_cards[1]}"], + "allow_saved_card": "${json.preview_payment_methods[1].data.allow_saved_card}", + "available_cards": ["${json.preview_payment_methods[1].data.available_cards[0]}", "${json.preview_payment_methods[1].data.available_cards[1]}"], "do_save_card": "${json.preview_payment_methods[1].data.do_save_card}" - }, - "id": "${json.preview_payment_methods[1].id}", + }, + "id": "${json.preview_payment_methods[1].id}", "type": "${json.preview_payment_methods[1].type}" } - ], - "required_fields": ["${json.required_fields[0]}", "${json.required_fields[1]}"], + ], + "required_fields": ["${json.required_fields[0]}", "${json.required_fields[1]}"], "shared": { "billing_address": { "country": "${json.shared.billing_address.country}" - }, + }, "challenge": { - "country": "${json.shared.challenge.country}", - "email": "drop+b28643c0e7c74da6b6ff2f4131aa3d64+d0+gr@example.com", + "country": "${json.shared.challenge.country}", + "email": "drop+b28643c0e7c74da6b6ff2f4131aa3d64+d0+gr@example.com", "postal_code": "10066" - }, - "currency": "${json.shared.currency}", + }, + "currency": "${json.shared.currency}", "customer": { "type": "${json.shared.customer.type}" - }, + }, "language": "${json.shared.language}" - }, + }, "status": { - "prescreened": "${json.status.prescreened}", + "prescreened": "${json.status.prescreened}", "require_terms_consent": "${json.status.require_terms_consent}" } }`, @@ -186,92 +186,92 @@ export default function() { // Request #4 res = http.post("https://some-other-host.example.com/yaco/orders/570714bf-3c2b-452e-90cd-f7c5e552bb25", `{ - "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], - "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], - "analytics_user_id": "${json.analytics_user_id}", + "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], + "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], + "analytics_user_id": "${json.analytics_user_id}", "cart": { "items": [ { - "image_url": "${json.cart.items[0].image_url}", - "name": "${json.cart.items[0].name}", - "product_url": "${json.cart.items[0].product_url}", - "quantity": "${json.cart.items[0].quantity}", - "reference": "${json.cart.items[0].reference}", - "tax_rate": "${json.cart.items[0].tax_rate}", - "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", - "total_tax_amount": "${json.cart.items[0].total_tax_amount}", - "type": "${json.cart.items[0].type}", + "image_url": "${json.cart.items[0].image_url}", + "name": "${json.cart.items[0].name}", + "product_url": "${json.cart.items[0].product_url}", + "quantity": "${json.cart.items[0].quantity}", + "reference": "${json.cart.items[0].reference}", + "tax_rate": "${json.cart.items[0].tax_rate}", + "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", + "total_tax_amount": "${json.cart.items[0].total_tax_amount}", + "type": "${json.cart.items[0].type}", "unit_price": "${json.cart.items[0].unit_price}" } - ], - "subtotal": "${json.cart.subtotal}", - "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", - "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.total_price_including_tax}", - "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", - "total_store_credit": "${json.cart.total_store_credit}", - "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", + ], + "subtotal": "${json.cart.subtotal}", + "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", + "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.total_price_including_tax}", + "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", + "total_store_credit": "${json.cart.total_store_credit}", + "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", "total_tax_amount": "${json.cart.total_tax_amount}" - }, - "correlation_id": "f6df29e7-f850-4c36-81fc-11def2f44b81", + }, + "correlation_id": "f6df29e7-f850-4c36-81fc-11def2f44b81", "merchant_urls": { - "checkout": "${json.merchant_urls.checkout}", - "confirmation": "${json.merchant_urls.confirmation}", + "checkout": "${json.merchant_urls.checkout}", + "confirmation": "${json.merchant_urls.confirmation}", "terms": "${json.merchant_urls.terms}" - }, + }, "options": { - "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", - "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], - "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", - "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", + "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", + "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], + "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", + "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", "payment_selector_on_load": "${json.options.payment_selector_on_load}" - }, + }, "preview_payment_methods": [ { "data": { "days": "${json.preview_payment_methods[0].data.days}" - }, - "id": "${json.preview_payment_methods[0].id}", + }, + "id": "${json.preview_payment_methods[0].id}", "type": "${json.preview_payment_methods[0].type}" }, { "data": { - "allow_saved_card": "${json.preview_payment_methods[1].data.allow_saved_card}", - "available_cards": ["${json.preview_payment_methods[1].data.available_cards[0]}", "${json.preview_payment_methods[1].data.available_cards[1]}"], + "allow_saved_card": "${json.preview_payment_methods[1].data.allow_saved_card}", + "available_cards": ["${json.preview_payment_methods[1].data.available_cards[0]}", "${json.preview_payment_methods[1].data.available_cards[1]}"], "do_save_card": "${json.preview_payment_methods[1].data.do_save_card}" - }, - "id": "${json.preview_payment_methods[1].id}", + }, + "id": "${json.preview_payment_methods[1].id}", "type": "${json.preview_payment_methods[1].type}" } - ], - "required_fields": ["${json.required_fields[0]}", "${json.required_fields[1]}", "${json.required_fields[2]}", "${json.required_fields[3]}", "${json.required_fields[4]}", "${json.required_fields[5]}", "billing_address.care_of"], + ], + "required_fields": ["${json.required_fields[0]}", "${json.required_fields[1]}", "${json.required_fields[2]}", "${json.required_fields[3]}", "${json.required_fields[4]}", "${json.required_fields[5]}", "billing_address.care_of"], "shared": { "billing_address": { - "care_of": "C/O Hakan Ostlund", - "city": "AlingHelsingstadfors", - "country": "${json.shared.billing_address.country}", - "email": "${json.shared.billing_address.email}", - "family_name": "Anglund", - "given_name": "Eva InvoiceGreenNewSpec", - "phone": "+46700012878", - "postal_code": "${json.shared.billing_address.postal_code}", + "care_of": "C/O Hakan Ostlund", + "city": "AlingHelsingstadfors", + "country": "${json.shared.billing_address.country}", + "email": "${json.shared.billing_address.email}", + "family_name": "Anglund", + "given_name": "Eva InvoiceGreenNewSpec", + "phone": "+46700012878", + "postal_code": "${json.shared.billing_address.postal_code}", "street_address": "Sveavägen 44, 11111 Stockholm, Sweden Eriks Gata gatan" - }, + }, "challenge": { - "country": "${json.shared.challenge.country}", - "email": "${json.shared.challenge.email}", + "country": "${json.shared.challenge.country}", + "email": "${json.shared.challenge.email}", "postal_code": "${json.shared.challenge.postal_code}" - }, - "currency": "${json.shared.currency}", + }, + "currency": "${json.shared.currency}", "customer": { - "national_identification_number": "8910210312", + "national_identification_number": "8910210312", "type": "${json.shared.customer.type}" - }, + }, "language": "${json.shared.language}" - }, + }, "status": { - "prescreened": "${json.status.prescreened}", + "prescreened": "${json.status.prescreened}", "require_terms_consent": "${json.status.require_terms_consent}" } }`, @@ -291,90 +291,90 @@ export default function() { // Request #5 res = http.post("https://some-other-host.example.com/yaco/orders/570714bf-3c2b-452e-90cd-f7c5e552bb25", `{ - "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], - "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], - "analytics_user_id": "${json.analytics_user_id}", + "allowed_billing_countries": ["${json.allowed_billing_countries[0]}", "${json.allowed_billing_countries[1]}", "${json.allowed_billing_countries[2]}", "${json.allowed_billing_countries[3]}", "${json.allowed_billing_countries[4]}", "${json.allowed_billing_countries[5]}", "${json.allowed_billing_countries[6]}", "${json.allowed_billing_countries[7]}", "${json.allowed_billing_countries[8]}", "${json.allowed_billing_countries[9]}", "${json.allowed_billing_countries[10]}", "${json.allowed_billing_countries[11]}", "${json.allowed_billing_countries[12]}", "${json.allowed_billing_countries[13]}", "${json.allowed_billing_countries[14]}", "${json.allowed_billing_countries[15]}", "${json.allowed_billing_countries[16]}", "${json.allowed_billing_countries[17]}", "${json.allowed_billing_countries[18]}", "${json.allowed_billing_countries[19]}", "${json.allowed_billing_countries[20]}", "${json.allowed_billing_countries[21]}", "${json.allowed_billing_countries[22]}", "${json.allowed_billing_countries[23]}", "${json.allowed_billing_countries[24]}", "${json.allowed_billing_countries[25]}", "${json.allowed_billing_countries[26]}", "${json.allowed_billing_countries[27]}", "${json.allowed_billing_countries[28]}", "${json.allowed_billing_countries[29]}", "${json.allowed_billing_countries[30]}", "${json.allowed_billing_countries[31]}", "${json.allowed_billing_countries[32]}", "${json.allowed_billing_countries[33]}", "${json.allowed_billing_countries[34]}", "${json.allowed_billing_countries[35]}", "${json.allowed_billing_countries[36]}", "${json.allowed_billing_countries[37]}", "${json.allowed_billing_countries[38]}", "${json.allowed_billing_countries[39]}", "${json.allowed_billing_countries[40]}", "${json.allowed_billing_countries[41]}", "${json.allowed_billing_countries[42]}", "${json.allowed_billing_countries[43]}", "${json.allowed_billing_countries[44]}", "${json.allowed_billing_countries[45]}", "${json.allowed_billing_countries[46]}", "${json.allowed_billing_countries[47]}", "${json.allowed_billing_countries[48]}", "${json.allowed_billing_countries[49]}", "${json.allowed_billing_countries[50]}", "${json.allowed_billing_countries[51]}", "${json.allowed_billing_countries[52]}", "${json.allowed_billing_countries[53]}", "${json.allowed_billing_countries[54]}", "${json.allowed_billing_countries[55]}", "${json.allowed_billing_countries[56]}", "${json.allowed_billing_countries[57]}", "${json.allowed_billing_countries[58]}", "${json.allowed_billing_countries[59]}", "${json.allowed_billing_countries[60]}", "${json.allowed_billing_countries[61]}", "${json.allowed_billing_countries[62]}", "${json.allowed_billing_countries[63]}", "${json.allowed_billing_countries[64]}", "${json.allowed_billing_countries[65]}", "${json.allowed_billing_countries[66]}", "${json.allowed_billing_countries[67]}", "${json.allowed_billing_countries[68]}", "${json.allowed_billing_countries[69]}", "${json.allowed_billing_countries[70]}", "${json.allowed_billing_countries[71]}", "${json.allowed_billing_countries[72]}", "${json.allowed_billing_countries[73]}", "${json.allowed_billing_countries[74]}", "${json.allowed_billing_countries[75]}", "${json.allowed_billing_countries[76]}", "${json.allowed_billing_countries[77]}", "${json.allowed_billing_countries[78]}", "${json.allowed_billing_countries[79]}", "${json.allowed_billing_countries[80]}", "${json.allowed_billing_countries[81]}", "${json.allowed_billing_countries[82]}", "${json.allowed_billing_countries[83]}", "${json.allowed_billing_countries[84]}", "${json.allowed_billing_countries[85]}", "${json.allowed_billing_countries[86]}", "${json.allowed_billing_countries[87]}", "${json.allowed_billing_countries[88]}", "${json.allowed_billing_countries[89]}", "${json.allowed_billing_countries[90]}", "${json.allowed_billing_countries[91]}", "${json.allowed_billing_countries[92]}", "${json.allowed_billing_countries[93]}", "${json.allowed_billing_countries[94]}", "${json.allowed_billing_countries[95]}", "${json.allowed_billing_countries[96]}", "${json.allowed_billing_countries[97]}", "${json.allowed_billing_countries[98]}", "${json.allowed_billing_countries[99]}", "${json.allowed_billing_countries[100]}", "${json.allowed_billing_countries[101]}", "${json.allowed_billing_countries[102]}", "${json.allowed_billing_countries[103]}", "${json.allowed_billing_countries[104]}", "${json.allowed_billing_countries[105]}", "${json.allowed_billing_countries[106]}", "${json.allowed_billing_countries[107]}", "${json.allowed_billing_countries[108]}", "${json.allowed_billing_countries[109]}", "${json.allowed_billing_countries[110]}", "${json.allowed_billing_countries[111]}", "${json.allowed_billing_countries[112]}", "${json.allowed_billing_countries[113]}", "${json.allowed_billing_countries[114]}", "${json.allowed_billing_countries[115]}", "${json.allowed_billing_countries[116]}", "${json.allowed_billing_countries[117]}", "${json.allowed_billing_countries[118]}", "${json.allowed_billing_countries[119]}", "${json.allowed_billing_countries[120]}", "${json.allowed_billing_countries[121]}", "${json.allowed_billing_countries[122]}", "${json.allowed_billing_countries[123]}", "${json.allowed_billing_countries[124]}", "${json.allowed_billing_countries[125]}", "${json.allowed_billing_countries[126]}", "${json.allowed_billing_countries[127]}", "${json.allowed_billing_countries[128]}", "${json.allowed_billing_countries[129]}", "${json.allowed_billing_countries[130]}", "${json.allowed_billing_countries[131]}", "${json.allowed_billing_countries[132]}", "${json.allowed_billing_countries[133]}", "${json.allowed_billing_countries[134]}", "${json.allowed_billing_countries[135]}", "${json.allowed_billing_countries[136]}", "${json.allowed_billing_countries[137]}", "${json.allowed_billing_countries[138]}", "${json.allowed_billing_countries[139]}", "${json.allowed_billing_countries[140]}", "${json.allowed_billing_countries[141]}", "${json.allowed_billing_countries[142]}", "${json.allowed_billing_countries[143]}", "${json.allowed_billing_countries[144]}", "${json.allowed_billing_countries[145]}", "${json.allowed_billing_countries[146]}", "${json.allowed_billing_countries[147]}", "${json.allowed_billing_countries[148]}", "${json.allowed_billing_countries[149]}", "${json.allowed_billing_countries[150]}", "${json.allowed_billing_countries[151]}", "${json.allowed_billing_countries[152]}", "${json.allowed_billing_countries[153]}", "${json.allowed_billing_countries[154]}", "${json.allowed_billing_countries[155]}", "${json.allowed_billing_countries[156]}", "${json.allowed_billing_countries[157]}", "${json.allowed_billing_countries[158]}", "${json.allowed_billing_countries[159]}", "${json.allowed_billing_countries[160]}", "${json.allowed_billing_countries[161]}", "${json.allowed_billing_countries[162]}", "${json.allowed_billing_countries[163]}", "${json.allowed_billing_countries[164]}", "${json.allowed_billing_countries[165]}", "${json.allowed_billing_countries[166]}", "${json.allowed_billing_countries[167]}", "${json.allowed_billing_countries[168]}", "${json.allowed_billing_countries[169]}", "${json.allowed_billing_countries[170]}", "${json.allowed_billing_countries[171]}", "${json.allowed_billing_countries[172]}", "${json.allowed_billing_countries[173]}", "${json.allowed_billing_countries[174]}", "${json.allowed_billing_countries[175]}", "${json.allowed_billing_countries[176]}", "${json.allowed_billing_countries[177]}", "${json.allowed_billing_countries[178]}", "${json.allowed_billing_countries[179]}", "${json.allowed_billing_countries[180]}", "${json.allowed_billing_countries[181]}", "${json.allowed_billing_countries[182]}", "${json.allowed_billing_countries[183]}", "${json.allowed_billing_countries[184]}", "${json.allowed_billing_countries[185]}", "${json.allowed_billing_countries[186]}", "${json.allowed_billing_countries[187]}", "${json.allowed_billing_countries[188]}", "${json.allowed_billing_countries[189]}", "${json.allowed_billing_countries[190]}", "${json.allowed_billing_countries[191]}", "${json.allowed_billing_countries[192]}", "${json.allowed_billing_countries[193]}", "${json.allowed_billing_countries[194]}", "${json.allowed_billing_countries[195]}", "${json.allowed_billing_countries[196]}", "${json.allowed_billing_countries[197]}", "${json.allowed_billing_countries[198]}", "${json.allowed_billing_countries[199]}", "${json.allowed_billing_countries[200]}", "${json.allowed_billing_countries[201]}", "${json.allowed_billing_countries[202]}", "${json.allowed_billing_countries[203]}", "${json.allowed_billing_countries[204]}", "${json.allowed_billing_countries[205]}", "${json.allowed_billing_countries[206]}", "${json.allowed_billing_countries[207]}", "${json.allowed_billing_countries[208]}", "${json.allowed_billing_countries[209]}", "${json.allowed_billing_countries[210]}"], + "allowed_shipping_countries": ["${json.allowed_shipping_countries[0]}", "${json.allowed_shipping_countries[1]}", "${json.allowed_shipping_countries[2]}", "${json.allowed_shipping_countries[3]}", "${json.allowed_shipping_countries[4]}", "${json.allowed_shipping_countries[5]}", "${json.allowed_shipping_countries[6]}", "${json.allowed_shipping_countries[7]}", "${json.allowed_shipping_countries[8]}", "${json.allowed_shipping_countries[9]}", "${json.allowed_shipping_countries[10]}", "${json.allowed_shipping_countries[11]}", "${json.allowed_shipping_countries[12]}", "${json.allowed_shipping_countries[13]}", "${json.allowed_shipping_countries[14]}", "${json.allowed_shipping_countries[15]}", "${json.allowed_shipping_countries[16]}", "${json.allowed_shipping_countries[17]}", "${json.allowed_shipping_countries[18]}", "${json.allowed_shipping_countries[19]}", "${json.allowed_shipping_countries[20]}", "${json.allowed_shipping_countries[21]}", "${json.allowed_shipping_countries[22]}", "${json.allowed_shipping_countries[23]}", "${json.allowed_shipping_countries[24]}", "${json.allowed_shipping_countries[25]}", "${json.allowed_shipping_countries[26]}", "${json.allowed_shipping_countries[27]}", "${json.allowed_shipping_countries[28]}", "${json.allowed_shipping_countries[29]}", "${json.allowed_shipping_countries[30]}", "${json.allowed_shipping_countries[31]}", "${json.allowed_shipping_countries[32]}", "${json.allowed_shipping_countries[33]}", "${json.allowed_shipping_countries[34]}", "${json.allowed_shipping_countries[35]}", "${json.allowed_shipping_countries[36]}", "${json.allowed_shipping_countries[37]}", "${json.allowed_shipping_countries[38]}", "${json.allowed_shipping_countries[39]}", "${json.allowed_shipping_countries[40]}", "${json.allowed_shipping_countries[41]}", "${json.allowed_shipping_countries[42]}", "${json.allowed_shipping_countries[43]}", "${json.allowed_shipping_countries[44]}", "${json.allowed_shipping_countries[45]}", "${json.allowed_shipping_countries[46]}", "${json.allowed_shipping_countries[47]}", "${json.allowed_shipping_countries[48]}", "${json.allowed_shipping_countries[49]}", "${json.allowed_shipping_countries[50]}", "${json.allowed_shipping_countries[51]}", "${json.allowed_shipping_countries[52]}", "${json.allowed_shipping_countries[53]}", "${json.allowed_shipping_countries[54]}", "${json.allowed_shipping_countries[55]}", "${json.allowed_shipping_countries[56]}", "${json.allowed_shipping_countries[57]}", "${json.allowed_shipping_countries[58]}", "${json.allowed_shipping_countries[59]}", "${json.allowed_shipping_countries[60]}", "${json.allowed_shipping_countries[61]}", "${json.allowed_shipping_countries[62]}", "${json.allowed_shipping_countries[63]}", "${json.allowed_shipping_countries[64]}", "${json.allowed_shipping_countries[65]}", "${json.allowed_shipping_countries[66]}", "${json.allowed_shipping_countries[67]}", "${json.allowed_shipping_countries[68]}", "${json.allowed_shipping_countries[69]}", "${json.allowed_shipping_countries[70]}", "${json.allowed_shipping_countries[71]}", "${json.allowed_shipping_countries[72]}", "${json.allowed_shipping_countries[73]}", "${json.allowed_shipping_countries[74]}", "${json.allowed_shipping_countries[75]}", "${json.allowed_shipping_countries[76]}", "${json.allowed_shipping_countries[77]}", "${json.allowed_shipping_countries[78]}", "${json.allowed_shipping_countries[79]}", "${json.allowed_shipping_countries[80]}", "${json.allowed_shipping_countries[81]}", "${json.allowed_shipping_countries[82]}", "${json.allowed_shipping_countries[83]}", "${json.allowed_shipping_countries[84]}", "${json.allowed_shipping_countries[85]}", "${json.allowed_shipping_countries[86]}", "${json.allowed_shipping_countries[87]}", "${json.allowed_shipping_countries[88]}", "${json.allowed_shipping_countries[89]}", "${json.allowed_shipping_countries[90]}", "${json.allowed_shipping_countries[91]}", "${json.allowed_shipping_countries[92]}", "${json.allowed_shipping_countries[93]}", "${json.allowed_shipping_countries[94]}", "${json.allowed_shipping_countries[95]}", "${json.allowed_shipping_countries[96]}", "${json.allowed_shipping_countries[97]}", "${json.allowed_shipping_countries[98]}", "${json.allowed_shipping_countries[99]}", "${json.allowed_shipping_countries[100]}", "${json.allowed_shipping_countries[101]}", "${json.allowed_shipping_countries[102]}", "${json.allowed_shipping_countries[103]}", "${json.allowed_shipping_countries[104]}", "${json.allowed_shipping_countries[105]}", "${json.allowed_shipping_countries[106]}", "${json.allowed_shipping_countries[107]}", "${json.allowed_shipping_countries[108]}", "${json.allowed_shipping_countries[109]}", "${json.allowed_shipping_countries[110]}", "${json.allowed_shipping_countries[111]}", "${json.allowed_shipping_countries[112]}", "${json.allowed_shipping_countries[113]}", "${json.allowed_shipping_countries[114]}", "${json.allowed_shipping_countries[115]}", "${json.allowed_shipping_countries[116]}", "${json.allowed_shipping_countries[117]}", "${json.allowed_shipping_countries[118]}", "${json.allowed_shipping_countries[119]}", "${json.allowed_shipping_countries[120]}", "${json.allowed_shipping_countries[121]}", "${json.allowed_shipping_countries[122]}", "${json.allowed_shipping_countries[123]}", "${json.allowed_shipping_countries[124]}", "${json.allowed_shipping_countries[125]}", "${json.allowed_shipping_countries[126]}", "${json.allowed_shipping_countries[127]}", "${json.allowed_shipping_countries[128]}", "${json.allowed_shipping_countries[129]}", "${json.allowed_shipping_countries[130]}", "${json.allowed_shipping_countries[131]}", "${json.allowed_shipping_countries[132]}", "${json.allowed_shipping_countries[133]}", "${json.allowed_shipping_countries[134]}", "${json.allowed_shipping_countries[135]}", "${json.allowed_shipping_countries[136]}", "${json.allowed_shipping_countries[137]}", "${json.allowed_shipping_countries[138]}", "${json.allowed_shipping_countries[139]}", "${json.allowed_shipping_countries[140]}", "${json.allowed_shipping_countries[141]}", "${json.allowed_shipping_countries[142]}", "${json.allowed_shipping_countries[143]}", "${json.allowed_shipping_countries[144]}", "${json.allowed_shipping_countries[145]}", "${json.allowed_shipping_countries[146]}", "${json.allowed_shipping_countries[147]}", "${json.allowed_shipping_countries[148]}", "${json.allowed_shipping_countries[149]}", "${json.allowed_shipping_countries[150]}", "${json.allowed_shipping_countries[151]}", "${json.allowed_shipping_countries[152]}", "${json.allowed_shipping_countries[153]}", "${json.allowed_shipping_countries[154]}", "${json.allowed_shipping_countries[155]}", "${json.allowed_shipping_countries[156]}", "${json.allowed_shipping_countries[157]}", "${json.allowed_shipping_countries[158]}", "${json.allowed_shipping_countries[159]}", "${json.allowed_shipping_countries[160]}", "${json.allowed_shipping_countries[161]}", "${json.allowed_shipping_countries[162]}", "${json.allowed_shipping_countries[163]}", "${json.allowed_shipping_countries[164]}", "${json.allowed_shipping_countries[165]}", "${json.allowed_shipping_countries[166]}", "${json.allowed_shipping_countries[167]}", "${json.allowed_shipping_countries[168]}", "${json.allowed_shipping_countries[169]}", "${json.allowed_shipping_countries[170]}", "${json.allowed_shipping_countries[171]}", "${json.allowed_shipping_countries[172]}", "${json.allowed_shipping_countries[173]}", "${json.allowed_shipping_countries[174]}", "${json.allowed_shipping_countries[175]}", "${json.allowed_shipping_countries[176]}", "${json.allowed_shipping_countries[177]}", "${json.allowed_shipping_countries[178]}", "${json.allowed_shipping_countries[179]}", "${json.allowed_shipping_countries[180]}", "${json.allowed_shipping_countries[181]}", "${json.allowed_shipping_countries[182]}", "${json.allowed_shipping_countries[183]}", "${json.allowed_shipping_countries[184]}", "${json.allowed_shipping_countries[185]}", "${json.allowed_shipping_countries[186]}", "${json.allowed_shipping_countries[187]}", "${json.allowed_shipping_countries[188]}", "${json.allowed_shipping_countries[189]}", "${json.allowed_shipping_countries[190]}", "${json.allowed_shipping_countries[191]}", "${json.allowed_shipping_countries[192]}", "${json.allowed_shipping_countries[193]}", "${json.allowed_shipping_countries[194]}", "${json.allowed_shipping_countries[195]}", "${json.allowed_shipping_countries[196]}", "${json.allowed_shipping_countries[197]}", "${json.allowed_shipping_countries[198]}", "${json.allowed_shipping_countries[199]}", "${json.allowed_shipping_countries[200]}", "${json.allowed_shipping_countries[201]}", "${json.allowed_shipping_countries[202]}", "${json.allowed_shipping_countries[203]}", "${json.allowed_shipping_countries[204]}", "${json.allowed_shipping_countries[205]}", "${json.allowed_shipping_countries[206]}", "${json.allowed_shipping_countries[207]}", "${json.allowed_shipping_countries[208]}", "${json.allowed_shipping_countries[209]}", "${json.allowed_shipping_countries[210]}"], + "analytics_user_id": "${json.analytics_user_id}", "available_payment_methods": [ { "data": { "days": "${json.available_payment_methods[0].data.days}" - }, - "id": "${json.available_payment_methods[0].id}", + }, + "id": "${json.available_payment_methods[0].id}", "type": "${json.available_payment_methods[0].type}" } - ], + ], "cart": { "items": [ { - "image_url": "${json.cart.items[0].image_url}", - "name": "${json.cart.items[0].name}", - "product_url": "${json.cart.items[0].product_url}", - "quantity": "${json.cart.items[0].quantity}", - "reference": "${json.cart.items[0].reference}", - "tax_rate": "${json.cart.items[0].tax_rate}", - "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", - "total_tax_amount": "${json.cart.items[0].total_tax_amount}", - "type": "${json.cart.items[0].type}", + "image_url": "${json.cart.items[0].image_url}", + "name": "${json.cart.items[0].name}", + "product_url": "${json.cart.items[0].product_url}", + "quantity": "${json.cart.items[0].quantity}", + "reference": "${json.cart.items[0].reference}", + "tax_rate": "${json.cart.items[0].tax_rate}", + "total_price_excluding_tax": "${json.cart.items[0].total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.items[0].total_price_including_tax}", + "total_tax_amount": "${json.cart.items[0].total_tax_amount}", + "type": "${json.cart.items[0].type}", "unit_price": "${json.cart.items[0].unit_price}" } - ], - "subtotal": "${json.cart.subtotal}", - "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", - "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", - "total_price_including_tax": "${json.cart.total_price_including_tax}", - "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", - "total_store_credit": "${json.cart.total_store_credit}", - "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", + ], + "subtotal": "${json.cart.subtotal}", + "total_discount_amount_excluding_tax": "${json.cart.total_discount_amount_excluding_tax}", + "total_price_excluding_tax": "${json.cart.total_price_excluding_tax}", + "total_price_including_tax": "${json.cart.total_price_including_tax}", + "total_shipping_amount_excluding_tax": "${json.cart.total_shipping_amount_excluding_tax}", + "total_store_credit": "${json.cart.total_store_credit}", + "total_surcharge_amount_excluding_tax": "${json.cart.total_surcharge_amount_excluding_tax}", "total_tax_amount": "${json.cart.total_tax_amount}" - }, - "correlation_id": "a6c51342-b107-4463-a2a0-b530f1bac03e", + }, + "correlation_id": "a6c51342-b107-4463-a2a0-b530f1bac03e", "merchant_urls": { - "checkout": "${json.merchant_urls.checkout}", - "confirmation": "${json.merchant_urls.confirmation}", + "checkout": "${json.merchant_urls.checkout}", + "confirmation": "${json.merchant_urls.confirmation}", "terms": "${json.merchant_urls.terms}" - }, + }, "options": { - "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", - "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], - "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", - "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", + "allow_separate_shipping_address": "${json.options.allow_separate_shipping_address}", + "allowed_customer_types": ["${json.options.allowed_customer_types[0]}"], + "date_of_birth_mandatory": "${json.options.date_of_birth_mandatory}", + "national_identification_number_mandatory": "${json.options.national_identification_number_mandatory}", "payment_selector_on_load": "${json.options.payment_selector_on_load}" - }, + }, "shared": { "billing_address": { - "care_of": "${json.shared.billing_address.care_of}", - "city": "${json.shared.billing_address.city}", - "country": "${json.shared.billing_address.country}", - "email": "${json.shared.billing_address.email}", - "family_name": "${json.shared.billing_address.family_name}", - "given_name": "${json.shared.billing_address.given_name}", - "phone": "${json.shared.billing_address.phone}", - "postal_code": "${json.shared.billing_address.postal_code}", - "street_address": "${json.shared.billing_address.street_address}", + "care_of": "${json.shared.billing_address.care_of}", + "city": "${json.shared.billing_address.city}", + "country": "${json.shared.billing_address.country}", + "email": "${json.shared.billing_address.email}", + "family_name": "${json.shared.billing_address.family_name}", + "given_name": "${json.shared.billing_address.given_name}", + "phone": "${json.shared.billing_address.phone}", + "postal_code": "${json.shared.billing_address.postal_code}", + "street_address": "${json.shared.billing_address.street_address}", "street_address2": "${json.shared.billing_address.street_address2}" - }, + }, "challenge": { - "country": "${json.shared.challenge.country}", - "email": "${json.shared.challenge.email}", + "country": "${json.shared.challenge.country}", + "email": "${json.shared.challenge.email}", "postal_code": "${json.shared.challenge.postal_code}" - }, - "currency": "${json.shared.currency}", + }, + "currency": "${json.shared.currency}", "customer": { - "national_identification_number": "${json.shared.customer.national_identification_number}", + "national_identification_number": "${json.shared.customer.national_identification_number}", "type": "${json.shared.customer.type}" - }, - "language": "${json.shared.language}", + }, + "language": "${json.shared.language}", "selected_payment_method": { "data": { "days": 14 - }, - "id": "-1", + }, + "id": "-1", "type": "invoice" } - }, + }, "status": { - "prescreened": "${json.status.prescreened}", + "prescreened": "${json.status.prescreened}", "require_terms_consent": "${json.status.require_terms_consent}" } }`,