Skip to content

Stone Deeplink integration for Delphi (Firemonkey)

Notifications You must be signed in to change notification settings

patrickmartinhuk/stone-deeplink

 
 

Repository files navigation

Stone Deeplink

A Delphi (Firemonkey) library for integration with Stone's card machine

⚙️ Installation

Installation is done using the boss install command:

boss install github.com/CarlosHe/stone-deeplink

Manual initialization (without component)

⚡️ Initializing an instance

uses
  Stone.Deeplink;

// GLOBAL VARIABLE
var
  FStoneDeeplinkApplication: TStoneDeeplinkAndroidApplication;

...

begin
  FStoneDeeplinkApplication := TStoneDeeplinkAndroidApplication.New(REPLACE_BY_SCHEME_NAME);
end.

⚡️ Defining the payment callback

uses
  Stone.Deeplink;

// GLOBAL VARIABLE
var
  FStoneDeeplinkApplication: TStoneDeeplinkAndroidApplication;

...

procedure StoneDeeplinkPaymentSuccess(const APaymentReturn: IStoneDeeplinkPaymentReturnEntity);
begin
// SUCCESSFUL RETURN
end.

procedure StoneDeeplinkPaymentError(const ACode: Integer; const AMessage: string);
begin
// RETURN WITH ERROR
end.

...

begin
  FStoneDeeplinkApplication.SetPaymentSuccess(StoneDeeplinkPaymentSuccess);
  FStoneDeeplinkApplication.SetPaymentError(StoneDeeplinkPaymentError);
end.

⚡️ Calling payment

uses
  Stone.Deeplink;

// GLOBAL VARIABLE
var
  FStoneDeeplinkApplication: TStoneDeeplinkAndroidApplication;

...

begin
  FStoneDeeplinkApplication.CallPayment(
      TStoneDeeplinkPaymentEntityBuilder.New
        .SetAmount(REPLACE_BY_AMOUNT_IN_CENTS)
        .SetTransactionType(TStoneDeeplinkTransactionType.Credit)
        .Build
  );
end.

About

Stone Deeplink integration for Delphi (Firemonkey)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Pascal 100.0%