1#![allow(non_camel_case_types)]
2
3#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
4#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
5pub enum Payment {
6 InstrumentNotDefined,
8 AutomatedClearingHouseCredit,
10 AutomatedClearingHouseDebit,
12 AchDemandDebitReversal,
14 AchDemandCreditReversal,
16 AchDemandCredit,
18 AchDemandDebit,
20 Hold,
22 NationalOrRegionalClearing,
24 InCash,
26 AchSavingsCreditReversal,
28 AchSavingsDebitReversal,
30 AchSavingsCredit,
32 AchSavingsDebit,
34 BookentryCredit,
36 BookentryDebit,
38 AchDemandCashConcentrationDisbursementCcdCredit,
40 AchDemandCashConcentrationDisbursementCcdDebit,
42 AchDemandCorporateTradePaymentCtpCredit,
44 Cheque,
46 BankersDraft,
48 CertifiedBankersDraft,
50 BankChequeIssuedByABankingOrSimilarEstablishment,
52 BillExchangeAwaitingAcceptance,
54 CertifiedCheque,
56 LocalCheque,
58 AchDemandCorporateTradePaymentCtpDebit,
60 AchDemandCorporateTradeExchangeCtxCredit,
62 AchDemandCorporateTradeExchangeCtxDebit,
64 CreditTransfer,
68 DebitTransfer,
72 AchDemandCashConcentrationDisbursementPlusCcd,
74 AchDemandCashConcentrationDisbursementPlusCcd_Dup,
76 AchPrearrangedPaymentAndDepositPpd,
78 AchSavingsCashConcentrationDisbursementCcdCredit,
80 AchSavingsCashConcentrationDisbursementCcdDebit,
82 AchSavingsCorporateTradePaymentCtpCredit,
84 AchSavingsCorporateTradePaymentCtpDebit,
86 AchSavingsCorporateTradeExchangeCtxCredit,
88 AchSavingsCorporateTradeExchangeCtxDebit,
90 AchSavingsCashConcentrationDisbursementPlusCcd,
92 PaymentToBankAccount,
94 AchSavingsCashConcentrationDisbursementPlusCcd_Dup,
96 AcceptedBillExchange,
98 ReferencedHomeBankingCreditTransfer,
100 InterbankDebitTransfer,
102 HomeBankingDebitTransfer,
104 BankCard,
108 DirectDebit,
110 PaymentByPostgiro,
112 FrNorme697TelereglementCfonbFrenchOrganisationFor,
114 UrgentCommercialPayment,
116 UrgentTreasuryPayment,
118 CreditCard,
120 DebitCard,
122 Bankgiro,
124 StandingAgreement,
128 SepaCreditTransfer,
132 SepaDirectDebit,
136 PromissoryNote,
138 PromissoryNoteSignedByDebtor,
140 PromissoryNoteSignedByDebtorAndEndorsedByABank,
142 PromissoryNoteSignedByDebtorAndEndorsedByA,
144 PromissoryNoteSignedByABank,
146 PromissoryNoteSignedByABankAndEndorsedByAnother,
148 PromissoryNoteSignedByAThirdParty,
150 PromissoryNoteSignedByAThirdPartyAndEndorsedByA,
152 OnlinePaymentService,
154 TransferAdvice,
156 BillDrawnByCreditorOnDebtor,
158 BillDrawnByCreditorOnABank,
160 BillDrawnByCreditorEndorsedByAnotherBank,
162 BillDrawnByCreditorOnABankAndEndorsedByA,
164 BillDrawnByCreditorOnAThirdParty,
166 BillDrawnByCreditorOnThirdPartyAcceptedAnd,
168 NotTransferableBankersDraft,
170 NotTransferableLocalCheque,
172 ReferenceGiro,
174 UrgentGiro,
176 FreeFormatGiro,
178 RequestedMethodForPaymentWasNotUsed,
180 ClearingBetweenPartners,
182 JpElectronicallyRecordedMonetaryClaims,
184 MutuallyDefined,
186}
187
188impl crate::Code for Payment {
189 fn code(self) -> &'static str {
190 match self {
191 Payment::InstrumentNotDefined => "1",
192 Payment::AutomatedClearingHouseCredit => "2",
193 Payment::AutomatedClearingHouseDebit => "3",
194 Payment::AchDemandDebitReversal => "4",
195 Payment::AchDemandCreditReversal => "5",
196 Payment::AchDemandCredit => "6",
197 Payment::AchDemandDebit => "7",
198 Payment::Hold => "8",
199 Payment::NationalOrRegionalClearing => "9",
200 Payment::InCash => "10",
201 Payment::AchSavingsCreditReversal => "11",
202 Payment::AchSavingsDebitReversal => "12",
203 Payment::AchSavingsCredit => "13",
204 Payment::AchSavingsDebit => "14",
205 Payment::BookentryCredit => "15",
206 Payment::BookentryDebit => "16",
207 Payment::AchDemandCashConcentrationDisbursementCcdCredit => "17",
208 Payment::AchDemandCashConcentrationDisbursementCcdDebit => "18",
209 Payment::AchDemandCorporateTradePaymentCtpCredit => "19",
210 Payment::Cheque => "20",
211 Payment::BankersDraft => "21",
212 Payment::CertifiedBankersDraft => "22",
213 Payment::BankChequeIssuedByABankingOrSimilarEstablishment => "23",
214 Payment::BillExchangeAwaitingAcceptance => "24",
215 Payment::CertifiedCheque => "25",
216 Payment::LocalCheque => "26",
217 Payment::AchDemandCorporateTradePaymentCtpDebit => "27",
218 Payment::AchDemandCorporateTradeExchangeCtxCredit => "28",
219 Payment::AchDemandCorporateTradeExchangeCtxDebit => "29",
220 Payment::CreditTransfer => "30",
221 Payment::DebitTransfer => "31",
222 Payment::AchDemandCashConcentrationDisbursementPlusCcd => "32",
223 Payment::AchDemandCashConcentrationDisbursementPlusCcd_Dup => "33",
224 Payment::AchPrearrangedPaymentAndDepositPpd => "34",
225 Payment::AchSavingsCashConcentrationDisbursementCcdCredit => "35",
226 Payment::AchSavingsCashConcentrationDisbursementCcdDebit => "36",
227 Payment::AchSavingsCorporateTradePaymentCtpCredit => "37",
228 Payment::AchSavingsCorporateTradePaymentCtpDebit => "38",
229 Payment::AchSavingsCorporateTradeExchangeCtxCredit => "39",
230 Payment::AchSavingsCorporateTradeExchangeCtxDebit => "40",
231 Payment::AchSavingsCashConcentrationDisbursementPlusCcd => "41",
232 Payment::PaymentToBankAccount => "42",
233 Payment::AchSavingsCashConcentrationDisbursementPlusCcd_Dup => "43",
234 Payment::AcceptedBillExchange => "44",
235 Payment::ReferencedHomeBankingCreditTransfer => "45",
236 Payment::InterbankDebitTransfer => "46",
237 Payment::HomeBankingDebitTransfer => "47",
238 Payment::BankCard => "48",
239 Payment::DirectDebit => "49",
240 Payment::PaymentByPostgiro => "50",
241 Payment::FrNorme697TelereglementCfonbFrenchOrganisationFor => "51",
242 Payment::UrgentCommercialPayment => "52",
243 Payment::UrgentTreasuryPayment => "53",
244 Payment::CreditCard => "54",
245 Payment::DebitCard => "55",
246 Payment::Bankgiro => "56",
247 Payment::StandingAgreement => "57",
248 Payment::SepaCreditTransfer => "58",
249 Payment::SepaDirectDebit => "59",
250 Payment::PromissoryNote => "60",
251 Payment::PromissoryNoteSignedByDebtor => "61",
252 Payment::PromissoryNoteSignedByDebtorAndEndorsedByABank => "62",
253 Payment::PromissoryNoteSignedByDebtorAndEndorsedByA => "63",
254 Payment::PromissoryNoteSignedByABank => "64",
255 Payment::PromissoryNoteSignedByABankAndEndorsedByAnother => "65",
256 Payment::PromissoryNoteSignedByAThirdParty => "66",
257 Payment::PromissoryNoteSignedByAThirdPartyAndEndorsedByA => "67",
258 Payment::OnlinePaymentService => "68",
259 Payment::TransferAdvice => "69",
260 Payment::BillDrawnByCreditorOnDebtor => "70",
261 Payment::BillDrawnByCreditorOnABank => "74",
262 Payment::BillDrawnByCreditorEndorsedByAnotherBank => "75",
263 Payment::BillDrawnByCreditorOnABankAndEndorsedByA => "76",
264 Payment::BillDrawnByCreditorOnAThirdParty => "77",
265 Payment::BillDrawnByCreditorOnThirdPartyAcceptedAnd => "78",
266 Payment::NotTransferableBankersDraft => "91",
267 Payment::NotTransferableLocalCheque => "92",
268 Payment::ReferenceGiro => "93",
269 Payment::UrgentGiro => "94",
270 Payment::FreeFormatGiro => "95",
271 Payment::RequestedMethodForPaymentWasNotUsed => "96",
272 Payment::ClearingBetweenPartners => "97",
273 Payment::JpElectronicallyRecordedMonetaryClaims => "98",
274 Payment::MutuallyDefined => "ZZZ",
275 }
276 }
277}
278
279impl crate::Description for Payment {
280 fn description(self) -> &'static str {
281 match self {
282 Payment::InstrumentNotDefined => "Instrument not defined",
283 Payment::AutomatedClearingHouseCredit => "Automated clearing house credit",
284 Payment::AutomatedClearingHouseDebit => "Automated clearing house debit",
285 Payment::AchDemandDebitReversal => "ACH demand debit reversal",
286 Payment::AchDemandCreditReversal => "ACH demand credit reversal",
287 Payment::AchDemandCredit => "ACH demand credit",
288 Payment::AchDemandDebit => "ACH demand debit",
289 Payment::Hold => "Hold",
290 Payment::NationalOrRegionalClearing => "National or regional clearing",
291 Payment::InCash => "In cash",
292 Payment::AchSavingsCreditReversal => "ACH savings credit reversal",
293 Payment::AchSavingsDebitReversal => "ACH savings debit reversal",
294 Payment::AchSavingsCredit => "ACH savings credit",
295 Payment::AchSavingsDebit => "ACH savings debit",
296 Payment::BookentryCredit => "Bookentry credit",
297 Payment::BookentryDebit => "Bookentry debit",
298 Payment::AchDemandCashConcentrationDisbursementCcdCredit => {
299 "ACH demand cash concentration/disbursement (CCD) credit"
300 }
301 Payment::AchDemandCashConcentrationDisbursementCcdDebit => {
302 "ACH demand cash concentration/disbursement (CCD) debit"
303 }
304 Payment::AchDemandCorporateTradePaymentCtpCredit => {
305 "ACH demand corporate trade payment (CTP) credit"
306 }
307 Payment::Cheque => "Cheque",
308 Payment::BankersDraft => "Banker's draft",
309 Payment::CertifiedBankersDraft => "Certified banker's draft",
310 Payment::BankChequeIssuedByABankingOrSimilarEstablishment => {
311 "Bank cheque (issued by a banking or similar establishment)"
312 }
313 Payment::BillExchangeAwaitingAcceptance => "Bill of exchange awaiting acceptance",
314 Payment::CertifiedCheque => "Certified cheque",
315 Payment::LocalCheque => "Local cheque",
316 Payment::AchDemandCorporateTradePaymentCtpDebit => {
317 "ACH demand corporate trade payment (CTP) debit"
318 }
319 Payment::AchDemandCorporateTradeExchangeCtxCredit => {
320 "ACH demand corporate trade exchange (CTX) credit"
321 }
322 Payment::AchDemandCorporateTradeExchangeCtxDebit => {
323 "ACH demand corporate trade exchange (CTX) debit"
324 }
325 Payment::CreditTransfer => "Credit transfer",
326 Payment::DebitTransfer => "Debit transfer",
327 Payment::AchDemandCashConcentrationDisbursementPlusCcd => {
328 "ACH demand cash concentration/disbursement plus (CCD+)"
329 }
330 Payment::AchDemandCashConcentrationDisbursementPlusCcd_Dup => {
331 "ACH demand cash concentration/disbursement plus (CCD+)"
332 }
333 Payment::AchPrearrangedPaymentAndDepositPpd => {
334 "ACH prearranged payment and deposit (PPD)"
335 }
336 Payment::AchSavingsCashConcentrationDisbursementCcdCredit => {
337 "ACH savings cash concentration/disbursement (CCD) credit"
338 }
339 Payment::AchSavingsCashConcentrationDisbursementCcdDebit => {
340 "ACH savings cash concentration/disbursement (CCD) debit"
341 }
342 Payment::AchSavingsCorporateTradePaymentCtpCredit => {
343 "ACH savings corporate trade payment (CTP) credit"
344 }
345 Payment::AchSavingsCorporateTradePaymentCtpDebit => {
346 "ACH savings corporate trade payment (CTP) debit"
347 }
348 Payment::AchSavingsCorporateTradeExchangeCtxCredit => {
349 "ACH savings corporate trade exchange (CTX) credit"
350 }
351 Payment::AchSavingsCorporateTradeExchangeCtxDebit => {
352 "ACH savings corporate trade exchange (CTX) debit"
353 }
354 Payment::AchSavingsCashConcentrationDisbursementPlusCcd => {
355 "ACH savings cash concentration/disbursement plus (CCD+)"
356 }
357 Payment::PaymentToBankAccount => "Payment to bank account",
358 Payment::AchSavingsCashConcentrationDisbursementPlusCcd_Dup => {
359 "ACH savings cash concentration/disbursement plus (CCD+)"
360 }
361 Payment::AcceptedBillExchange => "Accepted bill of exchange",
362 Payment::ReferencedHomeBankingCreditTransfer => {
363 "Referenced home-banking credit transfer"
364 }
365 Payment::InterbankDebitTransfer => "Interbank debit transfer",
366 Payment::HomeBankingDebitTransfer => "Home-banking debit transfer",
367 Payment::BankCard => "Bank card",
368 Payment::DirectDebit => "Direct debit",
369 Payment::PaymentByPostgiro => "Payment by postgiro",
370 Payment::FrNorme697TelereglementCfonbFrenchOrganisationFor => {
371 "FR, norme 6 97-Telereglement CFONB (French Organisation for"
372 }
373 Payment::UrgentCommercialPayment => "Urgent commercial payment",
374 Payment::UrgentTreasuryPayment => "Urgent Treasury Payment",
375 Payment::CreditCard => "Credit card",
376 Payment::DebitCard => "Debit card",
377 Payment::Bankgiro => "Bankgiro",
378 Payment::StandingAgreement => "Standing agreement",
379 Payment::SepaCreditTransfer => "SEPA credit transfer",
380 Payment::SepaDirectDebit => "SEPA direct debit",
381 Payment::PromissoryNote => "Promissory note",
382 Payment::PromissoryNoteSignedByDebtor => "Promissory note signed by the debtor",
383 Payment::PromissoryNoteSignedByDebtorAndEndorsedByABank => {
384 "Promissory note signed by the debtor and endorsed by a bank"
385 }
386 Payment::PromissoryNoteSignedByDebtorAndEndorsedByA => {
387 "Promissory note signed by the debtor and endorsed by a"
388 }
389 Payment::PromissoryNoteSignedByABank => "Promissory note signed by a bank",
390 Payment::PromissoryNoteSignedByABankAndEndorsedByAnother => {
391 "Promissory note signed by a bank and endorsed by another"
392 }
393 Payment::PromissoryNoteSignedByAThirdParty => "Promissory note signed by a third party",
394 Payment::PromissoryNoteSignedByAThirdPartyAndEndorsedByA => {
395 "Promissory note signed by a third party and endorsed by a"
396 }
397 Payment::OnlinePaymentService => "Online payment service",
398 Payment::TransferAdvice => "Transfer Advice",
399 Payment::BillDrawnByCreditorOnDebtor => "Bill drawn by the creditor on the debtor",
400 Payment::BillDrawnByCreditorOnABank => "Bill drawn by the creditor on a bank",
401 Payment::BillDrawnByCreditorEndorsedByAnotherBank => {
402 "Bill drawn by the creditor, endorsed by another bank"
403 }
404 Payment::BillDrawnByCreditorOnABankAndEndorsedByA => {
405 "Bill drawn by the creditor on a bank and endorsed by a"
406 }
407 Payment::BillDrawnByCreditorOnAThirdParty => {
408 "Bill drawn by the creditor on a third party"
409 }
410 Payment::BillDrawnByCreditorOnThirdPartyAcceptedAnd => {
411 "Bill drawn by creditor on third party, accepted and"
412 }
413 Payment::NotTransferableBankersDraft => "Not transferable banker's draft",
414 Payment::NotTransferableLocalCheque => "Not transferable local cheque",
415 Payment::ReferenceGiro => "Reference giro",
416 Payment::UrgentGiro => "Urgent giro",
417 Payment::FreeFormatGiro => "Free format giro",
418 Payment::RequestedMethodForPaymentWasNotUsed => {
419 "Requested method for payment was not used"
420 }
421 Payment::ClearingBetweenPartners => "Clearing between partners",
422 Payment::JpElectronicallyRecordedMonetaryClaims => {
423 "JP, Electronically Recorded Monetary Claims"
424 }
425 Payment::MutuallyDefined => "Mutually defined",
426 }
427 }
428}
429
430impl crate::FromCode for Payment {
431 fn from_code(code: &str) -> Option<Self>
432 where
433 Self: Sized,
434 {
435 match code {
436 "1" => Some(Payment::InstrumentNotDefined),
437 "2" => Some(Payment::AutomatedClearingHouseCredit),
438 "3" => Some(Payment::AutomatedClearingHouseDebit),
439 "4" => Some(Payment::AchDemandDebitReversal),
440 "5" => Some(Payment::AchDemandCreditReversal),
441 "6" => Some(Payment::AchDemandCredit),
442 "7" => Some(Payment::AchDemandDebit),
443 "8" => Some(Payment::Hold),
444 "9" => Some(Payment::NationalOrRegionalClearing),
445 "10" => Some(Payment::InCash),
446 "11" => Some(Payment::AchSavingsCreditReversal),
447 "12" => Some(Payment::AchSavingsDebitReversal),
448 "13" => Some(Payment::AchSavingsCredit),
449 "14" => Some(Payment::AchSavingsDebit),
450 "15" => Some(Payment::BookentryCredit),
451 "16" => Some(Payment::BookentryDebit),
452 "17" => Some(Payment::AchDemandCashConcentrationDisbursementCcdCredit),
453 "18" => Some(Payment::AchDemandCashConcentrationDisbursementCcdDebit),
454 "19" => Some(Payment::AchDemandCorporateTradePaymentCtpCredit),
455 "20" => Some(Payment::Cheque),
456 "21" => Some(Payment::BankersDraft),
457 "22" => Some(Payment::CertifiedBankersDraft),
458 "23" => Some(Payment::BankChequeIssuedByABankingOrSimilarEstablishment),
459 "24" => Some(Payment::BillExchangeAwaitingAcceptance),
460 "25" => Some(Payment::CertifiedCheque),
461 "26" => Some(Payment::LocalCheque),
462 "27" => Some(Payment::AchDemandCorporateTradePaymentCtpDebit),
463 "28" => Some(Payment::AchDemandCorporateTradeExchangeCtxCredit),
464 "29" => Some(Payment::AchDemandCorporateTradeExchangeCtxDebit),
465 "30" => Some(Payment::CreditTransfer),
466 "31" => Some(Payment::DebitTransfer),
467 "32" => Some(Payment::AchDemandCashConcentrationDisbursementPlusCcd),
468 "33" => Some(Payment::AchDemandCashConcentrationDisbursementPlusCcd_Dup),
469 "34" => Some(Payment::AchPrearrangedPaymentAndDepositPpd),
470 "35" => Some(Payment::AchSavingsCashConcentrationDisbursementCcdCredit),
471 "36" => Some(Payment::AchSavingsCashConcentrationDisbursementCcdDebit),
472 "37" => Some(Payment::AchSavingsCorporateTradePaymentCtpCredit),
473 "38" => Some(Payment::AchSavingsCorporateTradePaymentCtpDebit),
474 "39" => Some(Payment::AchSavingsCorporateTradeExchangeCtxCredit),
475 "40" => Some(Payment::AchSavingsCorporateTradeExchangeCtxDebit),
476 "41" => Some(Payment::AchSavingsCashConcentrationDisbursementPlusCcd),
477 "42" => Some(Payment::PaymentToBankAccount),
478 "43" => Some(Payment::AchSavingsCashConcentrationDisbursementPlusCcd_Dup),
479 "44" => Some(Payment::AcceptedBillExchange),
480 "45" => Some(Payment::ReferencedHomeBankingCreditTransfer),
481 "46" => Some(Payment::InterbankDebitTransfer),
482 "47" => Some(Payment::HomeBankingDebitTransfer),
483 "48" => Some(Payment::BankCard),
484 "49" => Some(Payment::DirectDebit),
485 "50" => Some(Payment::PaymentByPostgiro),
486 "51" => Some(Payment::FrNorme697TelereglementCfonbFrenchOrganisationFor),
487 "52" => Some(Payment::UrgentCommercialPayment),
488 "53" => Some(Payment::UrgentTreasuryPayment),
489 "54" => Some(Payment::CreditCard),
490 "55" => Some(Payment::DebitCard),
491 "56" => Some(Payment::Bankgiro),
492 "57" => Some(Payment::StandingAgreement),
493 "58" => Some(Payment::SepaCreditTransfer),
494 "59" => Some(Payment::SepaDirectDebit),
495 "60" => Some(Payment::PromissoryNote),
496 "61" => Some(Payment::PromissoryNoteSignedByDebtor),
497 "62" => Some(Payment::PromissoryNoteSignedByDebtorAndEndorsedByABank),
498 "63" => Some(Payment::PromissoryNoteSignedByDebtorAndEndorsedByA),
499 "64" => Some(Payment::PromissoryNoteSignedByABank),
500 "65" => Some(Payment::PromissoryNoteSignedByABankAndEndorsedByAnother),
501 "66" => Some(Payment::PromissoryNoteSignedByAThirdParty),
502 "67" => Some(Payment::PromissoryNoteSignedByAThirdPartyAndEndorsedByA),
503 "68" => Some(Payment::OnlinePaymentService),
504 "69" => Some(Payment::TransferAdvice),
505 "70" => Some(Payment::BillDrawnByCreditorOnDebtor),
506 "74" => Some(Payment::BillDrawnByCreditorOnABank),
507 "75" => Some(Payment::BillDrawnByCreditorEndorsedByAnotherBank),
508 "76" => Some(Payment::BillDrawnByCreditorOnABankAndEndorsedByA),
509 "77" => Some(Payment::BillDrawnByCreditorOnAThirdParty),
510 "78" => Some(Payment::BillDrawnByCreditorOnThirdPartyAcceptedAnd),
511 "91" => Some(Payment::NotTransferableBankersDraft),
512 "92" => Some(Payment::NotTransferableLocalCheque),
513 "93" => Some(Payment::ReferenceGiro),
514 "94" => Some(Payment::UrgentGiro),
515 "95" => Some(Payment::FreeFormatGiro),
516 "96" => Some(Payment::RequestedMethodForPaymentWasNotUsed),
517 "97" => Some(Payment::ClearingBetweenPartners),
518 "98" => Some(Payment::JpElectronicallyRecordedMonetaryClaims),
519 "ZZZ" => Some(Payment::MutuallyDefined),
520 _ => None,
521 }
522 }
523}