Delphi interface for the Stripe Payment platform
This is a work in progress so I welcome any feedback and/or suggestions :-)
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;