Happy Business Starts Here

Highlighted
Zuora Alumni

'NullValue' issue when using Direct Post

When using Direct Post method to submit credit card information, the following fields need to be encrypted and in the exact sequence:

 

creditCardNumber%3ANullValue%2C%20cardSecurityCode%3ANullValue%2C%20"

 

With the correct sequence, why am I still getting ?

 

"errorCode=HostedPageFieldValidationError;errorMessage=creditCardNumber%3ANullValue%2C%20cardSecurityCode%3ANullValue%2C%20"



If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

3 REPLIES 3
Zuora Alumni

Re: 'NullValue' issue when using Direct Post

'NullValue' error from Direct Post usually means encryption problem. Aside from having the correct squence as below:

 

creditCardNumber%3ANullValue%2C%20cardSecurityCode%3ANullValue%2C%20

 

 

Please make sure to use HPM2Security-min.js for encryption. When rendering Zuora iFrame, "HPM2Security-min.js" is one of the javascript files that will be downloaded. It is responsible for encrypt fields encryption and therefore must be used for encryption and not other libraries. Zuora window.onload event to trigger its download.

 

window.onload = function (){
jQuery.getScript('<z:srurl file="Hosted/lite2/js/HPM2Security-min.js"/>');
};


If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

Re: 'NullValue' issue when using Direct Post

Hi Patrick,

 

Can you please share the methods to be used from the library and a sample implementation for the 

Follow the below steps to construct the credit card fields for HTML Direct POST:

  1. Construct the string in the following format:
    #field_CreditCardNumber#field_CreditCardSecurityCode#field_CreditCardExpirationMonth#field_CreditCardExpirationYear
  2. Encode the formatted string to Base64.
  3. Encrypt the encoded string with the public key.
    You can use the RsaEncrypter.encrypt java function defined in the Zuora security library to encrypt the string. 
  4. Encode the encrypted string to Base64.
  5. Set the encoded string to the encrypted_values field.
Zuora Documentation

Re: 'NullValue' issue when using Direct Post

Knowledge Center is also updated to provide more sample codes to explain how to obtain the encrypted value for Zuora. Please refer to Obtain the Encrypted Credit Card Information for Direct POST section on the Direct Post page.