Var
client : PayPalAPIInterface;
credentials : RequesterCredentials;
trans : TransactionSearchReq;
UserID : UserIdPasswordType;
trans1 : TransactionSearchRequest;
Response : TransactionSearchResponse;
i : Longint;
begin
HTTPRIO1.URL:='
https://api-3t.paypal.com/2.0/';
client:=(HTTPRIO1
as PayPalAPIInterface);
credentials:=RequesterCredentials.Create;
UserID:=UserIdPasswordType.Create;
UserID.Username:='
';
UserID.Password:='
';
UserID.Signature:='
';
credentials.Credentials:=UserID;
HTTPRIO1.SOAPHeaders.Send(credentials);
trans1:=TransactionSearchRequest.Create;
trans:=TransactionSearchReq.Create;
trans1.StartDate:=TXSDateTime.Create;
trans1.Version:='
94.0';
trans1.StartDate.AsDateTime:=Now-10;
trans.TransactionSearchRequest:=trans1;
Response:=client.TransactionSearch(trans);
D_VT1.Open;
D_VT1.Clear;
For i:=Low(Response.PaymentTransactions)
To High(Response.PaymentTransactions)
do
Begin
D_VT1.Append;
D_VT1.FieldByName('
timestamp').AsDateTime:=Response.PaymentTransactions[i].Timestamp.AsDateTime;
D_VT1.FieldByName('
type').Text:=Response.PaymentTransactions[i].Type_;
D_VT1.FieldByName('
payer').Text:=Response.PaymentTransactions[i].Payer;
D_VT1.FieldByName('
payerdisplayname').Text:=Response.PaymentTransactions[i].PayerDisplayName;
D_VT1.FieldByName('
TransactionID').Text:=Response.PaymentTransactions[i].TransactionID;
D_VT1.FieldByName('
Status').Text:=Response.PaymentTransactions[i].Status;
D_VT1.FieldByName('
GrossAmount').Text:=StringReplace(Response.PaymentTransactions[i].GrossAmount.Text,'
.','
,',[]);
D_VT1.FieldByName('
FeeAmount').Text:=StringReplace(Response.PaymentTransactions[i].FeeAmount.Text,'
.','
,',[]);
D_VT1.FieldByName('
NetAmount').Text:=StringReplace(Response.PaymentTransactions[i].NetAmount.Text,'
.','
,',[]);
D_VT1.FieldByName('
GrossAmountcurrencyID').Text:=GetEnumName(TypeInfo(CurrencyCodeType),Integer(Response.PaymentTransactions[i].GrossAmount.currencyID));
D_VT1.FieldByName('
FeeAmountcurrencyID').Text:=GetEnumName(TypeInfo(CurrencyCodeType),Integer(Response.PaymentTransactions[i].FeeAmount.currencyID));
D_VT1.FieldByName('
NetAmountcurrencyID').Text:=GetEnumName(TypeInfo(CurrencyCodeType),Integer(Response.PaymentTransactions[i].NetAmount.currencyID));
D_VT1.Post;
End;
D_VT1.SaveToXML('
t1.xml');
D_VT1.Close;