Paypal Pro integration

Discussion in 'ASP.NET / ASP.NET Core' started by objuan, Dec 21, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have finished all my development for the integration of Paypal Pro for this site with multiple successful tests using a dev environment and Paypal's sandbox. I have now uploaded all my files to this site, and have attempted a couple of tests and am having issues. This is the first time I've done a Paypal Pro site, so I am still trying to figure things out. Based on what I can tell, it looks like the issue is with the certificate that Paypal provides users. You guys have installed this certificate on your end. The code for the shopping cart references the certificate, so I have extracted the Certificate from the text file that Paypal delivers, saved it with a .cer extention, and uploaded it to my root directory where I reference it. Something seems to be wrong with this approach. Because Paypal Pro is new, the documentation on it is somewhat limited, so I am looking for possible resolutions to my issue from multiple sources. Any advice?
     
  2. I think I've seen your support ticket with this same issue. The cause of the problem was that the .cer file was somehow corrupt. I got the Paypal Pro integration to work, and what I did was take the PEM txt file, open it in wordpad (not notepad). Then create a new text document (notepad), copy the BEGIN CERTIFICATE / END CERTIFICATE section (the public key) of the PEM file and pasted in the new text document, and saved as as .cer file.
     
  3. Thanks Aristotle,


    I finally got it to work as well. I found a handful of suggestions on what might be the issue, but here is what happened with me. I had a little bit of a struggle getting things set up to work in my dev environment using the Paypal sandbox, but after a few mishaps, things went smoothly. When I got everything ready to post live, I was confused about how to get the cert_key_pem.txt file prepped for use...uploaded to the root directory, etc. My first attempt involved cutting and pasting the Certificate (the part between Begin Certificate and End Certificate) into notepad and saving it as a .cer file. When I did this, I got errors. When I used the mmc console to import the .pem file (after formating per Paypal's documentation using openssl and then exporting it to the .cer file, then uploading, my errors went away. I've done a couple of tests in production, and it looks like I'm in shape.


    Thanks very much for taking a look at my problem. For anyone that has trouble with this in the future, please feel free to ask about any issues I had.


    Regards and happy holidays,


    objuan


    More detailed steps:


    Hi BlueLaser,



    I did have to place a copy of the .cer file in my root directory. It required a couple of steps. I had to download openssl for step one. This is what worked for me. I didn't use dotnetcharge though, so I'm not sure how it references the .cer file.



    1. Convert the cert_key_pem.txt file to p12 format:
    </o:p>

    1. <LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">Run>>cmd to getDOS prompt
      <LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">I placed openssl on my c drive= C:\Openssl
      <LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">cd c:\openssl\bin\openssl
      <LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">This should get you the Openssl prompt in Dos
      <LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in">pkcs12 ?export ?inkey c:\(location of your cert_key_pem.txt File)?in c:\(location of your cert_key_pem.txt File) ?out c:\(locationwhere you want to save your p12 file)filename.p12</o:p>
    2. Start the Microsoft Management Console (MMC) by going to Start -> Run. Type in mmc and press enter.

    From the Console menu in the upper left, choose the ?Add/Remove Snap-in?

    From the Add/Remove Snap-in dialog, click the ?Add? button.

    From the list of available snap-ins, double-click on certificates.

    On the certificates snap-in dialog, you will be given a choice of what certificates to mange. Choose the last option, ?Computer account?, and then click Next

    On the next dialog, you will be asked to select the computer to manage. Select local computer and click Finish.

    Click Close on the Add Standalone Snap-in box.

    Click OK on the Add/Remove snap-in box.

    Click the ?Certificates? icon to expand it. Then click ?Personal?.

    Under the Personal folder, right click on ?Certificates?. From the pop-up menu, go to All Tasks -> Import.

    The Certificate Import Wizard should open. Click Next.

    Browse to find the P12 file that contains your certificate and click Next.

    Enter the password that you assigned to the P12 file (this would have been entered on the PayPalTech site.) Leave all checkboxes unchecked and click Next.

    Select ?Automatically select the certificate store based on the type of certificate? and click next

    On the final page you will be able to preview the action. If everything appears correct, click Finish to import the certificate.
    3. Export the certificate.
    a. Click on the ?Certificates -> Personal -> Certificates folder to show the list of certificates available on the server. If you have just imported a new certificate, you may need to right click in the certificates list and choose refresh to make it show.
    b. Right click on the certificate that you have imported. From the pop-up menu, go to All Tasks ?> Export.
    c. The export wizard will display. Click next.
    d. Choose No, do not export the private key and click Next.
    e. Choose DER encoded and click next.
    f. Enter a file name with a CER extension. Make sure to note where this file is.
    g. The final page gives you confirmation of what will be done. Review and then click Finish to export the CER file.
    Once I went through these steps, I uploaded it and it worked. Let me know if you have any more questions. I know this can be frustrating. It took me about 3 days to finally get it to work.



    Happy New Year,

    objuan


     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page