@@ -894,7 +894,8 @@ class gr4vy_iOSTests: XCTestCase {
894894 [ " key1 " : [ " subKey1 " : . string( " value1 " ) ] , " key2 " : [ " subKey1 " : . bool( true ) ] ] ,
895895 [ " key1 " : [ " subKey1 " : . int( 1 ) ] , " key2 " : [ " subKey1 " : . bool( true ) ] ] ,
896896 [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . int( 1 ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . bool( true ) ] ] ,
897- [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . bool( true ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . string( " value2 " ) ] ]
897+ [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . bool( true ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . string( " value2 " ) ] ] ,
898+ [ " key1 " : [ " subKey1 " : . dictionary( [ " key1 " : " value1 " ] ) ] ] ,
898899 ]
899900
900901 for permutation in permutations {
@@ -939,6 +940,13 @@ class gr4vy_iOSTests: XCTestCase {
939940
940941 XCTAssertEqual ( " window.postMessage({ \" channel \" : 123, \" type \" : \" updateOptions \" , \" data \" : { \" amount \" :100, \" apiHost \" : \" api.ID123.gr4vy.app \" , \" apiUrl \" : \" https: \\ / \\ /api.ID123.gr4vy.app \" , \" buyerId \" : \" BUYER123 \" , \" connectionOptions \" :{ \" cybersource-anti-fraud \" :{ \" merchant_defined_data \" : \" value \" }}, \" country \" : \" GB \" , \" currency \" : \" GBP \" , \" supportedApplePayVersion \" :0, \" token \" : \" TOKEN123 \" }}) " , sut)
941942
943+ setup. connectionOptions = [
944+ " cybersource-anti-fraud " : [ " merchant_defined_data " : . dictionary( [ " key " : " value " ] ) ]
945+ ]
946+ sut = Gr4vyUtility . generateUpdateOptions ( from: setup)
947+
948+ XCTAssertEqual ( " window.postMessage({ \" channel \" : 123, \" type \" : \" updateOptions \" , \" data \" : { \" amount \" :100, \" apiHost \" : \" api.ID123.gr4vy.app \" , \" apiUrl \" : \" https: \\ / \\ /api.ID123.gr4vy.app \" , \" buyerId \" : \" BUYER123 \" , \" connectionOptions \" :{ \" cybersource-anti-fraud \" :{ \" merchant_defined_data \" :{ \" key \" : \" value \" }}}, \" country \" : \" GB \" , \" currency \" : \" GBP \" , \" supportedApplePayVersion \" :0, \" token \" : \" TOKEN123 \" }}) " , sut)
949+
942950 setup. connectionOptions = [ : ]
943951 sut = Gr4vyUtility . generateUpdateOptions ( from: setup)
944952 XCTAssertEqual ( " window.postMessage({ \" channel \" : 123, \" type \" : \" updateOptions \" , \" data \" : { \" amount \" :100, \" apiHost \" : \" api.ID123.gr4vy.app \" , \" apiUrl \" : \" https: \\ / \\ /api.ID123.gr4vy.app \" , \" buyerId \" : \" BUYER123 \" , \" connectionOptions \" :{}, \" country \" : \" GB \" , \" currency \" : \" GBP \" , \" supportedApplePayVersion \" :0, \" token \" : \" TOKEN123 \" }}) " , sut)
@@ -958,7 +966,8 @@ class gr4vy_iOSTests: XCTestCase {
958966 [ " key1 " : [ " subKey1 " : . string( " value1 " ) ] , " key2 " : [ " subKey1 " : . bool( true ) ] ] ,
959967 [ " key1 " : [ " subKey1 " : . int( 1 ) ] , " key2 " : [ " subKey1 " : . bool( true ) ] ] ,
960968 [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . int( 1 ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . bool( true ) ] ] ,
961- [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . bool( true ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . string( " value2 " ) ] ]
969+ [ " key1 " : [ " subKey1 " : . string( " value1 " ) , " subKey2 " : . bool( true ) ] , " key2 " : [ " subKey1 " : . int( 1 ) , " subKey2 " : . string( " value2 " ) ] ] ,
970+ [ " key1 " : [ " subKey1 " : . dictionary( [ " key1 " : " value1 " ] ) ] ] ,
962971 ]
963972
964973 for permutation in permutations {
0 commit comments