Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:36:48+00:00 2026-06-07T15:36:48+00:00

I use a class to charge credit cards; every time a transaction gets processed

  • 0

I use a class to charge credit cards; every time a transaction gets processed I just change the properties like the card number and date and submit.

It happened that the properties weren’t set right and the transaction goes through using the old card number. Terrible.

So to prevent this from happening again I want to make sure all the properties in the class are back to default. I’m thinking of something like disposing the created class and recreate it. But I’m not sure how to do it in Delphi.

This is my current code:

if frmPayAware = nil then  
  Application.CreateForm(TfrmPayAware, frmPayAware);
  frmPayAware.ProcessCredit(eExpDate.Text,FTrack,eNameOnCard.Text,eCardNum.Text,0);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:36:51+00:00Added an answer on June 7, 2026 at 3:36 pm

    You can either create a clear method, that clears all properties. Or you can create the form for each use:

    var
      frm : TfrmPayAware;
    begin
      frm := TfrmPayAware.Create(nil);
      try
        frm.ProcessCredit(eExpDate.Text,FTrack,eNameOnCard.Text,eCardNum.Text,0);
      finally
        frm.Release;
      end;
    end;
    

    Personally, I prefer the later method because is assures that each time a form is used, it is in the same state (just created).

    Free vs Release
    Release, posts the message CM_RELEASE to the form. If the message is processed (after all other messages are processed) Free is called.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to change PowerPacks.LineShape smoothingMode? I tried to use this code(a class
To simulate enums in PHP I like to use class constants. e.g. class FRUIT
I'm trying to use class names to change the color of a link after
I use class from How to support Arabic text in Android? to show Arabic
I am trying to use Class::DBI with Catalyst::Plugin::Authentication::Store::DBIC. The example given on CPAN does
I have to use class Matrix4x4 from some 3rd party library, and I need
How to decide when to use object adapter and when to use class adapter?
Use case: class MyTask(Task): queue = 'default_queue' def run(self): # do work Normally I
Use case: class A { static int s_common; public: static int getCommon () const
I use this class to parse a .css file. https://github.com/sabberworm/PHP-CSS-Parser I thought it's easy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.