OpenPay (1 crate, 2174 LOC, 14 tests)
op-payouts Multi-rail payout engine. Visa Direct, Mastercard Send,
ACH credits (NACHA), Fedwire + SWIFT MT103 + ISO 20022
pacs.008, SEPA SCT + SCT Inst (mod-97 IBAN), UK FPS,
FedNow, RTP, PayPal, Wise. Crypto: USDC/USDT on
ETH/Polygon/Base/Solana + BTC + Lightning with real
ERC-20 transfer(address,uint256) calldata. Offline-pure
drivers (emit wire payloads — operators transmit).
Smart Byte (1 crate, 2605 LOC, 38 tests)
smart-byte-nostr Nostr adapter. NIP-01 canonical event id + BIP-340
Schnorr sign/verify; from-scratch bech32 + NIP-19 TLV
(npub/nsec/note/nprofile/nevent/nrelay); NIP-04 legacy
AES-256-CBC DMs; NIP-44 v2 HKDF-SHA256→ChaCha20+HMAC
with bucketed padding; NIP-17 gift-wrap (kind 1059) +
seal (kind 13) + rumor (kind 14); NIP-05/11/13/26/65.
Relay client message vocabulary (REQ/EVENT/CLOSE/AUTH/
EOSE/OK/NOTICE/CLOSED) + in-memory router.
EOC (1 crate, 2024 LOC, 30 tests)
eoc-streaming Token-by-token + tool-call streaming primitives.
SSE framing (data: lines); Anthropic event mapper
(message_start/content_block_*/message_delta/stop/ping);
OpenAI delta mapper; Vercel AI SDK mapper. Bounded-channel
backpressure with watermarks; CancelToken propagation;
Last-Event-ID resumable streams; per-stream joule meter.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
61 lines
2 KiB
Rust
61 lines
2 KiB
Rust
//! Integration: SEPA Instant payout produces pacs.008 XML.
|
|
|
|
use op_core::{Currency, Money};
|
|
use op_payouts::sepa::SepaDriver;
|
|
use op_payouts::{
|
|
Beneficiary, BeneficiaryAccount, Error, FundingSource, Payout, PayoutMethod, PayoutRequest,
|
|
PayoutStatus,
|
|
};
|
|
|
|
fn driver() -> SepaDriver {
|
|
SepaDriver {
|
|
sender_bic: "AAAADEFFXXX".to_string(),
|
|
sender_name: "Acme GmbH".to_string(),
|
|
sender_iban: "DE89370400440532013000".to_string(),
|
|
}
|
|
}
|
|
|
|
fn req() -> PayoutRequest {
|
|
PayoutRequest {
|
|
idempotency_key: "22222222-2222-4222-8222-222222222222".to_string(),
|
|
method: PayoutMethod::SepaSctInst,
|
|
amount: Money::from_minor(50_000, Currency::EUR), // EUR 500.00
|
|
beneficiary: Beneficiary {
|
|
name: "Jean Dupont".to_string(),
|
|
address: None,
|
|
account: BeneficiaryAccount::Iban("FR1420041010050500013M02606".to_string()),
|
|
kyc_ref: None,
|
|
},
|
|
funding: FundingSource::Prefunded {
|
|
account_ref: "tips-balance".to_string(),
|
|
},
|
|
memo: Some("invoice 42".to_string()),
|
|
}
|
|
}
|
|
|
|
#[test]
|
|
fn sepa_inst_produces_pacs008_xml() {
|
|
let res = driver().submit(&req()).expect("offline build");
|
|
assert_eq!(res.status, PayoutStatus::PreparedOffline);
|
|
let xml = String::from_utf8(res.wire_payload.expect("payload")).expect("utf8");
|
|
assert!(xml.contains("urn:iso:std:iso:20022:tech:xsd:pacs.008.001.08"));
|
|
assert!(xml.contains("<IBAN>FR1420041010050500013M02606</IBAN>"));
|
|
assert!(xml.contains("Ccy=\"EUR\""));
|
|
assert!(xml.contains("500.00"));
|
|
}
|
|
|
|
#[test]
|
|
fn sepa_inst_rejects_non_eur() {
|
|
let mut r = req();
|
|
r.amount = Money::from_minor(50_000, Currency::USD);
|
|
let err = driver().submit(&r).unwrap_err();
|
|
assert!(matches!(err, Error::LimitViolation { rail: "sepa", .. }));
|
|
}
|
|
|
|
#[test]
|
|
fn sepa_inst_enforces_100k_cap() {
|
|
let mut r = req();
|
|
r.amount = Money::from_minor(100_001 * 100, Currency::EUR);
|
|
let err = driver().submit(&r).unwrap_err();
|
|
assert!(matches!(err, Error::LimitViolation { rail: "sepa", .. }));
|
|
}
|