|
|
@@ -969,9 +969,9 @@ ON CONFLICT(id) DO UPDATE SET
|
|
|
query(
|
|
|
r#"
|
|
|
INSERT INTO transactions
|
|
|
-(id, mint_url, direction, unit, amount, fee, ys, timestamp, memo, metadata, quote_id)
|
|
|
+(id, mint_url, direction, unit, amount, fee, ys, timestamp, memo, metadata, quote_id, payment_request, payment_proof)
|
|
|
VALUES
|
|
|
-(:id, :mint_url, :direction, :unit, :amount, :fee, :ys, :timestamp, :memo, :metadata, :quote_id)
|
|
|
+(:id, :mint_url, :direction, :unit, :amount, :fee, :ys, :timestamp, :memo, :metadata, :quote_id, :payment_request, :payment_proof)
|
|
|
ON CONFLICT(id) DO UPDATE SET
|
|
|
mint_url = excluded.mint_url,
|
|
|
direction = excluded.direction,
|
|
|
@@ -982,7 +982,9 @@ ON CONFLICT(id) DO UPDATE SET
|
|
|
timestamp = excluded.timestamp,
|
|
|
memo = excluded.memo,
|
|
|
metadata = excluded.metadata,
|
|
|
- quote_id = excluded.quote_id
|
|
|
+ quote_id = excluded.quote_id,
|
|
|
+ payment_request = excluded.payment_request,
|
|
|
+ payment_proof = excluded.payment_proof
|
|
|
;
|
|
|
"#,
|
|
|
)?
|
|
|
@@ -1000,6 +1002,8 @@ ON CONFLICT(id) DO UPDATE SET
|
|
|
serde_json::to_string(&transaction.metadata).map_err(Error::from)?,
|
|
|
)
|
|
|
.bind("quote_id", transaction.quote_id)
|
|
|
+ .bind("payment_request", transaction.payment_request)
|
|
|
+ .bind("payment_proof", transaction.payment_proof)
|
|
|
.execute(&*conn)
|
|
|
.await?;
|
|
|
|
|
|
@@ -1024,7 +1028,9 @@ ON CONFLICT(id) DO UPDATE SET
|
|
|
timestamp,
|
|
|
memo,
|
|
|
metadata,
|
|
|
- quote_id
|
|
|
+ quote_id,
|
|
|
+ payment_request,
|
|
|
+ payment_proof
|
|
|
FROM
|
|
|
transactions
|
|
|
WHERE
|
|
|
@@ -1059,7 +1065,9 @@ ON CONFLICT(id) DO UPDATE SET
|
|
|
timestamp,
|
|
|
memo,
|
|
|
metadata,
|
|
|
- quote_id
|
|
|
+ quote_id,
|
|
|
+ payment_request,
|
|
|
+ payment_proof
|
|
|
FROM
|
|
|
transactions
|
|
|
"#,
|
|
|
@@ -1297,7 +1305,9 @@ fn sql_row_to_transaction(row: Vec<Column>) -> Result<Transaction, Error> {
|
|
|
timestamp,
|
|
|
memo,
|
|
|
metadata,
|
|
|
- quote_id
|
|
|
+ quote_id,
|
|
|
+ payment_request,
|
|
|
+ payment_proof
|
|
|
) = row
|
|
|
);
|
|
|
|
|
|
@@ -1321,5 +1331,7 @@ fn sql_row_to_transaction(row: Vec<Column>) -> Result<Transaction, Error> {
|
|
|
})
|
|
|
.unwrap_or_default(),
|
|
|
quote_id: column_as_nullable_string!(quote_id),
|
|
|
+ payment_request: column_as_nullable_string!(payment_request),
|
|
|
+ payment_proof: column_as_nullable_string!(payment_proof),
|
|
|
})
|
|
|
}
|