@@ -109,10 +109,18 @@ TYookassaSupplier = class(TYookassaAPIObject)
109109 atAgent // agent
110110 );
111111
112+ { Признак способа расчета передается в параметре payment_mode }
113+ TPaymentMode = (
114+ pmNone,
115+ pmFullPrepayment, // Полная предоплата
116+ pmFullPayment // Полный расчет
117+ );
118+
112119 { TYookassaReceiptItem }
113120 TYookassaReceiptItem = class (TYookassaAPIObject)
114121 private
115122 FAgentType: TYookassaAgentType;
123+ FPaymentMode: TPaymentMode;
116124 FSupplier: TYookassaSupplier;
117125 function GetAgentTypeString : string;
118126 function GetSupplier : TYookassaSupplier;
@@ -122,15 +130,15 @@ TYookassaReceiptItem = class(TYookassaAPIObject)
122130 AmountValue: Currency;
123131 AmountCurrency: string;
124132 VatCode: Integer;
125- PaymentMode: string;
126133 PaymentSubject: string;
127134 MarkMode: Integer;
128135 MarkCodeInfo: string; // base64 gs_1m,
129136 Measure: string;
130137 constructor Create;
131138 destructor Destroy; override;
132139 function ToJSON : TJSONObject; override;
133- property AgentType: TYookassaAgentType read FAgentType write FAgentType;
140+ property AgentType: TYookassaAgentType read FAgentType write FAgentType;
141+ property PaymentMode: TPaymentMode read FPaymentMode write FPaymentMode;
134142 property Supplier: TYookassaSupplier read GetSupplier;
135143 end ;
136144
@@ -310,6 +318,16 @@ function ReceiptTypeToString(aType: TReceiptType): String;
310318 end ;
311319end ;
312320
321+ function PaymentModeToString (aPaymentMode: TPaymentMode): String;
322+ begin
323+ case aPaymentMode of
324+ pmFullPrepayment: Result:=' full_prepayment' ;
325+ pmFullPayment: Result:=' full_payment' ;
326+ else
327+ Result:=EmptyStr;
328+ end ;
329+ end ;
330+
313331{ TYookassaResponse }
314332
315333constructor TYookassaResponse.Create(ARaw: TJSONObject);
@@ -574,7 +592,7 @@ function TYookassaReceiptItem.ToJSON: TJSONObject;
574592 aAmount.Add(' currency' , AmountCurrency);
575593 Result.Add(' amount' , aAmount);
576594 Result.Add(' vat_code' , VatCode);
577- if PaymentMode <> EmptyStr then Result.Add(' payment_mode' , PaymentMode );
595+ if FPaymentMode <> pmNone then Result.Add(' payment_mode' , PaymentModeToString(FPaymentMode) );
578596 if PaymentSubject <> EmptyStr then Result.Add(' payment_subject' , PaymentSubject);
579597 if MarkMode >= 0 then
580598 begin
0 commit comments