Skip to content

Commit

Permalink
fix(subscriptions): boolean casting error
Browse files Browse the repository at this point in the history
  • Loading branch information
ndvo committed Mar 16, 2021
1 parent 0a06b21 commit cd70168
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,14 @@ function apiSub2Customer(apiSub) {
*/
function apiSub2Transaction(apiSub) {
const tx = apiSub["_embedded"]["fx:original_transaction"];
if (!!tx) {
if (!tx) {
console.log(tx);
throw new Error("Original transaction not found.");
}
if (!!tx.total_order) {
if (!tx.total_order) {
throw new Error("Original transaction does not contain the total order.");
}
if (!!tx.currency_symbol) {
if (!tx.currency_symbol) {
throw new Error("Original transaction does not specify a currency symbol..");
}
return {
Expand Down

0 comments on commit cd70168

Please sign in to comment.