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

Match Create Invoice args to BTCPayServer source code #29

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

junderw
Copy link
Contributor

@junderw junderw commented Sep 18, 2019

src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
@NicolasDorier
Copy link
Member

{ 
   "facade":"pos/invoice",
   "data":{ 
      "url":"http://127.0.0.1:53843/invoice?id=5gHRkJu5NboQDwhUJyUp32",
      "posData":"posData",
      "status":"new",
      "btcPrice":"1.00000000",
      "btcDue":"1.00000000",
      "cryptoInfo":[ 
         { 
            "cryptoCode":"BTC",
            "paymentType":"BTCLike",
            "rate":5000.0,
            "exRates":{ 
               "USD":0.0
            },
            "paid":"0.00000000",
            "price":"1.00000000",
            "due":"1.00000000",
            "paymentUrls":{ 
               "BIP21":"bitcoin:mqchV9jYopNgorV9io5fEBWE8LPaxUPecd?amount=1.00000000",
               "BIP72":null,
               "BIP72b":null,
               "BIP73":null,
               "BOLT11":null
            },
            "address":"mqchV9jYopNgorV9io5fEBWE8LPaxUPecd",
            "url":"http://127.0.0.1:53843/i/BTC/5gHRkJu5NboQDwhUJyUp32",
            "totalDue":"1.00000000",
            "networkFee":"0.00000000",
            "txCount":0,
            "cryptoPaid":"0.00000000",
            "payments":[ 

            ]
         }
      ],
      "price":5000.0,
      "taxIncluded":1000.0,
      "currency":"USD",
      "exRates":{ 
         "USD":0.0
      },
      "buyerTotalBtcAmount":null,
      "itemDesc":"Some description",
      "itemCode":null,
      "orderId":"orderId",
      "guid":"1a075bf5-0553-408a-bd5d-f11ab042f707",
      "id":"5gHRkJu5NboQDwhUJyUp32",
      "invoiceTime":1568878944000,
      "expirationTime":1568879844000,
      "currentTime":1568878945262,
      "lowFeeDetected":false,
      "btcPaid":"0.00000000",
      "rate":5000.0,
      "exceptionStatus":false,
      "paymentUrls":{ 
         "BIP21":"bitcoin:mqchV9jYopNgorV9io5fEBWE8LPaxUPecd?amount=1.00000000",
         "BIP72":null,
         "BIP72b":null,
         "BIP73":null,
         "BOLT11":null
      },
      "refundAddressRequestPending":false,
      "buyerPaidBtcMinerFee":null,
      "bitcoinAddress":"mqchV9jYopNgorV9io5fEBWE8LPaxUPecd",
      "token":"9h9sTjk2dAAVzedytKtY2n",
      "flags":{ 
         "refundable":false
      },
      "paymentSubtotals":{ 
         "BTC":100000000
      },
      "paymentTotals":{ 
         "BTC":100000000
      },
      "amountPaid":0,
      "minerFees":{ 
         "BTC":{ 
            "satoshisPerByte":100.0,
            "totalFee":0
         }
      },
      "exchangeRates":{ 
         "BTC":{ 
            "USD":0.0
         }
      },
      "supportedTransactionCurrencies":{ 
         "BTC":{ 
            "enabled":true
         }
      },
      "addresses":{ 
         "BTC":"mqchV9jYopNgorV9io5fEBWE8LPaxUPecd"
      },
      "paymentCodes":{ 
         "BTC":{ 
            "BIP21":"bitcoin:mqchV9jYopNgorV9io5fEBWE8LPaxUPecd?amount=1.00000000",
            "BIP72":null,
            "BIP72b":null,
            "BIP73":null,
            "BOLT11":null
         }
      },
      "buyer":{ 
         "name":null,
         "address1":null,
         "address2":null,
         "locality":null,
         "region":null,
         "postalCode":null,
         "country":null,
         "phone":null,
         "email":null
      }
   }
}

@junderw
Copy link
Contributor Author

junderw commented Sep 19, 2019

Your example doesn't match the interface used in the source code to handle the request.

That is here:

https://github.com/btcpayserver/btcpayserver/blob/6407e15187d1e3216c55ab63eb6237064c21c85b/BTCPayServer/Models/CreateInvoiceRequest.cs

@NicolasDorier
Copy link
Member

@junderw I copy pasted the response not the request! I will fix stuff, for some reason I used the same type for request and response it seems. The request don't have minerFees, but the code show it, I will fix this.

src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
src/models/client.ts Outdated Show resolved Hide resolved
@junderw
Copy link
Contributor Author

junderw commented Sep 24, 2019

Fixed all the issues raised.

@NicolasDorier final check?

@NicolasDorier
Copy link
Member

Nice, seems good to me!

@junderw
Copy link
Contributor Author

junderw commented Sep 26, 2019

Cool. Merge when you're ready!

@NicolasDorier
Copy link
Member

@takinbo wants to take a look?

@takinbo
Copy link
Collaborator

takinbo commented Sep 26, 2019

LGTM!

@takinbo
Copy link
Collaborator

takinbo commented Sep 26, 2019

Do we need to update the version number and cut a new release or no?

@wallopthecat
Copy link

Yes please, this adds lots of functionality previously unavailable to consumers of this lib

@junderw
Copy link
Contributor Author

junderw commented Sep 27, 2019

Yes. We should update and bump patch.

@NicolasDorier
Copy link
Member

@takinbo you merge and push?

@takinbo takinbo merged commit 0170ccc into btcpayserver:master Sep 27, 2019
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

Successfully merging this pull request may close these issues.

custom invoice fields not allowed
4 participants