Hello community!
I'm new here, just a couple of months since I started learning this platform. Thanks to the forum and your advice, I was able to solve a number of difficult questions for me. I am very grateful to your.
Today I have a new problem! =) I will be glad to any advice!
Task:
1 Send payment data via WEBHOOK. (DONE) although I don't speak Portuguese, but the video of this guy @leoandradenet from YouTube helped me a lot.
2 synchronize this data with the buyer.
At this stage, I can match the email and phone number, thereby finding out which user the payment belongs to. (an easy solution would be to use the processing company's RES API, but I can't use it yet)
How can I assign a payment to a customer?
If that's your entire data model, it seems to me you need a Payment entity?
Hello Kilian,
I understand in general what you mean, but I'm not sure, can you give an example?
I have no experience, so most likely I just don't know what you're talking about.
You have a PaymentNumber and PaymentDate in your Order, but I would instead add a Payment Entity, containing an OrderId, PaymentNumber and PaymentDate, and create a Payment record when the payment is received.
Unfortunately, I made a mistake when I did the example.
I changed the screen in the post
You should be concerned with linking it to an order, rather than a buyer, you probably would like some repeat business, so hopefully same customer does many payments.
How to do it, we can't answer that for you, here's some questions only you know :
P.S. I'm going to let the remark about datamodels not being important slide, on account of you being a beginner ;-)
Hello Dorine,
Everything is very simple.
I have a one-time product (video course). After payment, access to the video opens. I cannot sell the same video course twice to the same client.
The client clicks on the button in the application and goes to the website of the processing company, where he makes the payment.
After a successful payment, I receive payment data via Webhook.
P.S As you rightly pointed out, I'm a beginner, it's very embarrassing to understand that even I'm asking the wrong question, thank you!
One course = one payment
The client cannot select several courses and pay for them at the same time
In the future, of course, I will try to implement this, but now such a task is not worth it.
I understand that my knowledge is not enough to implement it. Perhaps with the transition to the RES API in the future I will try to implement this
So then,
At the point where your client 'goes to the website of the processing company' your software is sending details to that service, right ? So you can create a payment record linked to the customer/course, generate a uuid as one of the attributes, send the uuid to that service, receive the same uuid back on the webhook.
So in the webhook logic you can use that uuid to find the customer/course the payment is for.
No Dorine, my software dont send details to the server.
If the software was sent data, I would have no problem getting this data back.
The maximum that I can do at this stage is to match the email and phone, thereby determining the sender.
I understand that this may not seem like a serious approach to you, but unfortunately I cannot yet use the entire REST API cycle of my processing company.
This is the problem I need to solve.
Determine the buyer according to the data received from the Webhook.
At this stage, I don't need more.
aah, ok,
I don't really see what type of help we can give you then, this is a functional question, not a technical one : how to match (incomplete or incorrect) information coming in with existing information in your database.
How do you even know if they used the same email when doing the payment ?
In that case, you can try to match, but you'll need a human trying to match manually if system can't.
Maybe if a payment comes in that doesn't match any orders, mail that email address in the payment with a request to reply with more information about who in your systems they are supposed to be / what order that payment was for ...
although I'm still not really getting how that payment comes into existence then, and how that service knows it needs to use that webhook of yours, I mean, how does that payment service even know how much money to charge ???
A landing page is created on the processing side, in the landing page settings, I specify a webhook by which processing sends payment data. The client fills in the mail and phone number, pays a fixed amount by credit card or other mobile app.
Usually I used MAKE to automate the process, after paying for the order, the client received a link to the course page by email/whatup/telegram/chatbot
I'm trying to make an android/iPhone app and want to opt out of the website, automation in MAKE, and other...
Hello Anton,
"How can I assign a payment to a customer?" is a really "broad" question.
Could you explain what it means? What you are trying to achieve? What are you asking, really?I mean, From the datam model you show here, I don't know what you want to do.
For a start, the relationship between the User, Products and Order does not seem correct.The way it is now, a product can be assigned to a single Order and to a single User. If another user wants that product, and you assign it to the user and the new product, you will lose the information about the previous User/Order.
So, I have to ask: is your problem with your data model?I mean, are you asking how to create the data model to allow you to keep information?
If so:
1. Create a new entity, OrderProduct, add OrderId and ProductId to it, Price and Quantity (maybe). It creates a many to many relationship between product and order, that it is what makes sense to me?
2. Remove UserId and OrderId from Products
3. Add UserId (your customer?) to Order. (one to many relationship)
Now products is just a list of products with the actual price. Order contains the information about the user (your customer) and OrderProducts keeps the iformation about the products for a specific order, and the price at the time of the order.
Does this help?
Hello Eduardo,
I have it all done like this
I receive payment data via Webhook, how can this data be associated with the user?