<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Apple Pay - Required fields are missing from decrypted data in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/61729#M36140</link>
    <description>&lt;P&gt;I'm getting the following error:&lt;/P&gt;&lt;PRE&gt;Failed Transaction.
Error Code: 153
Error message: There was an error processing the payment data. Unable to decrypt data.&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Your help is much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm sending the opaquedata.dataValue as the base64 encoded data that contains the version, data, signature, header(ephemeralPublicKey, publicKeyHash, transactionId).&lt;/P&gt;</description>
    <pubDate>Thu, 15 Feb 2018 19:52:23 GMT</pubDate>
    <dc:creator>vrangasa1</dc:creator>
    <dc:date>2018-02-15T19:52:23Z</dc:date>
    <item>
      <title>Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59534#M34117</link>
      <description>&lt;DIV&gt;I am trying to set&amp;nbsp;up apple pay using objective c for a native iPhone app. &amp;nbsp;I have not been able to get Apple Pay to successfully process a transaction. &amp;nbsp;I have tried it in both production and sandbox, and I am getting the below&amp;nbsp;error message for both environments using a real MasterCard Credit Card. &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Any ideas&amp;nbsp;as to why my transactions are not getting processed? &amp;nbsp;What fields are missing from the decrypted data and what I can do to add them?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;JSON sent to api:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;{
	"createTransactionRequest": {
		"merchantAuthentication": {
			"name": "ApiLoginHere",
			"transactionKey": "TransactionKeyHere"
		},
		"refId": "123456",
		"transactionRequest": {
			"transactionType": "authCaptureTransaction",
			"amount": "0.01",
			"payment": {
				"opaqueData": {
					"dataDescriptor": "COMMON.APPLE.INAPP.PAYMENT",
					"dataValue": "eyJ2ZX...GEifX0="
				}
			},
			"lineItems": {
				"lineItem": {
					"itemId": "1",
					"name": "Donation",
					"description": "Donation",
					"quantity": "1",
					"unitPrice": "0.01"
				}
			}
		}
	}
}&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;JSON returned from api call:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;{
	"transactionResponse": {
		"responseCode": "3",
		"authCode": "",
		"avsResultCode": "P",
		"cvvResultCode": "",
		"cavvResultCode": "",
		"transId": "0",
		"refTransID": "",
		"transHash": "3C0B543D31B546B9FB07763547E76925",
		"testRequest": "0",
		"accountNumber": "",
		"accountType": "",
		"errors": [{
			"errorCode": "153",
			"errorText": "There was an error processing the payment data. Required fields are missing from decrypted data."
		}],
		"transHashSha2": ""
	},
	"refId": "123456",
	"messages": {
		"resultCode": "Error",
		"message": [{
			"code": "E00027",
			"text": "The transaction was unsuccessful."
		}]
	}
}&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;After the user clicks the apple pay button, giving Apple Pay the payment&amp;nbsp;information:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;self.donationAmount = [NSDecimalNumber decimalNumberWithString:@"0.01"];
PKPaymentRequest *request = [[PKPaymentRequest alloc] init];
request.countryCode = @"US";
request.currencyCode = @"USD";
request.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
request.merchantCapabilities = PKMerchantCapabilityEMV;
request.merchantIdentifier = @"merchant.mymerchantidentifier.org";
        
PKPaymentSummaryItem *paymentTotal = [PKPaymentSummaryItem summaryItemWithLabel:@"" amount:self.donationAmount];
request.paymentSummaryItems = @[paymentTotal];
        
