Repository navigation
Description
- Optional new request parameter (ccPayment=true) for all public registration endpoints to indicate CC payment (if preferred account payment is not CC). UI should know the payment method in advance to handle the mhr api response and redirect user to the CC payment url.
- Save draft record without marking it as consumed if pay api call is successful.
- Associate the pay api response invoice id with the draft.
- For change registrations lock the manufactured home to prevent further changes until payment completes.
- Return to the UI the pay api response invoice ID and hopefully payment redirect url (possibly the complete pay api invoice response JSON). Response HTTP status is 202 accepted; new payload paymentPending property is set to true.
- Update ppr-sub proxy to receive MHR pub/sub pay completion event subscription requests.
- Create new endpoint to receive payment complete requests and create the registration.
Questions for relationships:
- How do you set up a CC payment pay api request when CC payment is not the default/preferred method? Request payload example without the payment method:
POST https://pay-api-dev-142173140222.northamerica-northeast1.run.app/api/v1/payment-requests
{
"filingInfo": {
"folioNumber": "UT-PAY-PERMIT-1",
"filingTypes": [
{
"filingTypeCode": "TRAPP",
"priority": false,
"futureEffective": false,
"quantity": 1
}
]
},
"businessInfo": {
"corpType": "MHR"
},
"details":[
{
"label":"TP TRAPP test:",
"value":"TRAPP fee code"
}
]
}
Answer: add to the pay api request
"paymentInfo": {
"methodOfPayment": "DIRECT_PAY"
}
-
What is the URL by environment for the client to pay by CC after a pay api /api/v1/payment-requests request completes?
Answer configurable by environment from 1password variable PAYMENT_PORTAL_URL. The format is:
{PAYMENT_PORTAL_URL}/{invoice_id}/{return_URL}
Currently:
https://dev.account.bcregistry.gov.bc.ca/makepayment/{invoiceId}/{returnURL}
https://test.account.bcregistry.gov.bc.ca/makepayment/{invoiceId}/{returnURL}
https://sandbox.account.bcregistry.gov.bc.ca/makepayment/{invoiceId}/{returnURL}
https://www.account.bcregistry.gov.bc.ca/makepayment/{invoiceId}/{returnURL}
The invoice id will be returned in the MHR API response in the payment information.
The return URL must be escaped - see example in Travis's comment below. -
If a payment invoice corpType is MHR or PPR and the payment method is CC, can assets be notified by the pay api once a CC payment completes by publishing the event on a GCP pub/sub topic? Can the topic be created in the assets project with access given to the pay api SA? What is the pay api payload for these notifications? Assets needs the invoice ID, corpType (MHR/PPR), and probably the payment status.
Answer:
Dedicated assets topic running in the pay api GCP project. Coordinate with Patrick W and update the pub/sub integration with pay api here:
https://www.figma.com/board/ZLlmaQ5sCsBEkUxUtsETwQ/PUB-SUB-Queue-Mapping?node-id=0-1&p=f&t=AhzRDxeoJwt3C2Lg-0
Pub/Sub payload example:
{
"id": "12342432",
"statusCode": "COMPLETED",
"filingIdentifier": "",
"corpTypeCode": "MHR"
}

Activity
[-]MHR API - Credit Card Payment[/-][+]MHR API - Non-Staff Credit Card Payment[/+]doug-lovett commentedon Apr 25, 2025
@LizGovier I have added the non staff CC payment diagram to this ticket.
LizGovier commentedon Apr 25, 2025
You're the best! Thanks @doug-lovett
seeker25 commentedon Apr 29, 2025
@doug-lovett @cameron-eyds
https://github.com/bcgov/STRR/blob/c78535b55d0dc233c1e6d743aee7ae51bd7aa957/strr-api/src/strr_api/services/payment_service.py#L135
{ "filingInfo": { "filingTypes": [ { "filingTypeCode": "INREG", "priority": false, "futureEffective": false, "quantity": 1 } ] }, "businessInfo": { "corpType": "MHR" }, "details": [ { "label": "MH Registration Type:", "value": "MANUFACTURED HOME REGISTRATION" } ], "paymentInfo": { "methodOfPayment": "DIRECT_PAY" } }Here's a full example of a route that Search built:
https://github.com/bcgov/registries-search/blob/8d9f07abe0280af3d4804a800ebc1f92dc5c894a/search-api/src/search_api/resources/v2/payments/payments.py#L34
Example here from names Andriy Built:
https://github.com/bcgov/namex/blob/42d24c343338ed13217fc9118a1d77760d2f74a0/services/namex-pay/src/namex_pay/resources/worker.py#L75
Here's the payload dataclass:
https://github.com/bcgov/namex/blob/42d24c343338ed13217fc9118a1d77760d2f74a0/services/namex-pay/src/namex_pay/resources/worker.py#L104
Here's some examples from logs:
Talk to @pwei1018 about getting this setup, he has to maintain it
"VUE_APP_PAYMENT_PORTAL_URL":"https://test.account.bcregistry.gov.bc.ca/makepayment/"
Here is some namerequest code that uses it, can look up the same in STRR.
https://github.com/bcgov/namerequest/blob/e6991204ca462ebd5ed45f3b8ba48f9d0fe6f39e/app/src/mixins/payment-mixin.ts#L494
paymentToken is the invoice id coming from the create invoice response.
There's also another field you should check for in the invoice response:
isPaymentActionRequired(this turns on for online banking and credit card) if that's true you'll need to redirect to makepayment urlHere's an example from PROD:
https://www.account.bcregistry.gov.bc.ca/makepayment/8071147/https%3A%2F%2Fwww.names.bcregistry.gov.bc.ca%2Fnr%2F2697907%2F%3FpaymentId%3D581855
@doug-lovett which urls do you want here?
https://dev.assets.bcregistry.gov.bc.ca/*
https://test.assets.bcregistry.gov.bc.ca/*
https://assets.bcregistry.gov.bc.ca/*
@LizGovier new CC payment screen
payment failed screen:
doug-lovett commentedon Apr 29, 2025
@seeker25 thanks I was looking for the payment portal URL.
LizGovier commentedon May 1, 2025
@seeker25
Thanks Travis! :)
doug-lovett commentedon May 1, 2025
Example manufacturer new home request url with cc payment override:
POST /mhr/api/v1/registrations?ccPayment=true
Example response:
New response properties that specify cc pending payment:
doug-lovett commentedon May 1, 2025
Example drafts list entry with cc payment pending:
doug-lovett commentedon May 1, 2025
Example of account registration list when existing MHR has a cc pending payment registration (locked).
And the same registration after payment completes:
10 remaining items
chdivyareddy commentedon May 13, 2025
@doug-lovett thanks for checking, can you please let me know who is the best person to reach out to for setting it up? thanks!
seeker25 commentedon May 13, 2025
Goto the account in auth-web, change the payment method? Unless it's not possible, if it's not, give me a message
chdivyareddy commentedon May 13, 2025
Verified in TEST!