Hallo!
Ich bräuchte Hilfe, wie ich das untenstehende JSON-Objekt als Hash aufbauen muss, damit ein
encode_json(\%content) den Hash dann korrekt umwandelt.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"RequestHeader": {
"SpecVersion": "1.3",
"CustomerId": "[your customer id]",
"RequestId": "[unique request identifier]",
"RetryIndicator": 0
},
"TerminalId": "[your terminal id]",
"Payment": {
"Amount": {
"Value": "100",
"CurrencyCode": "CHF"
},
"OrderId": "Id of the order",
"Description": "Description of payment"
},
"ReturnUrls": {
"Success": "[your shop payment success url]",
"Fail": "[your shop payment fail url]"
}
}
Versucht habe ich folgendes, aber das bringt mir den Fehler "Reference found where even-sized list expected":
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
my %content = {
"RequestHeader" => {
"SpecVersion" => "1.3",
"CustomerId"=> "[your customer id]",
"RequestId"=> "[unique request identifier]",
"RetryIndicator"=> 0
},
"TerminalId"=> "[your terminal id]",
"Payment"=> {
"Amount"=> {
"Value"=> "100",
"CurrencyCode"=> "CHF"
},
"OrderId"=> "Id of the order",
"Description"=> "Description of payment"
},
"ReturnUrls"=> {
"Success"=> "[your shop payment success url]",
"Fail"=> "[your shop payment fail url]"
}
}
Vielen Dank!
Last edited: 2016-08-03 09:01:44 +0200 (CEST)