summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-02 13:39:28 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-02 13:39:28 +0100
commit0d42e6b76fa22430ac2996693ec7bbd94ceb8d3e (patch)
treef6a32bf7c9ba4a19aaa34a9f5de67cf8f78cc070 /core
parent44b5eaf1bc2f45b3c48ed60e53c745e7950dc48f (diff)
downloaddocs-0d42e6b76fa22430ac2996693ec7bbd94ceb8d3e.tar.gz
docs-0d42e6b76fa22430ac2996693ec7bbd94ceb8d3e.tar.bz2
docs-0d42e6b76fa22430ac2996693ec7bbd94ceb8d3e.zip
document new /public/poll-payment API
Diffstat (limited to 'core')
-rw-r--r--core/api-merchant.rst52
1 files changed, 52 insertions, 0 deletions
diff --git a/core/api-merchant.rst b/core/api-merchant.rst
index aca1e8c4..7fc4ac63 100644
--- a/core/api-merchant.rst
+++ b/core/api-merchant.rst
@@ -130,6 +130,9 @@ Receiving Payments
// URI that the wallet must process to complete the payment.
taler_pay_uri: string;
+ // Alternative order ID which was paid for already in the same session.
+ // Only given if the same product was purchased before in the same session.
+ already_paid_order_id?: string;
}
@@ -1123,3 +1126,52 @@ both by the user's browser and their wallet.
// The order of the signatures matches the planchets list.
reserve_sigs: EddsaSignature[];
}
+
+
+.. http:get:: /public/poll-payment
+
+ Check the payment status of an order.
+
+ **Request:**
+
+ :query order_id: order id that should be used for the payment
+ :query h_contract: hash of the contract (used to authenticate customer)
+ :query session_id: *Optional*. Session ID that the payment must be bound to. If not specified, the payment is not session-bound.
+ :query timeout: *Optional*. Timeout in seconds to wait for a payment if the answer would otherwise be negative (long polling).
+
+ **Response:**
+
+ Returns a `PollPaymentResponse`, whose format can differ based on the status of the payment.
+
+ .. ts:def:: PollPaymentResponse
+
+ type CheckPaymentResponse = PollPaymentPaidResponse | PollPaymentUnpaidResponse
+
+ .. ts:def:: PollPaymentPaidResponse
+
+ interface PollPaymentPaidResponse {
+ // value is always true;
+ paid: boolean;
+
+ // Was the payment refunded (even partially)
+ refunded: boolean;
+
+ // Amount that was refunded, only present if refunded is true.
+ refund_amount?: Amount;
+
+ }
+
+ .. ts:def:: PollPaymentUnpaidResponse
+
+ interface PollPaymentUnpaidResponse {
+ // value is always false;
+ paid: boolean;
+
+ // URI that the wallet must process to complete the payment.
+ taler_pay_uri: string;
+
+ // Alternative order ID which was paid for already in the same session.
+ // Only given if the same product was purchased before in the same session.
+ already_paid_order_id?: string;
+
+ }