Salesforce DX package source for creating MakePay payment links from Salesforce Flow and accepting MakePay webhook callbacks through Apex REST.
- Apex client for MakePay partner payment links.
- Flow action:
Create MakePay Payment Link. - Apex REST endpoint:
/services/apexrest/makepay/webhooks/*. - HMAC verification for
X-MakePay-Signature. - Named Credential based outbound authentication, so MakePay API keys do not live in Apex code or repository files.
- Protected custom metadata settings for package-level defaults and webhook configuration.
Create a Named Credential with API name MakePay_API and URL
https://www.makecrypto.io. Configure the linked External Credential with
custom headers:
X-MakeCrypto-Key-IdX-MakeCrypto-Key-Secret
Salesforce Named Credentials support custom headers for API key style authentication:
After deploying the package source, update the Default MakePay Settings
custom metadata record with the webhook secret used by MakePay.
See docs/SETUP.md for the full setup flow.
Add the Create MakePay Payment Link Apex action to a Flow. Pass an
Opportunity ID or explicit title, amount, currency, and return URL. The action
returns:
successuidurlrawResponseerror
Expose the Apex REST endpoint to MakePay:
https://your-domain.my.salesforce.com/services/apexrest/makepay/webhooks/
The endpoint verifies the MakePay HMAC signature before passing the event to
MakePayWebhookProcessor.process.
npm run validateWith Salesforce CLI:
sf project deploy start --source-dir force-app
sf apex run test --test-level RunLocalTests --code-coverageMakePayClient: outbound payment link client.MakePayCreatePaymentLinkAction: Flow invocable action.MakePayWebhookVerifier: HMAC verification helper.MakePayWebhookRest: REST webhook endpoint.MakePayWebhookProcessor: small event processing extension point.MakePayConfig: settings lookup helper.