merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 6874f45896dfe00d5106c69fa9312cbac216899a
parent a16f8ac9bbdafc11b293860619907836f651ead1
Author: priscilla <priscilla.huang@efrei.net>
Date:   Thu, 24 Nov 2022 10:31:49 -0500

Update

Diffstat:
Msrc/backenddb/merchant-0004.sql | 33+++++++++++++++++++++++++++++++++
Msrc/testing/test_merchant_product_creation.sh | 3++-
Asrc/testing/test_merchant_template_creation.sh | 0
3 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/src/backenddb/merchant-0004.sql b/src/backenddb/merchant-0004.sql @@ -48,3 +48,36 @@ COMMENT ON COLUMN merchant_template.template_contract IS 'The template contract will contains some additional information.'; COMMIT; + + +CREATE TABLE IF NOT EXISTS merchant_webhooks + (webhooks_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY + ,merchant_serial BIGINT NOT NULL + REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE + ,webhooks_id VARCHAR NOT NULL + ,event_type VARCHAR NOT NULL + ,url VARCHAR NOT NULL + ,methods VARCHAR NOT NULL + ,header_template VARCHAR NOT NULL -- in JSON format + ,body_template VARCHAR NOT NULL -- in JSON format + ,merchant_instance VARCHAR NOT NULL + ,UNIQUE (merchant_serial, webhooks_id) + ); +COMMENT ON TABLE merchant_webhooks + IS 'webhooks used by the merchant (may be incomplete, frontend can override)'; +COMMENT ON COLUMN merchant_webhooks.event_type + IS 'Event of the webhooks'; +COMMENT ON COLUMN merchant_webhooks.url + IS 'URL use by the customer'; +COMMENT ON COLUMN merchant_webhooks.methods + IS 'Methods use by the merchant'; +COMMENT ON COLUMN merchant_webhooks.header_template + IS 'Header of the webhooks'; +COMMENT ON COLUMN merchant_webhooks.body_template + IS 'Body of the webhooks'; +COMMENT ON COLUMN merchant_webhooks.merchant_instance + IS 'Information of the merchant'; + +COMMIT; + + diff --git a/src/testing/test_merchant_product_creation.sh b/src/testing/test_merchant_product_creation.sh @@ -24,7 +24,8 @@ FORTYTHREE=`get_payto_uri fortythree x` STATUS=$(curl -H "Content-Type: application/json" -X POST \ -H 'Authorization: Bearer secret-token:super_secret' \ http://localhost:9966/management/instances \ - -d '{"auth":{"method":"external"},"payto_uris":["'$FORTYTHREE'"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \ + -d '{"auth":{"method":"external"},"payto_uris":["'$FORTYTHREE'"],"id":"default","name":"default","address":{},"jurisdiction":{},"default_max_wire_fee":"TESTKUDOS +:1", "default_max_deposit_fee":"TESTKUDOS:1","default_wire_fee_amortization":1,"default_wire_transfer_delay":{"d_us" : 50000000},"default_pay_delay":{"d_us": 60000000}}' \ -w "%{http_code}" -s -o /dev/null) if [ "$STATUS" != "204" ] diff --git a/src/testing/test_merchant_template_creation.sh b/src/testing/test_merchant_template_creation.sh