Programming of PayPal electronic payment method under. Net (1)

Source: Internet
Author: User
Tags install openssl

11 months later [20070122] I made another mistake in this article.
Apipassword is the password of API username set on PayPal
Certpassword is the certificate export password, which you set locally

This article only discusses and describes how to use the PayPal express checkout payment method. Currently, the Chinese PayPal (PayPal) cannot make payment with other PayPal, probably because the domestic currency market is not open yet, here, because my customer does not need to process PayPal, I did not read his information, but I think it should be similar. In this document, the content in pp_websitepaymentspro_integrationguide.pdf is introduced in Chinese, but I have made a detailed description of some details, which can reduce your confusion during development. Therefore, when you see familiar texts, please understand the painstaking efforts of the author. If you have any questions, you can leave a message here or at xike collection to find me.

As we all know, PayPal is an electronic payment gateway owned by eBay. Last year, it also acquired Verisign and zookeeper. Does it mean that he wants to unify electronic payment?

PayPal itself is an electronic payment gateway that can be charged or paid by email, but it also supports credit cards such as Visa card, MasterCard, American Express,

Discover Card is charged for these bad things, just like Verisign and called PayPal direct payments. But I heard that the service fee is too expensive and my customers didn't use this function, so I didn't study it either, however, since Verisign we are currently using has been acquired by people, I think it's not long before we use its direct payments.

Another simple payment method called websitepaymentsstandard is suitable for users who set up their own e-commerce websites on virtual hosts. websitepaymentspro is needed by a mature e-commerce website, let's hear from you one by one.

1 Installation
I have to say that PayPal has carefully developed a sandbox [I call it a silly box, haha] for testing by developers.

A. Install Microsoft. NET Framework Service Pack 1 or use Microsoft. NET framework2.0 directly.

B install OpenSSL for Microsoft Windows, no friends go to The http://www.slproweb.com/products/Win32OpenSSL.html to find and install

C install winhttpcertcmd.exe, no friends go to The http://www.microsoft.com/downloads/details.aspx? Displaylang = en & familyid = C42E27AC-3409-
Find and install 40e9-8667-c748e422833f,Add reference to the directory where winhttpcertcmd.exe is located in the path of your environment variable.

D To https://developer.paypal.com/register and create your test account, here you need to note that after successful registration you need to create a business account in sandbox


Both parties use a personal account as the payer. the email address does not conflict with your existing PayPal account. Remember to email the tab to activate your account.

And add a bank to your business account.

E. Enter the business account you just created from the sandbox, find the API access link, and make a request. Then, refresh your sandbox and check the test

Certificates can see a certificate. This certificate is your pass. Click it and download it.

F. Convert the certificate to the p12 format. I don't know what the p12 format is. Run the following command:
OpenSSL PKCS12-export-inkey Cert_key_pem.txT -In cert_key_pem.txt-out Mycert. p12 Remember to write in a row,
Cert_key_pem.txt is the source file mycert. p12 target file that requires you to enter a password and confirm the input. Enter and write down the password, which will be used in the next step.
G. Run the command to install the certificate to Windows.
Winhttpcertcfg-I mycert. p12-P Certpassword -C LOCAL_MACHINE \ My- Account
Here, certpassword is the password of your certificate. The one you noted down above should not be forgotten that the account is a Windows Account name. Here I suggest using everyone, which saves a lot of trouble.
You cannot specify the path of the mycert. p12 file.

The above two commands are all made in command line. If some friends are not familiar with the DOS path usage, please take the full path and check the winhttpcertcfg path in the PATH environment variable.

H. Install paypal_aspnet_sdk_v3_2.msi. I forgot to download it there. It is somewhere in www.paypal.com.

I test your installation. Find the sdk_root \ bin \ lele.exe file and run the command, specifically, sdk_root refers to the installation path of paypal_aspnet_sdk
after a small window appears, execute
1 addapiprofile apiusername sandbox where apiusername is the API user name on the page on which you download the certificate, do you think of it?
2 setapiprofile 0 apipassword where apipassword is the password of your certificate, it cannot be wrong
3 getrequesttemplate transactionsearch search-template.txt This is the command to return a test file from PayPal, after the operation is successful, it will go to the sdk_root \ bin \ path

A search-template.txt file appears. If no file exists, the system will prompt you for an error.
4. modify the content of the search-template.txt file
<Transactionsearchrequesttype>
<Startdate xmlns = "urn: eBay: API: paypalapi"> 0001-01-
01t00: 00: 00.0000000-08:00 </startdate>
</Transactionsearchrequesttype>
And save,
Execute call transactionsearchSearch-template.txtCheck whether there is success in the returned message. If yes, congratulations! You have installed it successfully!
Don't be discouraged if you don't have it. Follow these steps to check carefully and make no mistakes. Of course, your network conditions are similar.

I don't know if you like it.Article.. I want to know that there is no need to write it down.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.