-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: when
action
property is set auto-POSTs payment info to URL
Previously, using `action` sent url encoded form data, which was broken (`[object Object]`). Now, it uses Fetch API to post JSON data.
- Loading branch information
1 parent
4d0a58d
commit 35f0502
Showing
10 changed files
with
323 additions
and
199 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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Throws an error if the response is not OK.) | ||
* @param {Response} response | ||
* @resolves {Response} | ||
* @rejects {Error} | ||
*/ | ||
export async function throwBadResponse(response) { | ||
const { ok, statusText } = response; | ||
if (!ok) throw new Error(statusText); | ||
return response; | ||
} |
Oops, something went wrong.