{"action":"created","issue":{"url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/64","repository_url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios","labels_url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/64/comments","events_url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/64/events","html_url":"https://github.com/AuthorizeNet/accept-sdk-ios/issues/64","id":330909112,"node_id":"MDU6SXNzdWUzMzA5MDkxMTI=","number":64,"title":"The given data was not valid JSON","user":{"login":"deepaksinghnegi","id":3945224,"node_id":"MDQ6VXNlcjM5NDUyMjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3945224?v=4","gravatar_id":"","url":"https://api.github.com/users/deepaksinghnegi","html_url":"https://github.com/deepaksinghnegi","followers_url":"https://api.github.com/users/deepaksinghnegi/followers","following_url":"https://api.github.com/users/deepaksinghnegi/following{/other_user}","gists_url":"https://api.github.com/users/deepaksinghnegi/gists{/gist_id}","starred_url":"https://api.github.com/users/deepaksinghnegi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepaksinghnegi/subscriptions","organizations_url":"https://api.github.com/users/deepaksinghnegi/orgs","repos_url":"https://api.github.com/users/deepaksinghnegi/repos","events_url":"https://api.github.com/users/deepaksinghnegi/events{/privacy}","received_events_url":"https://api.github.com/users/deepaksinghnegi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-09T18:25:23Z","updated_at":"2018-06-14T05:16:28Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm new to this Payment api and struggling to implement the payment api. As it successfully generates the token but when I make transaction request as follows:\r\n\r\n        let json =  \"\"\"\r\n          {\r\n            \"createTransactionRequest\": {\r\n              \"merchantAuthentication\": {\r\n                \"name\": \"xyzzy\",\r\n                \"transactionKey\": \"xyzzy\"\r\n              },\r\n              \"refId\": \"123\",\r\n              \"transactionRequest\": {\r\n                \"transactionType\": \"authCaptureTransaction\",\r\n                \"amount\": \\(Config.currentBooking.totalPrice),\r\n                \"payment\": {\r\n                  \"opaqueData\": {\r\n                    \"dataDescriptor\": \"COMMON.ACCEPT.INAPP.PAYMENT\",\r\n                    \"dataValue\": \"PAYMENT_NONCE_GOES_HERE\"\r\n                  }\r\n                }\r\n              }\r\n            }\r\n          }\r\n          \"\"\"\r\n  \r\n          let jsonData = Data(json.utf8)\r\n          do {\r\n            let transaction = try JSONDecoder().decode(Transaction.self, from: jsonData)\r\n            print(transaction)\r\n            // encoding\r\n            let encodedData = try JSONEncoder().encode(transaction)\r\n            print(String(data: encodedData, encoding: .utf8)!)\r\n            \r\n          }\r\n          catch {\r\n            print(error)\r\n          }\r\n      })\r\n\r\nIt gives me following response:\r\n\r\ndataCorrupted(Swift.DecodingError.Context(codingPath: [], debugDescription: \"The given data was not valid JSON.\", underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 \"Invalid value around character 264.\" UserInfo={NSDebugDescription=Invalid value around character 264.})))\r\n\r\nNot sure if it is happening due to JSON order. It's the recommended manner to request a transaction.\r\n\r\nPlease help. Thanks!!!\r\n"},"comment":{"url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/comments/397173415","html_url":"https://github.com/AuthorizeNet/accept-sdk-ios/issues/64#issuecomment-397173415","issue_url":"https://api.github.com/repos/AuthorizeNet/accept-sdk-ios/issues/64","id":397173415,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzE3MzQxNQ==","user":{"login":"deepaksinghnegi","id":3945224,"node_id":"MDQ6VXNlcjM5NDUyMjQ=","avatar_url":"https://avatars2.githubusercontent.com/u/3945224?v=4","gravatar_id":"","url":"https://api.github.com/users/deepaksinghnegi","html_url":"https://github.com/deepaksinghnegi","followers_url":"https://api.github.com/users/deepaksinghnegi/followers","following_url":"https://api.github.com/users/deepaksinghnegi/following{/other_user}","gists_url":"https://api.github.com/users/deepaksinghnegi/gists{/gist_id}","starred_url":"https://api.github.com/users/deepaksinghnegi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepaksinghnegi/subscriptions","organizations_url":"https://api.github.com/users/deepaksinghnegi/orgs","repos_url":"https://api.github.com/users/deepaksinghnegi/repos","events_url":"https://api.github.com/users/deepaksinghnegi/events{/privacy}","received_events_url":"https://api.github.com/users/deepaksinghnegi/received_events","type":"User","site_admin":false},"created_at":"2018-06-14T05:16:27Z","updated_at":"2018-06-14T05:16:27Z","author_association":"NONE","body":"HI @RakeshVisa Thanks for replying, actually I've already done that, and it's working fine. I also want to know if it is enough code to make a payment as I'm not getting any successful payment message, only the transaction key. If not what should be the next step to make payment. Thanks again.\r\n\r\nFollowing is the response I'm getting\r\n{\"createTransactionRequest\":{\"merchantAuthentication\":{\"name\":\"xyz\",\"transactionKey\":\"xyz\"},\"refId\":\"xyz\",\"transactionRequest\":{\"transactionType\":\"authCaptureTransaction\",\"amount\":\"40.0\",\"payment\":{\"opaqueData\":{\"dataValue\":\"PAYMENT_NONCE_GOES_HERE\",\"dataDescriptor\":\"COMMON.ACCEPT.INAPP.PAYMENT\"}}}}}"}}
{"actor":{"display_login":"deepaksinghnegi"}}