Pesapal.com

Forum

Welcome, Guest
Username
Password:
 

Custom form field
(1 viewing) (1) Guest
Welcome to the Pesapal integration forum!

This forum discusses everything about Pesapal integration on your web site. Having any problems? This is the right place to post a question and we are sure you will get an answer
  • Page:
  • 1

TOPIC: Custom form field

Custom form field 4 months ago #2145

Hi developers

Is it possible to send a custom field alongside the payment details after a client has filled out the iframe form. The field could be containing the user's id and product id. I'd like this custom field values to be posted back to my ipn listener so that I can activate the user's access in the backend/ background. Anyone please or if there is a better approach, kindly assist Thanks in advance.

What I am currently doing is I am sending this info through the callback url, which I think is not such a good idea since the user can access sensitive info or modify it to gain fraudulently.

This functionality is replicated in paypal's ipn
Last Edit: 4 months ago by slimfresh.

Re: Custom form field 4 months ago #2146

  • markm
  • OFFLINE
  • Administrator
  • Posts: 64
Greeting Slim,

I can think of 2 suggestions based on what you already have


  1. You can encrypt the information coming back on the callback and decrypt on receiving the details - This means a user cannot tamper with the info since it's not plain text
  2. Another approach would be to associate every transaction reference with the ID of user and Product ID, that way once you receive the callback or IPN notification for that reference, you can check your DB for which the user and product to update - I would recommend this approach based on the 2, since it will work for both the callback URL as well as IPN and it's more full-proof


Let us know once you manage to implement.
Last Edit: 4 months ago by markm.

Re: Custom form field 4 months ago #2147

Hi @Markm

Thanks for the response.

I've already implemented it using the callbackurl where I attach an encrypted user id and product id. When the url is called thats when I insert the data into my database and when the ipn script is called, I update the status of the already existing row in the database. Its working well BUT now my concern is if the record is NOT inserted into the database when the callbackurl is called (maybe due to network failure) OR the ipn gets called first and there is no existing row in the database which the ipn would update, then the whole process fails. So I was thinking in my ipn listener I should check if there is an existing row in the database and if not I insert one. Thats why i need the user's id and product id to be sent to the IPN listener.

In the database I insert the user id, product id, payment status, merchant id, tracking id and timestamp

Re: Custom form field 4 months ago #2148

  • markm
  • OFFLINE
  • Administrator
  • Posts: 64
I would in that case advice that you save the details before you ask the customer to pay. That way, it's treated as a pending order in your database.

On Callback or in IPN execution, you can then simple update the status of that order based on the payment status that you have received from Pesapal.

This is also helpful should you want to build a process that reminds the customer of their payment incase they abandoned midway or did not complete immediately.
Last Edit: 4 months ago by markm.

Re: Custom form field 4 months ago #2149

Thanks for the idea. I will insert a record in the database before payment form is filled and maybe set the status to awaiting payment. Then attach the custom field values to the callback url and when payment is made and the url is called, I cross check the data received with what I hv in the database and update where necessary then set status to awaiting response. When the IPN is called it updates the status of the already existing entry.
  • Page:
  • 1