Yeqa uye kokucuketse lokuyinhloko

Ema-Endpoint E-Giving

I-module ye-Giving iphatsa eminikelo, tikhwama, kucutjwa kwetinkhokhelo, ema-subscription, kanye netento letihlobene temali. Isekela ema-gateway lamanyenti etinkhokhelo (Stripe, PayPal), iphatsa eminikelo yekanyekanye nalephindzaphindzako, ilandzelela emabatch eminikelo, futsi iniketa kuphatsa kwe-webhook kumicimbi yetinkhokhelo lengahambisani.

Umkhondvo Losisekelo: /giving

Eminikelo

Umkhondvo losisekelo: /giving/donations

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.View nobe personId wakheBala yonkhe eminikelo. Cenga nge-?batchId= nobe ?personId=
GET/:idJWTDonations.ViewTfola umnikelo nge-ID
GET/myJWTTfola eminikelo yemsebentisi wanyalo
GET/summaryJWTDonations.ViewSummaryTfola sifingqo seminikelo. Cenga nge-?startDate=&endDate=&type=. Sebentisa type=person kwehlukaniswa ngumuntfu ngamunye
GET/testEmailNgeyeveleniTfumela i-imeyili yekuhlola (kutfutfuka/kuhlola)
POST/JWTDonations.EditAkha nobe buyeketa eminikelo (batch)
DELETE/:idJWTDonations.EditSula umnikelo

Sibonelo: Bala Eminikelo Nge-Batch

GET /giving/donations?batchId=abc-123
Authorization: Bearer <token>
[
{
"id": "don-456",
"batchId": "abc-123",
"personId": "per-789",
"donationDate": "2025-03-15T00:00:00.000Z",
"amount": 100.00,
"method": "card"
}
]

Sibonelo: Tfola Sifingqo Seminikelo

GET /giving/donations/summary?startDate=2025-01-01&endDate=2025-12-31
Authorization: Bearer <token>
[
{
"week": "2025-01-06",
"fund": "General Fund",
"totalAmount": 2500.00,
"count": 15
}
]

Emabatch Eminikelo

Umkhondvo losisekelo: /giving/donationbatches

Yandzisa i-GenericCrudController ngemikhondvo ye-CRUD: getById, getAll, post, delete. Sento sekususa futsi sisusa yonkhe eminikelo lengekhatsi kwebatch.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.ViewSummaryBala onkhe emabatch eminikelo
GET/:idJWTDonations.ViewSummaryTfola batch nge-ID
POST/JWTDonations.EditAkha nobe buyeketa emabatch eminikelo
DELETE/:idJWTDonations.EditSula batch kanye nayo yonkhe eminikelo yayo

Kunikela (Donate)

Umkhondvo losisekelo: /giving/donate

Iphatsa inchubo yeveleni yekunikela kufaka tinkhokhelo, ema-subscription, ema-webhook, kanye nekubalwa kwetimali tekusebentisa. Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/gateways/:churchIdNgeyeveleniTfola ema-gateway etinkhokhelo latfolakalako elibandla (tikhiya teveleni kuphela)
POST/client-tokenJWTKhicita client token yekucalisa gateway
POST/create-orderJWTAkha order yenkhokhelo (kukhokha kwesimo se-PayPal)
POST/chargeJWTChubekisa inkhokhelo yemnikelo wekanye
POST/subscribeJWTAkha subscription yemnikelo lophindzaphindzako
POST/logNgeyeveleniBhala phansi umnikelo. Umtimba: { donation, fundData }
POST/webhook/:providerNgeyeveleniYemukela imicimbi yewebhook yetinkhokhelo (Stripe, PayPal). Idzinga ?churchId=
POST/replay-stripe-eventsJWTDonations.EditPhindza imicimbi ye-Stripe sikhatsi lesitsite. Umtimba: { startDate, endDate, dryRun }
POST/feeNgeyeveleniBala tinkhokhelo tekusebentisa. Umtimba: { type, provider, gatewayId, amount, currency }. Idzinga ?churchId=
POST/captcha-verifyNgeyeveleniCinisekisa i-reCAPTCHA token. Umtimba: { token }

Sibonelo: Chubekisa Inkhokhelo Yemnikelo

POST /giving/donate/charge
Authorization: Bearer <token>

