Use PayPal Payment in an ASP.NET Web Application 3/3

Running Sample

The payment process is started with the PaymentStart.aspx site. After clicking button „Payment Start“ a connection to PayPal is etablished for authorization of buyer.

Please note the forwarding to https://sandbox.paypal.com URL in sandbox mode.

Now the well-known PayPal login mask can be seen.

Login with your test buyer account and you are forwarded to your test store.

You can select Continue (Weiter) or cancel and back to store. Please try both in your shop system! After clicking forward the authorized buyer is used for payment process and PayPal forward to PaymentComplete.aspx page.

With the PaymentComplete.aspx page you can implement the steps which are neccessary to complete the payment and the purchase in your shop system.

Make The App Able to Run

There are two modes available, the sandbox mode for testing and the live mode for productive systems. The switch between both is the IsTest boolean variable. If IsTest set to true, the sandbox mode is active. In the first lines of class PaymentConfiguration you can find the variable.

With the variable a switch between sandbox client ID / client secret and live sandbox client ID / client secret is implemented.

Insert your client id and client secret to sandbox configuration.

Start the web application project in debug mode now and test the payment process in the sandbox.

Go To Live

You need the client ID and client secret for PayPal Live mode. This keys can be created at https://developer.paypal.com webpage.

  • Go to Rest API apps and click to your app.
  • Switch between Sandbox and Live mode on the top right corner.
  • Get your client ID and client secret keys to implement in the web application.

Sample Code

The sample code is available here next time. Please have a little patience. For a beta test please contact me here.

Dieser Beitrag wurde unter DevCorner abgelegt und mit verschlagwortet. Setze ein Lesezeichen auf den Permalink.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.