-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #151 from breez/savage-unregister-webhook
Unregister webhook
- Loading branch information
Showing
24 changed files
with
228 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import 'package:breez_sdk/breez_sdk.dart'; | ||
|
||
Future<void> webhook() async { | ||
Future<void> registerWebhook() async { | ||
// ANCHOR: register-webook | ||
await BreezSDK().registerWebhook(webhookUrl: "https://yourapplication.com"); | ||
await BreezSDK().registerWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>"); | ||
// ANCHOR_END: register-webook | ||
} | ||
|
||
Future<void> paymentWebhook({required String paymentHash}) async { | ||
// ANCHOR: register-payment-webook | ||
await BreezSDK().registerWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>"); | ||
// ANCHOR_END: register-payment-webook | ||
Future<void> unregisterWebhook() async { | ||
// ANCHOR: unregister-webook | ||
await BreezSDK().unregisterWebhook(webhookUrl: "https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>"); | ||
// ANCHOR_END: unregister-webook | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import breez_sdk | ||
|
||
def webhook(sdk_services): | ||
try: | ||
def register_webhook(sdk_services): | ||
try: | ||
# ANCHOR: register-webook | ||
sdk_services.register_webhook("https://yourapplication.com") | ||
sdk_services.register_webhook("https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>") | ||
# ANCHOR_END: register-webook | ||
except Exception as error: | ||
except Exception as error: | ||
print(error) | ||
raise | ||
|
||
def payment_webhook(sdk_services): | ||
def unregister_webhook(sdk_services): | ||
try: | ||
# ANCHOR: register-payment-webook | ||
sdk_services.register_webhook("https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>") | ||
# ANCHOR_END: register-payment-webook | ||
# ANCHOR: unregister-webook | ||
sdk_services.unregister_webhook("https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>") | ||
# ANCHOR_END: unregister-webook | ||
except Exception as error: | ||
print(error) | ||
raise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { registerWebhook } from '@breeztech/react-native-breez-sdk' | ||
import { registerWebhook, unregisterWebhook } from '@breeztech/react-native-breez-sdk' | ||
|
||
const webhook = async () => { | ||
const _registerWebhook = async () => { | ||
// ANCHOR: register-webook | ||
try { | ||
await registerWebhook('https://yourapplication.com') | ||
await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>') | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
// ANCHOR_END: register-webook | ||
} | ||
|
||
const paymentWebhook = async () => { | ||
// ANCHOR: register-payment-webook | ||
const _unregisterWebhook = async () => { | ||
// ANCHOR: unregister-webook | ||
try { | ||
await registerWebhook('https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>') | ||
await unregisterWebhook('https://your-nds-service.com/notify?platform=ios&token=<PUSH_TOKEN>') | ||
} catch (err) { | ||
console.error(err) | ||
} | ||
// ANCHOR_END: register-payment-webook | ||
// ANCHOR_END: unregister-webook | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -714,11 +714,6 @@ | |
"@babel/helper-validator-identifier" "^7.22.20" | ||
to-fast-properties "^2.0.0" | ||
|
||
"@breeztech/[email protected]": | ||
version "0.4.0" | ||
resolved "https://registry.yarnpkg.com/@breeztech/react-native-breez-sdk/-/react-native-breez-sdk-0.4.0.tgz#986136d9414ff9fb5d67c1b005b966c0b4440637" | ||
integrity sha512-9OGmYUIxfhFUTbvnRXKG551xM77bAW4Fb4SgKa7KieFI3oytFR5xPl3OHU1baUqAUqB86QEAVxljYMA+YUR4gA== | ||
|
||
"@esbuild/[email protected]": | ||
version "0.18.20" | ||
resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.