PKPaymentAuthorizationViewController *paymentPane = [[PKPaymentAuthorizationViewController alloc] initWithPaymentRequest:request];
paymentPane.delegate = self;
[self presentViewController:paymentPane animated:TRUE completion:nil];&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;In the&amp;nbsp;&lt;SPAN&gt;paymentAuthorizationViewController method, sending the data to authorize.net:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;PKPaymentToken *paymentToken = payment.token;
NSData *data = paymentToken.paymentData;
NSString *base64Encoded = [data base64EncodedStringWithOptions:0];

    NSString *body = [NSString stringWithFormat: @"{\"createTransactionRequest\": {"
    "\"merchantAuthentication\": {"
        "\"name\": \"ApiLoginIdHere\","
        "\"transactionKey\": \"TransactionKeyHere\""
    "},"
        "\"refId\": \"123456\","
        "\"transactionRequest\": {"
            "\"transactionType\": \"authCaptureTransaction\","
            "\"amount\": \"0.01\","
            "\"payment\": {"
                "\"opaqueData\": {"
                    "\"dataDescriptor\": \"COMMON.APPLE.INAPP.PAYMENT\","
                    "\"dataValue\": \"%@\""
                    "}"
                "},"
                "\"lineItems\": {"
                    "\"lineItem\": {"
                        "\"itemId\": \"1\","
                        "\"name\": \"Donation\","
                        "\"description\": \"Donation\","
                        "\"quantity\": \"1\","
                        "\"unitPrice\": \"0.01\""
                    "}"
                "}"
            "}"
        "}"
    "}", base64Encoded];
    
NSString *requestURI = @"https://apitest.authorize.net/xml/v1/request.api";
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:requestURI]];
    [request setHTTPShouldHandleCookies:NO];
    [request setTimeoutInterval:60];
    request.HTTPMethod = @"Post";
    request.HTTPBody   = [body dataUsingEncoding:NSUTF8StringEncoding];
    [request setValue:@"application/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    
    [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:
      ^(NSData * _Nullable data,
        NSURLResponse * _Nullable response,
        NSError * _Nullable error) {
          
          NSString *responseStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
          NSLog(@"Data received: %@", responseStr);
      }] resume];&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Aug 2017 18:02:37 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59534#M34117</guid>
      <dc:creator>katie</dc:creator>
      <dc:date>2017-08-25T18:02:37Z</dc:date>
    </item>
    <item>
      <title>Re: Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59544#M34127</link>
      <description>&lt;P&gt;A couple of things to look at:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The Apple Merchant ID that you enter into our site must be identical to the one that you created at the Apple site. If it is different, we&amp;nbsp;will not be able to to decrypt the payment data.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Must be an e-commerce transaction. Confirm that your gateway account is set up as a card-not-present account.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;The submitted data must be base64 encoded. As far as I can tell, you're doing that right, but double-check. I don't know if the BLOB you're getting back is already&amp;nbsp;base64 encoded, but maybe double-check to make sure you're not double-encoding it.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if this helps at all, or if I'm completely off the mark.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 23:29:39 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59544#M34127</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2017-08-25T23:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59564#M34146</link>
      <description>&lt;P&gt;Thanks Aaron! &amp;nbsp;I got it to work!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Apple Merchant ID was correct, but I think there was something wrong with my certificates. &amp;nbsp;After&amp;nbsp;re-generating my certificates I was able to get it to work. &amp;nbsp;Thanks for letting me know that the Apple Merchant ID is tied&amp;nbsp;to decrypting the payment data - that was what tipped me off to start looking there. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still haven't been able to get the sandbox environment to work, but that is probably another certificate-related issue. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only other thing I needed to do to make the transaction go through was to add the "billTo" fields in the JSON. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2017 18:29:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/59564#M34146</guid>
      <dc:creator>katie</dc:creator>
      <dc:date>2017-08-28T18:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/61729#M36140</link>
      <description>&lt;P&gt;I'm getting the following error:&lt;/P&gt;&lt;PRE&gt;Failed Transaction.
