Re: PgSendMail, PgLinkPoint, PgMCK (CyberCash) joins - Mailing list pgsql-general

From Trurl McByte
Subject Re: PgSendMail, PgLinkPoint, PgMCK (CyberCash) joins
Date
Msg-id Pine.LNX.4.20.0110251155080.23575-100000@trurl.anything3d.com
Whole thread Raw
In response to Re: PgSendMail, PgLinkPoint, PgMCK (CyberCash) joins  (Keary Suska <hierophant@pcisys.net>)
List pgsql-general
On Wed, 24 Oct 2001 (Yesterday), Keary Suska wrote:

  KS> Is there any documentation on PgMCK and how to use it? There appears to be
  KS> nothing informative in the tarball or on SourceForge.

I'm don't have time for it...

usage:  mck( OrderID, amount, pan, name, addr, city, state, zip, country, exp )
All fields is varchar.

Look some examples:
==========================================

SELECT mck(date_part('epoch',now()) || '12345', 'usd 34.95', '5555444455554442', 'Bill Clinton',
    '1600 Pennsylvania Avenue', 'Washington', 'DC', '20500', 'USA', '12/02', 'mauthcapture');

==========================================


Advanced usage (really used for marketing):
==========================================
create view ccardv as select id, "card-number" as number, "card-name" as
name, "card-address" as address,
    "card-city" as city, "card-state"::varchar as state, "card-zip" as zip,
"card-country" as country,
     to_char("card-exp",'YY/MM')::varchar as exp from ccard where login = CURRENT_USER;
grant select on ccardv to group "Customer";
grant update on ccardpay_seq to group "Customer";

create function mck_pay(numeric(16,2),name) returns boolean as '
declare
    IN_sum alias for $1;
    IN_login alias for $2;
    CCard  record;
    MCKorder     varchar;
begin
    if IN_sum <= 0 then
        return ''t'';
    end if;
    MCKorder := nextval(''ccardpay_seq'');
    for CCard in select * from ccardv2 where login = IN_login LOOP
        if mck( MCKorder, (''usd '' || IN_sum::float8)::varchar,
CCard.number, CCard.name, CCard.address, CCard.city,
         CCard.state, CCard.zip, CCard.country, CCard.exp,
''mauthcapture''::varchar) then
            insert into credit_history values ((select id from "User" where
login = IN_login), now(),
                (''Auto pile up a balance. MCK order #''::text ||
MCKorder::text), ''P'', IN_sum, ''AutoPilot Goga'');
            return ''t'';
        end if;
    end loop;
    return ''f'';
end;
' language 'plpgsql';
==========================================


  KS>
  KS> Keary Suska
  KS> Esoteritech, Inc.
  KS> "Leveraging Open Source for a better Internet"
  KS>
  KS> > From: Trurl McByte <trurl@anything3d.com>
  KS> > Reply-To: trurl@realtor3d.odessa.ua
  KS> > Date: Wed, 24 Oct 2001 14:37:20 +0300 (EEST)
  KS> > To: PgSQL General <pgsql-general@postgresql.org>,
  KS> > pgsql-announce@postgresql.org
  KS> > Subject: [GENERAL] PgSendMail, PgLinkPoint, PgMCK (CyberCash) joins
  KS> > SourceForge...
  KS> >
  KS> >
  KS> > PgSendMail, PgLinkPoint, PgMCK (CyberCash) joins SourceForge and avaible
  KS> > such as subtasks of project CommBinder.
  KS> > (http://sourceforge.net/projects/commbinder)
  KS> >
  KS> > You can download here from
  KS> > http://sourceforge.net/project/showfiles.php?group_id=35804
  KS> >
  KS> > Bugs, patches, features requests ready welcome.
  KS> >

--
     Trurl McByte, Capt. of StasisCruiser "Prince"

[Team romantic *000*]   [InterNIC: AR3200]   [RIPE: AR1627-RIPE]
[Fingerprint16: 98 C3 78 8E 90 E3 01 35 87 1F 3F EF FD 6D 84 B3]


pgsql-general by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Disable Transaction - plans ?
Next
From: "Johnny Predicto"
Date:
Subject: PostgreSQL & JDBC newbie question