Jump to content

Send to Paypal the number of the order


Recommended Posts

Hi again,

sorry if i keep posting this but i really can't find a solution, i asked everywhere (even here) but noone could help me.

The problem is this one: i need to send to Paypal, when someone places an order and pays with PP, the number of the order together with the other infos.

I guess that if the data PP gets is all got form the DB, there's for sure a command, a line, a procedure, whatever that gets the number of the order and sends it to PayPal, so it figures in the mail paypal sends me (with payment confirmation).

 

Why can it send name, products and totals and it can't send this "Order number"?

I have to modify something about the mails?

I have to ask Paypal directly (already done, didn't get a single answer)?

Where can i fine the string that "calls" all of that data (name, products, etc) and how can i modify it so it fetches the number of the order too?

Or at least, where are the folders, the files, the whatever where this "Order number" is stored? I guess in the DB, but how can i call it form there?

 

Thanks in advance, this is pure desperation ;(

Link to comment
Share on other sites

If you create invoices within Paypal you have invoice number. I don't know if this is not reachable from outside.

 

I think your problem is rather small because in the shop you will see the payment and it's rather easy to figure out who is paying what.

 

In the back office you will see in green (see picture) PAYMENT ACCEPTED when you have got money from Paypal

 

 

Is your shop in operation?

post-304773-0-38070300-1393761366_thumb.png

Link to comment
Share on other sites

Thanks Vekia and thanks peranders for the replies.

 

@Vekia: i just need to find a way to get the paypal mail with "something" that shows me the order number, order ID, invoice number or so. Only because the customer doesn't want to check in the shop, he wants to see the number of the order directly in the mail from paypal once the customer has paid. The customer pays, Paypal sends him the mail (with name, products, totals etc) and in that mail he wants to see "Order number xxxx". Is it possible something like that?

 

@peranders: i know the problem doesn't exist,  i know very well but... the customer doesn't want to open the shop because he says it's faster to see which order it is just checking the paypal mail. He doesn't want to do otherwise. But in your pic i see there's the invoice number, is there a way to "put" it in the mail that paypal sends me? Maybe next to the customer name, like "James Highroad, invoice #0000012"? Only because he's VERY lazy, he doesn't want to check the order status and he doesn't want to check on the Paypal site.... he wants the mail with ALL already inside.

 

Resuming, i'd like to find a way to make that invoice number/order number appear in that confirmation of payment mail from PP. How can i do? he menaced me he's not going to pay for my work if i don't solve that (i repeat, he's VERY lazy). And the number of the order and invoice number are equal? If not, i can make them equal?

 

Thanks again

Link to comment
Share on other sites

He has the mail alerts activated, but he doesn't want to check the payment status.... i know, it's something stupid and it takes about 10 seconds to check if the customer paid or not but... he wants to see that number there. I tried to explain him it's all useless and a loss of time (for me over all, since i can't figure out how to that) bue... he wants it and he doesn't pay me if i don't give him what he wants (i made his shop and configured it + maintenances and so).

Link to comment
Share on other sites

I add an image with the PP mail, after a customer paid in another php site of e-commerce (the old one my customer was using):

 

post-725020-0-42905100-1393867237_thumb.jpg

 

It's in italian, but i don't think it's a problem ;P

 

As you can see, there's a single product called "Ordine n. xxxx" and that's the number of that order.

I'd need a line like that one (no need the quantity, the euros and so, just the number). For that, i imagined i had to add a product called "Order" and in the description the number created by the shop when the customer places an order. Is it possible?

Link to comment
Share on other sites

The problem here is that the Order Number is not assigned until after the payment is complete.  Unless you completely redesign how the paypal module works... where you would create the order first using a pending order status, then have the payment performed sending the order number to paypal (instead of cart id), and then if successful change the order status to 'accepted'.

 

alternatively, you can revise the mailalerts module to retrieve the paypal payment status directly from paypal, and include it in the mail alerts email.  this is the route I would go.

  • Like 1
Link to comment
Share on other sites

I'm not going to go into the coding of it, unless you are looking to hire a developer, but I can give you direction on what changes you could make.  You'll need to work with your client to determine what exactly they are getting in the Paypal email that is important to them.

 

I see 2 options

1) the paypal module records the payment status received from Paypal.  You can find it in the ps_paypal_order table.  Typically the value would be "completed" if it were successful.  You can refer to this URL for the other possible "paymentstatus" values. 

https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/

 

If these are the values your client wants, then you would alter the mailalerts module to query the ps_paypal_order table based on id_order, grab the payment_status value, and include it in the email.

 

 

2) if more information is required that is not provided in the database table, then I would use Paypal's "GetTransactionDetails" API to retrieve the payment information.  You can refer to this URL for the possible request/response parameters

https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/

 

The Paypal module includes all the necessary API functions to retrieve the details, you can review the "_updatePaymentStatusOfOrder" function in the Paypal module on how to use this service.

Link to comment
Share on other sites

I'm super ignorant about API, i tried something but it doesn't work, i don't know how to do it correctly.

How can i alter the mailalert module? Since he just need to see "completed" in the mail from the mailalert, would be great to get that information. So, about:

 

 "query the ps_paypal_order table based on id_order, grab the payment_status value, and include it in the email"

 

How can i do to do this (sorry again for my ignorance)?

Link to comment
Share on other sites

as I stated earlier, I'm not going to code this solution for you in a forum post.  If you are looking to hire a developer to do it for you, feel free to send me a PM, otherwise I have given you plenty of information for you to explore and figure this out your self.

Link to comment
Share on other sites

×
×
  • Create New...