N
N
nepster-web2015-03-02 15:54:08
PHP
nepster-web, 2015-03-02 15:54:08

How do I create an invoice before submitting a payment form?

Connecting payment systems to the site, I ran into an interesting problem.
The payment system doesn't matter, but let's take perfectmoney as an example .
To connect perfectmoney to our website, we just need to place a payment form with certain data (usually this is the account id, payment amount, account number and additional data such as a description, etc.).
The task is to do this:
The user enters the site -> selects a product or service -> clicks pay and gets to the perfectmoney website.
The Problem The
problem is that we need to fill the form with the account number that the user must pay.
That is, at the moment when the user goes to the page of the site with the form of payment, we do not have an account id.
No need
to complicate It is easy to solve the problem by asking the user to create an account, and only then pay. But this is an unnecessary action that complicates the use of the site and does not allow doing so!
There is another way
I noticed this way:
https://github.com/yii-dream-team/yi...directForm.php
That is, we make a request to our server, create an account, generate a form for perfectmoney and submit using js shape.
But what about disabled js? Yes, there are few such users, but we are perfectionists. How messy is this method?
From the above, the question arises:
Please tell me how to properly organize payment through the payment system by creating an account for the user?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
F
FanatPHP, 2015-03-02
@FanatPHP

Solution: Expel the drafter of the TOR without severance pay. Hire a specialist.
PS. I didn't see perfectmoney, but I bet 100 against 1 that the "perfectionist" will not be able to fill in two fields there.

R
Rockman, 2015-03-02
@1Rockman

Maybe I didn’t quite understand what exactly you want, but I have been working with payment systems for a long time and the same method is everywhere. The account number is needed personally by your service, so that later the payment system, when the client pays, will send you a request that a certain invoice has been paid.
Roughly speaking, a table with accounts
User with id 777, wants to pay 500 rubles, clicks "pay" a new account is created:
Then your script sends a request to the payment system where it indicates account id = 1, and the amount of 500 and other data if required.
After the client pays, the payment system will send you a request that the invoice with id 1 has been paid for 500 rubles. By this id, you will determine which user paid and how much and replenish his account with 500 rubles, or provide him with a service or product.
and change data in table
1, 777, 500, true

D
Dmitry S, 2015-03-02
@Hakkunamatata

But what about disabled js?

Working way, it's not always helpful to be a perfectionist. After all, the "best", as you know, is the enemy of the "good".

C
Centrino, 2015-03-02
@Centrino

Here the problem is different. How are you going to then identify which customer paid for what on the site? If you were a charitable foundation, then it would be enough for you to substitute the time value in microseconds in the ID field, for example.
You described the structure of the store, without creating an order in your database, without identifying the cost of the order, currency, or linking to the client. How then should the client contact you in order to receive the goods? Write to support with the indication and print-screen of the payment from the wallet? Isn't it gemorno in comparison with the creation of an order.
Do you plan to automatically process orders when data is returned to your return (server, interaction) url? How will you notify the client that his order has been paid for and he will receive it within time, or does he just have to wait for the manager to tear off his ass and decide to write to the client?
The action you described is not final, after payment it should get to your store, so that they say that everything is ok.
The problem is not in js, and not in fewer clicks or one more action. The problem is how you will notify customers without creating orders on the site.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question