{
"provider": "stripe",
"amount": 50.00,
"currency": "usd",
"person": { "id": "per-123", "email": "donor@example.com" },
"funds": [{ "id": "fund-001", "name": "General Fund", "amount": 50.00 }],
"church": { "name": "First Church", "subDomain": "firstchurch" }
}
{
"id": "ch_abc123",
"status": "succeeded",
"provider": "stripe"
}

Sibonelo: Akha Subscription Lephindzaphindzako

POST /giving/donate/subscribe
Authorization: Bearer <token>

{
"provider": "stripe",
"amount": 100.00,
"customerId": "cus_abc123",
"interval": { "interval_count": 1, "interval": "month" },
"billing_cycle_anchor": 1710460800,
"person": { "id": "per-123", "email": "donor@example.com" },
"funds": [{ "id": "fund-001", "name": "General Fund", "amount": 100.00 }],
"church": { "name": "First Church", "subDomain": "firstchurch" }
}
{
"id": "sub_xyz789",
"status": "active",
"provider": "stripe"
}

Tikhwama

Umkhondvo losisekelo: /giving/funds

Yandzisa i-GenericCrudController ngemikhondvo ye-CRUD: getById, getAll, post, delete. Imvumo ye-view yi-null (akukho mvumo ledzingekako kubuka tikhwama).

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTBala tonkhe tikhwama
GET/:idJWTTfola sikhwama nge-ID
GET/churchId/:churchIdNgeyeveleniTfola tonkhe tikhwama telibandla lelikhetsekile (yeveleni)
GET/public/:churchId/:fundId/total?startDate=&endDate=NgeyeveleniTfola lidzinga lelilonkhe leminikelo yesikhwama: { fundId, totalAmount, donationCount }. Isebentisa element ye-campaignProgress ye-website builder
POST/JWTDonations.EditAkha nobe buyeketa tikhwama
DELETE/:idJWTDonations.EditSula sikhwama

Eminikelo Yetikhwama

Umkhondvo losisekelo: /giving/funddonations

Ilandzelela indlela leminikelo yakamunye yabelwa ngayo etikhwameni. Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.ViewBala eminikelo yetikhwama. Cenga nge-?donationId=, ?personId=, ?fundId=, nobe ?fundName=. Ngekukhetsa engeta ?startDate=&endDate= kucenga ngelilanga
GET/:idJWTDonations.ViewTfola umnikelo wesikhwama nge-ID
GET/myJWTTfola eminikelo yetikhwama yemsebentisi wanyalo
POST/JWTDonations.EditAkha nobe buyeketa eminikelo yetikhwama (batch)
DELETE/:idJWTDonations.EditSula umnikelo wesikhwama

Ema-Gateway

Umkhondvo losisekelo: /giving/gateways

Iphatsa kuhlelwa kwema-gateway etinkhokhelo (Stripe, PayPal, njll.). Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile. Imfihlo yema-gateway ifihliwe (encrypted) ekugcinweni.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTBala onkhe ema-gateway elibandla
GET/:idJWTSettings.EditTfola gateway nge-ID
GET/churchId/:churchIdNgeyeveleniTfola ema-gateway elibandla (tikhiya teveleni kuphela)
GET/configured/:churchIdNgeyeveleniHlola nangabe libandla linayo gateway yetinkhokhelo lehleliwe
POST/JWTSettings.EditAkha nobe buyeketa ema-gateway (ifihla tikhiya, iniketa ema-webhook nemikhicito)
PATCH/:idJWTSettings.EditBuyeketa incenye ye-gateway
DELETE/:idJWTSettings.EditSula gateway (isule netema-webhook ayo)

Sibonelo: Hlola Kuhlelwa Kwe-Gateway

GET /giving/gateways/configured/church-123
{
"configured": true
}

Bakhokhi (Customers)

Umkhondvo losisekelo: /giving/customers

Yandzisa i-GenericCrudController ngemikhondvo ye-CRUD: getAll, delete. Ixhumanisa bantfu nemibhalo yabo yebakhokhi ye-gateway yetinkhokhelo.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.ViewSummaryBala bonkhe bakhokhi
GET/:idJWTDonations.ViewSummary nobe umbhalo wakheTfola mkhokhi nge-ID
GET/:id/subscriptionsJWTDonations.ViewSummary nobe umbhalo wakheTfola ema-subscription e-gateway emkhokhi
DELETE/:idJWTDonations.EditSula mkhokhi

