From e9fa2da73c6d5eac57928b13668773745fbe8483 Mon Sep 17 00:00:00 2001 From: Domenico DiNicola Date: Tue, 26 Nov 2024 14:46:55 +0100 Subject: [PATCH] link to pg and workspace --- docs/components/.pages | 4 +-- docs/components/index.md | 7 ++-- docs/components/pg.md | 8 +++++ docs/components/pg/.pages | 4 --- docs/components/pg/index.md | 49 -------------------------- docs/components/pg/setup/.pages | 4 --- docs/components/pg/setup/docker.md | 1 - docs/components/pg/setup/index.md | 0 docs/components/pg/setup/virtualenv.md | 37 ------------------- docs/components/pg/wu/.pages | 4 --- docs/components/pg/wu/actions.md | 29 --------------- docs/components/pg/wu/index.md | 46 ------------------------ docs/components/pg/wu/statuses.md | 42 ---------------------- docs/components/workspace.md | 3 ++ docs/components/workspace/.pages | 3 -- docs/components/workspace/index.md | 3 -- docs/components/workspace/setup.md | 1 - 17 files changed, 17 insertions(+), 228 deletions(-) create mode 100644 docs/components/pg.md delete mode 100644 docs/components/pg/.pages delete mode 100644 docs/components/pg/index.md delete mode 100644 docs/components/pg/setup/.pages delete mode 100644 docs/components/pg/setup/docker.md delete mode 100644 docs/components/pg/setup/index.md delete mode 100644 docs/components/pg/setup/virtualenv.md delete mode 100644 docs/components/pg/wu/.pages delete mode 100644 docs/components/pg/wu/actions.md delete mode 100644 docs/components/pg/wu/index.md delete mode 100644 docs/components/pg/wu/statuses.md create mode 100644 docs/components/workspace.md delete mode 100644 docs/components/workspace/.pages delete mode 100644 docs/components/workspace/index.md delete mode 100644 docs/components/workspace/setup.md diff --git a/docs/components/.pages b/docs/components/.pages index f26bb15..766bda9 100644 --- a/docs/components/.pages +++ b/docs/components/.pages @@ -3,8 +3,8 @@ nav: - Aurora: aurora - Kobo: kobo - - Payment Gateway: pg + - Payment Gateway: pg.md - Country Report: reporting - Deduplication: hde - RapidPro: rapidpro -# - workspace.md + - Workspace: workspace.md diff --git a/docs/components/index.md b/docs/components/index.md index 5da26b9..019894a 100644 --- a/docs/components/index.md +++ b/docs/components/index.md @@ -18,13 +18,14 @@ systems and platforms, ensuring smooth workflows and easy expansion as your need - [Country Report](reporting/index.md) -- [Payment Gateway](pg/index.md) +- [Payment Gateway](pg.md) -- [Country Workspace](workspace/index.md) +- [Country Workspace](workspace.md) + +- [RapidPro](rapidpro/index.md) - User Management Module _(not yet released)_ -- [RapidPro](rapidpro/index.md) ## Hope supporting libraries diff --git a/docs/components/pg.md b/docs/components/pg.md new file mode 100644 index 0000000..6db92f0 --- /dev/null +++ b/docs/components/pg.md @@ -0,0 +1,8 @@ +# Payment Gateway + +The Integration between HOPE and any FSP is performed through a middleware service called Payment Gateway (PG). +HOPE sends to the PG information regarding Payments through web API. +Each FSP can have a different way to interact with the payment gateway with though strategy pattern. + +{:target="_blank"} + diff --git a/docs/components/pg/.pages b/docs/components/pg/.pages deleted file mode 100644 index 1dc08f2..0000000 --- a/docs/components/pg/.pages +++ /dev/null @@ -1,4 +0,0 @@ -nav: - - index.md - - Setup: setup - - Western Union: wu diff --git a/docs/components/pg/index.md b/docs/components/pg/index.md deleted file mode 100644 index d388a68..0000000 --- a/docs/components/pg/index.md +++ /dev/null @@ -1,49 +0,0 @@ -# Payment Gateway - -The Integration between HOPE and any FSP is performed through a middleware service called Payment Gateway (PG). -HOPE sends to the PG information regarding Payments through web API. -Each FSP can have a different way to interact with the payment gateway with though strategy pattern. - - -## Repository - -> Repo: - - -## HOPE / PG Integration API - -PG expose endpoint to accept: - -- Payment Plan creation -- Add Records to Payment Plan -- Payment Plan ready -- Status of payments given a Payment Plan - - -## Statues - -### Payment Plan - -- Draft -- Open -- Ready -- Closed -- Aborted -- Processed - -### Payment Record - -- Pending -- Transferred to FSP -- Transferred to Beneficiary -- Cancelled -- Refund -- Purged -- Error - -### Financial Service Providers - -At the moment the Payment Gateway is integrated with: - -- Western Union -- Moneygram diff --git a/docs/components/pg/setup/.pages b/docs/components/pg/setup/.pages deleted file mode 100644 index 229c1ba..0000000 --- a/docs/components/pg/setup/.pages +++ /dev/null @@ -1,4 +0,0 @@ -nav: - - index.md - - virtualenv.md - - docker.md diff --git a/docs/components/pg/setup/docker.md b/docs/components/pg/setup/docker.md deleted file mode 100644 index 6871408..0000000 --- a/docs/components/pg/setup/docker.md +++ /dev/null @@ -1 +0,0 @@ -# Docker \ No newline at end of file diff --git a/docs/components/pg/setup/index.md b/docs/components/pg/setup/index.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/components/pg/setup/virtualenv.md b/docs/components/pg/setup/virtualenv.md deleted file mode 100644 index 50483ac..0000000 --- a/docs/components/pg/setup/virtualenv.md +++ /dev/null @@ -1,37 +0,0 @@ -# Virtualenv - - -### System Requirements - -- python 3.12 -- [direnv](https://direnv.net/) - not mandatory but strongly recommended -- [pdm](https://pdm.fming.dev/2.9/) - - -**WARNING** -> Hope Payment Gateway implements **security first** policy. It means that configuration default values are "almost" production compliant. -> -> Es. `DEBUG=False` or `SECURE_SSL_REDIRECT=True`. -> -> Be sure to run `./manage.py env --check` and `./manage.py env -g all` to check and display your configuration - - - -### 1. Clone repo and install requirements - git clone https://github.com/unicef/hope-payment-gateway - pdm venv create 3.12 - pdm install - pdm venv activate in-project - pre-commit install - -### 2. configure your environment - -Uses `./manage.py env` to check required (and optional) variables to put - - ./manage.py env --check - - -### 3. Run upgrade to run migrations and initial setup - - ./manage.py upgrade - diff --git a/docs/components/pg/wu/.pages b/docs/components/pg/wu/.pages deleted file mode 100644 index 4098fd4..0000000 --- a/docs/components/pg/wu/.pages +++ /dev/null @@ -1,4 +0,0 @@ -nav: - - index.md - - statuses.md - - actions.md diff --git a/docs/components/pg/wu/actions.md b/docs/components/pg/wu/actions.md deleted file mode 100644 index 314a5d3..0000000 --- a/docs/components/pg/wu/actions.md +++ /dev/null @@ -1,29 +0,0 @@ -# Actions - -## CANCELLATIONS - -These are UNICEF initiated via the Cancel api call. They can only occur BEFORE settlement. -This means UNICEF gets notified that an MTCN generated was suspended before it settled. -No funds whatsoever are exchanged between the organizations -CSC or our Compliance systems can also initiate a cancellation. UNICEF should get notified regardless - - -## REFUNDS - -These are WESTERN UNION initiated via CSC action. They only occur AFTER settlement. They are not available for UNICEF trigger. -This means UNICEF gets notified that an MTCN generated was suspended AFTER it settled. -As per newly implemented WU policy Full refund (principal and fee) is reversed to UNICEF -CSC or our Compliance systems can also initiate a refund. UNICEF should get notified and corresponding reversal should follow. - - -## PURGED - -These are WESTERN UNION SYSTEM initiated automatically and are set for UNICEF to occur at Day 30 after MTCN has been generated, if funds have not been collected. -This means UNICEF gets notified that an MTCN generated was purged AFTER 30 Days and AFTER it settled. -It is WU policy to do PARTIAL refund (principal ONLY) which is reversed to UNICEF -There is an exception scenario whereby a transaction that falls in a compliance queue and is never picked up is excluded from the purge process. The Accounting team should have a process to look at any available MTCNs from UNICEF accounts that are in “will call (this means available in Western Union terminology) and manually take any required action (for example if the transaction falls in OFAC, funds are held, reported etc) - - -## PAID - -This refers to the MTCN that have been picked up or deposited to the wallets (pls refer to the APN Refund project for details on what can occur here if a bank rejects a payment after it has been initially marked as PAID and notification has been sent) diff --git a/docs/components/pg/wu/index.md b/docs/components/pg/wu/index.md deleted file mode 100644 index 796d037..0000000 --- a/docs/components/pg/wu/index.md +++ /dev/null @@ -1,46 +0,0 @@ -# Western Union - -Once HOPE confirms that Payment Plan is ready, PG starts sending data to Western Union though SOAP Requests. - -## Transactions support - -- Money in Minutes (aka Cash by FSP) -- Wallets (aka Mobile Money) - -Once Western Union deliver the money to beneficiaries it calls PG api through Push Notifications. - - -## Metadata DAS - -- Country/Currency -- Origination and Destination Currency -- Destination Currency -- Delivery Services -- Delivery Option Template - -## PG / WU integration - -- PG -> WU: Authentication is performed through use of certificates -- WU -> PG: Is done through withelist of IP and (discussion ongoing) VPN or Basic Authentication - - -## Send Money - -Payment Gateway creates batches of transactions (maximum 10.000 per hour) to send to WU. -For each transaction, PG calls first the SendMoneyValidation service and then the SendMoneyStore. - -## Receive Notification - -Western Union calls PG endpoint in order to notify that money has been received by the beneficiary, then PG responds with an acknowledge to Western Union, to confirm the status of the operation: - -- SUCCESS -- REFUND -- CANCEL -- REJECT - -Once HOPE confirms that Payment Plan is ready, PG starts sending data to Western Union though SOAP Requests. - -Transactions support: - -- Money in Minutes (aka Cash over the counter) -- Wallets (aka Mobile Money) diff --git a/docs/components/pg/wu/statuses.md b/docs/components/pg/wu/statuses.md deleted file mode 100644 index bc18f72..0000000 --- a/docs/components/pg/wu/statuses.md +++ /dev/null @@ -1,42 +0,0 @@ -# Statuses - -## BIS003 = PAID -CASH ONLY - -This refers to the MTCNs that have been picked up at a location in Cash. -It does not apply to APN. - - -## BIS005 = CANCEL - -BIS005 occurs when: Partner performs a cancellation via API, CSC receives a call to cancel or compliance cancels BEFORE settlement. No funds whatsoever are exchanged between the organizations and transaction appears in the settlement file, not in the recap report. -CSC receives a call to cancel after settlement has occurred. This results in a BIS005 Cancel notification. Principal and fees are returned. Transaction appears both in settlement file and recap report. - - -## BIS006 with reason code any other than AGE = REFUND - -It is not expected that UNICEF receives BIS006 notifications with reason code other than AGE. -BIS006 with reason code AGE (refunded due to aging) = PURGED -This refers to Wester Union system-initiated cancellations or refunds (depending on partner settlement) of unpaid cash MTCNs. -Purge time is set up per client id/account level from 1 to 999 days. A standard purge time is 30 days. -It is WU policy to do a partial refund (we keep fee) on purged payments. This means: -Settle on Send clients get principal only back -Settle on Pay clients are charged a fee upon purge. -There is an exception scenario whereby a transaction that falls in a compliance queue and is never picked up is excluded from the purge process. The Accounting team should have a process to look at any available MTCNs from Quick Cash accounts that are in “will call (this means available in Western Union terminology) and manually take any required action (for example if the transaction falls in OFAC, funds are held, reported etc) - - -## BIS0011 = APN REJECT - -This refers to APN MTCNs that are either: -immediately rejected (prior to settlement) by the mobile wallet partner. This results in no funds being exchanged. -delayed-rejected (after settlement) by the mobile wallet partner. This results in a full refund to the partner. -From a notification perspective, partner will get the same notification “APN REJECT BIS0011” for both immediate and delay, even though settlement action may be different. -If BIS0011 (APN REJECT) is received after BIS0012 (APN DELIVED) for the same MTCN, after settlement, the partner gets a refund -If BIS0011 (APN REJECT) is received after BIS0012 (APN DELIVED) for the same MTCN, before settlement, no funds are exchanged -If BIS0011 (APN REJECT) is received by itself – not after BIS0012 - after settlement, the partner gets a refund -If BIS0011 (APN REJECT) is received by itself – not after BIS0012- , before settlement, no funds are exchanged. - - -## BIS0012 = APN DELIVERED - -This refers to APN MTCNs that are marked PAID in the system -It does not automatically implied funds have been delivered / settled with Wallet. diff --git a/docs/components/workspace.md b/docs/components/workspace.md new file mode 100644 index 0000000..7d47125 --- /dev/null +++ b/docs/components/workspace.md @@ -0,0 +1,3 @@ +# Country Workspace + +{:target="_blank"} diff --git a/docs/components/workspace/.pages b/docs/components/workspace/.pages deleted file mode 100644 index bde1d32..0000000 --- a/docs/components/workspace/.pages +++ /dev/null @@ -1,3 +0,0 @@ -nav: - - index.md - - setup.md diff --git a/docs/components/workspace/index.md b/docs/components/workspace/index.md deleted file mode 100644 index 41a3d13..0000000 --- a/docs/components/workspace/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Country Workspace - - diff --git a/docs/components/workspace/setup.md b/docs/components/workspace/setup.md deleted file mode 100644 index feae8cb..0000000 --- a/docs/components/workspace/setup.md +++ /dev/null @@ -1 +0,0 @@ -# Setup