Author Topic: Sending invoice number to paypal as part of product description  (Read 3188 times)

Offline dazzakiller

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Sending invoice number to paypal as part of product description
« on: 10/February/2008, 09:01:26 PM »
Hi,

I'm in the process of trying to use nBill as an event registration system for a youth conference.

I've successfully set up a form so that it processes and takes the user to paypal, when the user pays marks invoice as paid, etc. I would like to be able to automatically send the invoice number or registered persons name (that's automatically generated) as part of the product description that gets sent to Paypal. This would enable me to then cross check payment against the user registered for the event. As it will be mostly parents paying online for their children, therefore emails will be different etc and will be hard to know who's paid for who. There's likely to be about a thousand registrations.

Is this possible? If so how?

A bit of an aside question, is there any documentation on variable names that if would be possible to use for php echos etc?

Offline dazzakiller

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #1 on: 11/February/2008, 08:01:28 AM »
The other option might be that if it would be possible to post back the paypal transaction number..... but I would imagine this would mean creating extra fields in nBill.

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #2 on: 11/February/2008, 09:01:43 AM »
The invoice is not created until after payment has been confirmed, so it is not possible to send the invoice number to Paypal. This is because if the invoice is created first, then the customer backs out of payment, you are left with an unpaid invoice hanging around. Customers backing out of payment is not uncommon, even if they then go back and pay successfully later (in which case a 2nd invoice would be produced if it were created before payment).

Some progress has been made in enabling transactions to be tied up manually to records in nBill with the new transaction search feature. However, Paypal unhelpfully do not show the merchant's transaction ID - only their own (for some reason, the only time Paypal tell you the ID number that was used to create the payment is when a subscription is cancelled). So the only alternative, as you say, is for nBill to record the transaction number generated by Paypal. Even then, it will only be stored against the income record, but at least you have a way of telling which invoice it relates to. I will see if I can incorporate this into the next release.

As for echoing variables, it depends where you are doing it and what information you want.

Offline dazzakiller

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #3 on: 11/February/2008, 09:48:06 AM »
would it be possible to add a unique number, (generated by a hidden field) to the product description?

I suppose my question really is how can I add this to the product description that gets posted to Paypal?

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #4 on: 11/February/2008, 01:41:03 PM »
If you know PHP, in the 'submit code', you could change the contents of the $orders array. See this post for more: http://www.nbill.co.uk/forum/index.php?topic=255.0

Offline dazzakiller

  • Full Member
  • ***
  • Posts: 22
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #5 on: 12/February/2008, 04:09:52 PM »
After a fix that was applied in this post: http://www.nbill.co.uk/forum/index.php?topic=448.0 the issue that I was trying to address was sorted.

Basically my invoices when paid automatically online, were not being recorded as a income item. Now I've applied this fix I see that when someone pays online through paypal it records the transaction ID from Paypal on the income record, making it a breeze to reconcile.

Again thanks

Offline Gary

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #6 on: 18/February/2008, 12:24:23 PM »
I use nBill to invoice my clients. I normally only use the stand alone invoicing, so when a client comes to pay, they get an error saying the cart is empty if I choose to have a breakdown of the cost. Otherwise it is just left blank, which I think it is a bit rubbish.

I don't really know which orders array you're talking about either. All I want is it to go through to Paypal, with the item being Invoice 250 -  ?500 etc. Could you let me know if this is possible and where I might put the code?

Thanks

Offline netshine

  • Administrator
  • Hero Member
  • *****
  • Posts: 4,952
    • View Profile
Re: Sending invoice number to paypal as part of product description
« Reply #7 on: 18/February/2008, 03:38:07 PM »
At the moment, 'include breakdown' is supposed to send through the description of each line item on the invoice individually with its corresponding amount. Without include breakdown, it is supposed to send through the concatenated description of each line item as a single value, with the total amount due. If you are not seeing this behaviour, it suggests there might be a bug - if so, please raise a support ticket.

The invoice number is not currently supplied to the gateway, however I have just changed the code so that it will be passed through in the next release, and will appear as part of the description in the paypal gateway (this involves amending several files, 2 of which are encoded, so you will not be able to do this yourself). The $orders array is only relevant to adding PHP code to the advanced tab of an order form and is not relevant to paying individual invoices.