Ema-Subscription

Umkhondvo losisekelo: /giving/subscriptions

Iphatsa ema-subscription eminikelo lephindzaphindzako. Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.ViewSummaryBala onkhe ema-subscription
GET/:idJWTDonations.ViewSummaryTfola subscription nge-ID
POST/JWTDonations.Edit nobe subscription yakheBuyeketa ema-subscription ne-gateway yetinkhokhelo
DELETE/:idJWTDonations.Edit nobe subscription yakheYekela subscription futsi uyisuse ku-database. Umtimba: { provider, reason }

Tikhwama Tesubscription

Umkhondvo losisekelo: /giving/subscriptionfunds

Ilandzelela kwabelwa kwetikhwama kuma-subscription laphindzaphindzako. Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.View nobe subscription yakheBala tikhwama tesubscription. Cenga nge-?subscriptionId=
GET/:idJWTDonations.ViewSummaryTfola sikhwama sesubscription nge-ID
DELETE/:idJWTDonations.EditSula sikhwama sesubscription
DELETE/subscription/:idJWTDonations.Edit nobe subscription yakheSula tonkhe tikhwama tesubscription

Tindlela Tekukhokha

Umkhondvo losisekelo: /giving/paymentmethods

Iphatsa tindlela tekukhokha letigciniwe (emakhadi, ema-akhawundi ebhange) nge-API te-gateway yetinkhokhelo. Akukho mikhondvo ye-CRUD lesisekelo levunyiwe; wonkhe ema-endpoint akhetsekile.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/personid/:idJWTDonations.View nobe personId wakheTfola tonkhe tindlela tekukhokha letigciniwe temuntfu (emakhadi, ema-akhawundi ebhange)
POST/addcardJWTNamatsela indlela yekukhokha yekhadi. Umtimba: { id, personId, customerId, email, name, churchId, provider }
POST/updatecardJWTDonations.Edit nobe personId wakheBuyeketa imininingwane yekhadi. Umtimba: { personId, paymentMethodId, cardData, provider }
POST/ach-setup-intentJWTDonations.Edit nobe personId wakheAkha i-Stripe ACH SetupIntent yekuhlanganisa akhawundi yebhange. Umtimba: { personId, customerId, email, name, churchId }
POST/ach-setup-intent-anonNgeyeveleniAkha ACH SetupIntent lengaziwa yeminikelo yesihambi. Umtimba: { email, name, churchId, gatewayId }
POST/addbankaccountJWTDonations.Edit nobe personId wakheEngeta akhawundi yebhange nge-token (seyingasetjentiswa; sebentisa ach-setup-intent). Umtimba: { id, personId, customerId, email, name }
POST/updatebankJWTDonations.Edit nobe personId wakheBuyeketa imininingwane yakhawundi yebhange. Umtimba: { paymentMethodId, personId, bankData, customerId }
POST/verifybankJWTDonations.Edit nobe customer wakheCinisekisa akhawundi yebhange nge-micro-deposit. Umtimba: { paymentMethodId, customerId, amountData }
DELETE/:id/:customeridJWTDonations.Edit nobe customer wakheSula indlela yekukhokha (khadi nobe akhawundi yebhange)

Bhalo Lwemicimbi

Umkhondvo losisekelo: /giving/eventLog

Yandzisa i-GenericCrudController ngemikhondvo ye-CRUD: getById, getAll, post, delete. Ilandzelela imicimbi yewebhook ye-gateway yetinkhokhelo kwe-audit kanye nekususa loku lokuphindziwe.

InchuboUmkhondvoKutivakalisaImvumoIncazelo
GET/JWTDonations.ViewSummaryBala onkhe emabhalo emicimbi
GET/:idJWTDonations.ViewSummaryTfola bhalo lemcimbi nge-ID
GET/type/:typeJWTDonations.ViewSummaryTfola emabhalo emicimbi acengiwe nge-luhlobo lwemcimbi
POST/JWTDonations.EditAkha nobe buyeketa emabhalo emicimbi
DELETE/:idJWTDonations.EditSula bhalo lemcimbi

Emakhasi Lahlobene