xxrepo / ksStripe

Delphi interface for the Stripe Payment platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ksStripe

Delphi interface for the Stripe Payment platform

This is a work in progress so I welcome any feedback and/or suggestions :-)

Usage

procedure TForm15.Button1Click(Sender: TObject);
var
  AStripe: IStripe;
  AToken: string;
  ACharge: IStripeCharge;
begin
  // create stripe interface...
  AStripe := CreateStripe('sk_xxxx_xxxxxxxxxxxxxxxxxxxxxx');

  // generate a charge token...
  AToken := AStripe.CreateToken('4000000000000002', 10, 2015, '124');

  try
    // attempt to create the charge...
    ACharge :=  AStripe.CreateCharge(AToken, '2 x Widgets @ 5.00 GBP each', 1000);

    // show the result if successful...
    ShowMessage('charge status: '+ACharge.Status);

  except
    on E:Exception do
      ShowMessage('An error occured...'+#13+#13+AStripe.LastError);
  end;
end;

About

Delphi interface for the Stripe Payment platform


Languages

Language:Pascal 100.0%