-
Notifications
You must be signed in to change notification settings - Fork 24
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
Conversation
{
"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
}
}
} |
Your example doesn't match the interface used in the source code to handle the request. That is here: |
@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. |
Fixed all the issues raised. @NicolasDorier final check? |
Nice, seems good to me! |
Cool. Merge when you're ready! |
@takinbo wants to take a look? |
LGTM! |
Do we need to update the version number and cut a new release or no? |
Yes please, this adds lots of functionality previously unavailable to consumers of this lib |
Yes. We should update and bump patch. |
@takinbo you merge and push? |
Fixes #28
Got the types from here:
https://github.com/btcpayserver/btcpayserver/blob/6407e15187d1e3216c55ab63eb6237064c21c85b/BTCPayServer/Models/CreateInvoiceRequest.cs
Also had to dig around here too:
https://github.com/MetacoSA/NBitpayClient/tree/9a61ff948270cca7fdc0b6cdeaa3c60a6546f2de/NBitpayClient
@NicolasDorier Let me know if these are wrong?