Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trycf/0c2672ac4a02d4c52d1e3ee1c9a408e7 to your computer and use it in GitHub Desktop.
Save trycf/0c2672ac4a02d4c52d1e3ee1c9a408e7 to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
original = {
'payment_method_types' = ['card'],
'line_items' = [
{
"price_data" = {
"product_data" = {
"name" = "Something"
},
"currency" = 'gbp',
"unit_amount" = 123
},
"quantity" = 1
}
]
};
writeDump(var=original, label="Original");
wantedResult["payment_method_types[0]"] = 'card';
wantedResult["line_items[0][price_data][product_data][name]"] ='Something';
wantedResult["line_items[0][price_data][currency]"] = 'gbp';
wantedResult["line_items[0][price_data][unit_amount]"] = 123;
wantedResult["line_items[0][quantity]"] = 1;
writeDump(var=wantedResult, label="Want this:");
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment