[RUBY] Let's introduce the credit card function using payjp (preparation)

It's getting hotter. : flag_jp: I can't lose because of the influence of Corona. : pouting_cat: Let's clean the air conditioner soon! !!

The story is off. Yes, this time about payjp. Don't rush everyone. Tabs open too much! There is a computer, so wait a minute. Let's go! !! !! : older_woman_tone5:

What is 1 payjp? ??

Some people may be new to it, so to explain it briefly, It's very useful for implementing credit card functionality. Why is that?

When you think about the flea market apps, the table is

・ User table ・ Product table ・ Payment table

The above is required for purchase. As anyone who has used Mercari knows, you can pay by credit card when purchasing a product. And since the credit card that I used once is saved, I can use it without registering the next one. However, when I think about making this, I think like this.

If you save the entire credit card information in the DB and leak it, it's a big problem! !! !! !!

That's right. It's dangerous in terms of security. It is payjp that solves such problems. : fist:

2 Preparation before using payjp! !!

Suddenly VS code is too impatient. (If you can't stand it, please turn back.): Runner_tone5:

First of all, there is a payjp website, so access it !!

payjp

When you access it, it looks like this. A98696BE-2140-4A56-A422-FC761B3EC82D.png

Then, let's first register as a member from the login above. (It's free so it's safe ZE!)

3 If you can register.

After logging in, it looks like this. (Must be in test mode !!)

35E47BE9-F000-4278-8407-32F70D7A23D5.png

4 I didn't have enough, so add it! !!

I didn't put the payjp gem.

Yes, payjp has a gem, so let's Gemfile !!

Gemfile


gem 'payjp'

bundle install!!!

This is the end of preparation. See you next time in the credit card registration section. (I will write an article tomorrow.): Point_up:

Recommended Posts

Let's introduce the credit card function using payjp (preparation)
[Rails] Implement the product purchase function with a credit card registered with PAY.JP
Implement the product category function using ancestry ① (Preparation)
Let's understand the function!
User evaluation using the like function
[Rails] I will write the mechanism and method of using payjp (API) very carefully (Credit card registration)
Let's specify the version when using docker
Let's analyze the GC log using GCMV
Implement the star five function using the for statement
How to implement the breadcrumb function using gretel