Error Code: 153
Error message: There was an error processing the payment data. Unable to decrypt data.&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;Your help is much appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'm sending the opaquedata.dataValue as the base64 encoded data that contains the version, data, signature, header(ephemeralPublicKey, publicKeyHash, transactionId).&lt;/P&gt;</description>
      <pubDate>Thu, 15 Feb 2018 19:52:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/61729#M36140</guid>
      <dc:creator>vrangasa1</dc:creator>
      <dc:date>2018-02-15T19:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/62435#M36757</link>
      <description>&lt;P&gt;We generated the token using apple pay and transaction is successful for sandbox environment.We used exactly the same process for token generation for live environment but we get the above error:&lt;/P&gt;&lt;P&gt;"Required fields are missing from decrypted data".In sandbox mode&amp;nbsp;&lt;/P&gt;&lt;P&gt;PKMerchantCapability&lt;SPAN&gt;.&lt;/SPAN&gt;capability3DS works, while in live mode we get below error:&lt;/P&gt;&lt;P&gt;"This processor does not support this method of submitting payment data."&lt;/P&gt;&lt;P&gt;As mentioned in possible solutions for error codes,&lt;/P&gt;&lt;P&gt;Changing it to&amp;nbsp;&lt;SPAN&gt;PKMerchantCapability&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;capabilityEMV does not help and gives the below response:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;Required fields are missing from decrypted data&lt;/SPAN&gt;".We have set all possible values of&amp;nbsp;&lt;/P&gt;&lt;P&gt;PKPaymentRequest including shippingAddress,Billing contact,etc.Also ensured that merchant account is card not present &amp;amp; encrypted data belongs to merchant.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In live environment,we are setting location of device to US and using US credit card details.Device is located in India.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample Response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"transactionResponse": {&lt;BR /&gt;"responseCode": "3",&lt;BR /&gt;"authCode": "",&lt;BR /&gt;"avsResultCode": "P",&lt;BR /&gt;"cvvResultCode": "",&lt;BR /&gt;"cavvResultCode": "",&lt;BR /&gt;"transId": "0",&lt;BR /&gt;"refTransID": "",&lt;BR /&gt;"transHash": "817E4EEE366139A5598A43F3CA026D41",&lt;BR /&gt;"testRequest": "0",&lt;BR /&gt;"accountNumber": "",&lt;BR /&gt;"accountType": "",&lt;BR /&gt;"errors": [&lt;BR /&gt;{&lt;BR /&gt;"errorCode": "153",&lt;BR /&gt;"errorText": "There was an error processing the payment data. Required fields are missing from decrypted data."&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"userFields": [&lt;BR /&gt;{&lt;BR /&gt;"name": "MerchantDefinedFieldName1",&lt;BR /&gt;"value": "MerchantDefinedFieldValue1"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"name": "favorite_color",&lt;BR /&gt;"value": "blue"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"transHashSha2": "0F4059266DB96EC3DF32F9B4A39F61E3BF26FF67523C31A42FCBBABDC841D3719038BE788DD47BC5227A05042B1BA2198AD4A137A6926BBC39E2C171ED9176B6"&lt;BR /&gt;},&lt;BR /&gt;"refId": "123456",&lt;BR /&gt;"messages": {&lt;BR /&gt;"resultCode": "Error",&lt;BR /&gt;"message": [&lt;BR /&gt;{&lt;BR /&gt;"code": "E00027",&lt;BR /&gt;"text": "The transaction was unsuccessful."&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2018 11:26:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/62435#M36757</guid>
      <dc:creator>Pragati</dc:creator>
      <dc:date>2018-04-02T11:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Apple Pay - Required fields are missing from decrypted data</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/63707#M37772</link>
      <description>&lt;P&gt;Hi, did you figure this out? I haven't had any luck talking to them. I never got the transactions to work when i use discover card but there is no problem processing visa card. It is pretty strange and very similar to what you're experiencing.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 20:53:33 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Apple-Pay-Required-fields-are-missing-from-decrypted-data/m-p/63707#M37772</guid>
      <dc:creator>dkatpa10</dc:creator>
      <dc:date>2018-07-13T20:53:33Z</dc:date>
    </item>
  </channel>
</rss>

