-1

I am starting to develop a fundraising system, but I have one or two unclear things. Assume the payment gateways Visa, Mastercard, etc. are integrated in my website.

When a visitor wants to donate x mount of money to any campaign (there will be many different types of campaigns), the information will be saved in my table:

donateTable columns:

  • id: donatorId: paymentdate, paymentamount, campainID,status

When a visitor pays, this information should be saved in my table, but when a user wants to pay the final step, they will go to a third party payment gateway page. When the user reaches there, the user could pay or could change their mind.

If a user pays, my table should be updated, the balance of the campaign should be updated. So how does a fundraising systems work? Does a fundraising system use a single account with different reference code? I need explanation please.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Tigray
  • 1
  • 2

1 Answers1

1

Assume the payment gateways Visa, Mastercard, etc. are integrated in my website.

You almost certainly aren't working directly with Visa or Mastercard as they aren't payment gateways.

To get specifics, you'll need to pick a payment gateway as features can vary from vendor to vendor. But generally, the payment gateway page will allow you to redirect back to your website with some type of identifier for the payment. You'll verify that the payment succeeded and then update your table with the information from the payment gateway.

Here's some specific steps:

  1. While on your site, you set a session cookie with SameSite=Lax (you need the cookie to be set when the gateway redirects back to you).

  2. You redirect to the payment gateway.

  3. The customer pays, and the payment gateway redirects them back to you with some type of identifier.

  4. You verify the user is the same user that initiated the payment from the session cookie and verify that the payment completed by querying the payment gateway.

  5. You update the table that everything succeeded.

HPierce
  • 7,249
  • 7
  • 33
  • 49