Artem's blog

Mainly .NET (C#, ASP.NET) and my projects

Archives for Posts

A simple way to integrate PayPal into ASP.NET MVC 4

This week I was working on PayPal integration in Serial Key Manager(http://serialkeymanager.com/). Some time I spent trying to understand how this can be accomplished using a server language, ASP.NET, since I have not been able to find a clear tutorial that would be easy to follow, So, in this guide I am going to outline how the entire process works and provide you with working examples!

1. Setting up the development tools

The first thing you need is to create a PayPal developer account so that you can access this page https://developer.paypal.com/webapps/developer/applications/myapps. When you press on Sandbox accounts to the left of the page, you will have the option to create two types of accounts: Personal or Business

  • Personal account will be used when you buy your product
  • Business account is the account that will receive the payment from the Personal account.

Depending on how much your product will cost, you will have to insert an appropriate amount of money into the Personal account. I think you can have as much as you like since it is only for testing purposes.

2. Creating the button

Now, you will have to create two Views in a Controller, one where you have the button and one where you have the validation mechanism. Let’s start with the button! Put the code below into any View. My View name is IPN in the User controller.

3. Processing the information returned by PayPal

The example code is based on this code. Please take a look at it to see how it is done with several variables.

Now you need to create a new View in the controller, called IPN. Insert the following code:

PayPal provides you with many variables, so I suggest that you take a look at how the response looks like. When you’ve found a value that you would like to save into the database, use the GetPDTValue function to retrieve that value.

Please note down the Activation token found in the Buyers account in Profile>My Selling Tools>Website preferences> Update. Then, enable auto return and payment data transfer. There, you will also find the Activation token which you should add to:

A new twitter account

From now on, I am going to use twitter as a source of updates! https://twitter.com/artemlos

Evaluate string expressions

Learn more about how to change a lambda expression on runtime: http://mathosproject.com/updates/convert-a-string-expression-into-a-lambda-expression/

Integral approximation

Constructed an integral approximation application: http://mathosproject.com/updates/integral-approximation-tool/

A new video about HTML

Want to learn HTML from the beginning? See the video below!

Computer programming at Katedralskolan, Uppsala

Hi,

You might have seen the poster about Computer programming on the IB board (and other places). Let me introduce you what it is going to be about!

The idea of this project is to create a group of students interested in programming, mathematics, computer science, etc, and allow them to discuss the current technologies, attend lectures about different programming languages (including cool stuff in math), and investigate related topics (and present them in the group).

There is a big benefit for current IB12 to join this group, as it will count as Creativity (to attend the meetings) and Service (when you talk in front of others about something that you like).

I will encourage everyone to practice on presenting different topics in front of others in a group, as it is an important skill in many fields!

I hope this short summary has given you some introduction, however, if you would get any question, please always ask me (contact here)!

Hope to see you in the Villa on Thursday (19/9) 5:00 pm! 🙂

Best wishes,

Artem Los (IB11)

The Soviet punched card

In The spirit of modernism in the computer world, I wrote about a card that was used before to store information (mainly programs). Below, the actual card:

DSC00437-1

Depending on which number is removed in a column, different letters can be obtained. These letters are also printed at the top, so that it is easier to read the information. These cards were later combined in a pile, in order to produce a program. The corner is removed in order to be able to identify if it is misplaced easily.

Received a T-Shirt with my product’s logotype

Last week I wanted to get my product’s logotype on a T-Shirt, in order to promote it, and, because all other T-Shirts you can find in stores have very random images. As it is always better when the picture is somehow connected to something you like, I decided to order a test-print, which looks very good!

Photos made by Taisa Tregubova (my grandma)

IMGP3569-1-2
IMGP3567-1-2
IMGP3564-1-2

Visiting “Cosmonaut Victor Patsayev”

Today, I visited a ship that is currently being used by Roscosmos, the Russian space agency. Although this time I did not enter the actual ship, as I know, it is used to communicate with ISS, however, it operates from a stationary position located in Kaliningrad.

The history of rockets science interests me a lot, and therefore, I have written one work about the soviet perspective. My mam was a collector of postmarks, so I scanned some of the postmarks that are about space. (you can also download them from http://www.rurik.se/index.php?id=24242623)

Below, a picture of Cosmonaut Victor Patsayev.

IMGP3375-4

Hedgehogs beside my house

It is really cool to have hedgehogs in my garden, and I think they appreciate this as well as they get cat food every day. It appears to be a very big family, approx 3-4 kids and one mother. The mother has an interesting behaviour as it is eating up all the food. It might be milking them, but the kids eat the food as well, so I do not know. It is very strange, but the ma seems to be keeping everything by herself.

IMGP3145

IMGP3153

Page 4 of 6:« First« 1 2 3 4 5 6 »