Skip to content

Instantly share code, notes, and snippets.

@yyalim
Created January 22, 2024 15:50
Show Gist options
  • Save yyalim/b28afe92d4b952e58f2fa175eafeeb94 to your computer and use it in GitHub Desktop.
Save yyalim/b28afe92d4b952e58f2fa175eafeeb94 to your computer and use it in GitHub Desktop.
try {
await sendRequest("POST", "payment/validate_receipt/", {
data: {
platform: Capacitor.getPlatform(),
receipt: isPlatform(["ios"]) ? receipt : JSON.stringify(receipt),
},
});
if (localReceiptId) {
await this.removeFromLocalReceipts(localReceiptId);
} else {
this.$router.push({
name: "appointments",
query: { show_add: true },
});
}
} catch (error) {
// Handle any errors here
console.error(error);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment