Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to override webhook url using library? #69

Open
AhmetHuseyinDOK opened this issue May 15, 2024 · 1 comment
Open

How to override webhook url using library? #69

AhmetHuseyinDOK opened this issue May 15, 2024 · 1 comment

Comments

@AhmetHuseyinDOK
Copy link

AhmetHuseyinDOK commented May 15, 2024

In the Midtrans documentation, it is shown that we can override the webhook url via headers, How can I achieve the same result using this library ?

https://docs.midtrans.com/docs/https-notification-webhooks#customizing-notification-url-via-api

@AhmetHuseyinDOK
Copy link
Author

Ok I found a workaround,

this.snapApi.httpClient.http_client.defaults.headers.common['X-Override-Notification'] = "https://somewebhook.com/handler/ ";

But I think, it would be nice to be able to do it with an optional config like this

this.snapApi.createTransaction({
            transaction_details: {
                gross_amount: transaction.amount,
                order_id: transaction.id,
            },
            enabled_payments: ['gopay'],
            overrideNotification: 'https://somenotificatipon.com/webhookhandler/' // would be much nicer
        })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant