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