"We were unable to decrypt the certificate id" for dynamically created button

_CL_
Contributor
Contributor

 Hello all,

 

I hope I will be able to find answer here because an error itself is not very informative. The problem is simple - I dynamically create secured Buy Button and for some reason the PP doesn't like what I POST.

 

BTW, trying this form shows me the same error - https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/ewp-techview-outside.

 

So, what I did is I generated private key and public key. I registered public key with PayPal and I have my certificate ID. I used this information to wrote a code in C# (http://forums.asp.net/t/1236969.aspx?Paypal+Encrypted+Website+Payments+EWP+Solution) because I couldn't find the official code sample. The signature with my private key and encryption with PayPal's public key happens w/o any issues. As a result I get form which looks like this (actual data is truncated):

 

<form id="dynamic-pp-form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
  <input type="hidden" name="cmd" value="_s-xclick">
  <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----
MIICqwYJKoZIhvcN...14GHvq63KEZ0/a4z11tWCHH7tAo
-----END PKCS7-----">
</form>

The data that gets signed and encrypted is a string with new line symbols "\n" to separate items i.e.

 

StringBuilder sbData = new StringBuilder();
sbData.Append("cmd=_xclick\n");
sbData.Append("business=XXX\n");
sbData.Append("item_name=XXX\n");
sbData.Append("item_number=XXX\n");
...
sbData.Append("cert_id=XXX");

 

I have also tried "\r\n" (AppendLine() method) and still no luck. Is it something I'm doing wrong and may be there is a way to get more informative error that would tell me that I have invalid signature or that the data that I signed has invalid formatting etc...

 

Thank you very much in advance.

 

--

Best Regards

Login to Me Too
4 REPLIES 4

_CL_
Contributor
Contributor

Hello all,

 

Sorry, no one has any comments about this? The sample on the oficial page is not working as well as lack of oficial .NET sample making it kind of hard to implement this feature.

 

Help would be greatly appreciated.

 

Thank you in advance.

 

BR

Login to Me Too

PayPal_Conor
Moderator
Moderator

Hi BR, 

 

Welcome to our Community 🙂

 

For a technical query like this, you might be best served by posting this message in our Sandbox Developer Forum instead. 

 

You can find this message board here and I'm sure our members will be able to help you with this one: http://ow.ly/Zl89H

 

Alternatively, you could also send a tweet to our Merchant Technical Support Team by using the handle @PayPal_MTS.

 

I hope this advice helps,

 

Conor

Login to Me Too

_CL_
Contributor
Contributor

Hello Conor,

 

Thank you very much for warm welcome and for tips about how to solve the issue. I will try sources you recommended.

 

BR,

Roman

Login to Me Too

PayPal_Conor
Moderator
Moderator

Happy I could help Roman! Please come back to let us know how you get on 🙂

 

Conor

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.