Payment-FinishReservation-v2: Difference between revisions

From Barion Documentation
Jump to navigation Jump to search
(Created page with "{{PageTitle|title=Finish reservation}} {{api_callmethod |method=POST |uri=/v2/Payment/FinishReservation }} The <code>/payment/FinishReservation</code> API endpoint is used t...")
 
mNo edit summary
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{PageTitle|title=Finish reservation}}
{{PageTitle|title=Barion API: Finish a pending reservation}}
 
{{TableOfContents}}


{{api_callmethod
{{api_callmethod
Line 6: Line 8:
}}
}}


The <code>/payment/FinishReservation</code> API endpoint is used to finalize a reserved payment in the Barion system.
The <code>/payment/finishreservation</code> API endpoint is used to finalize a pending reservation in the Barion system.


Prerequisites before use:
Prerequisites before use:
Line 12: Line 14:
* [[Creating_a_shop|Creating a shop in Barion]]
* [[Creating_a_shop|Creating a shop in Barion]]
* [[Calling_the_API| Start a payment]]
* [[Calling_the_API| Start a payment]]
* API: [[Payment-Start-v2 | /Payment/Start]]
== Authentication ==
[[Barion Shop Authentication]]


== Use cases ==
== Use cases ==


This API endpoint is designed to be used in the following scenarios:
This API endpoint is designed to be used in the following scenarios:
* [[Payment_with_reservation|Payment with reservation]]
* [[Reservation_payment|Payments with reservation]]
 
 
With this API call the shop can finalize  transactions approved by users. The users can approve their transaction via the Barion GUI. In case of reservation, the transaction can not be finished if the amount exceeds the one what user approved. If a transaction finished with 0 currency then the users gets back the full reserved amount. If the finalized  amount is lesser than the reserved amount, the margin will be refunded to the user’s wallet. For every
finalization the shop’s owner must identify itself via Barion API. 


== Input properties ==
== Input properties ==
Line 31: Line 34:


|-
|-
|PaymentId || Guid || *Required || Payment identifier, generated by Barion
|PaymentId || Guid ||  
* Required  
|| The identifier of the payment in the Barion system.


|-
|-
|Transactions || [[PaymentTransaction]][] || *Required || Array of transactions
|Transactions || [[TransactionToFinish]][] ||  
* Required  
|| The <u>payment transactions</u> that the shop would like to finish.
|}
|}
=== Important things about the transaction structure ===
* The Transactions[] array should only contain the <u>initial</u> payment transactions. The additional transactions generated by the Barion system (e.g. fees) must not be included in the call.
* Each payment transaction can only be finished once.
* It is not neccessary to finish all transactions in the same API call, but one call must contain at least one transaction to finish.
* If a transaction is finished with a '''Total''' amount lesser than its initial value, the remaining amount is refunded to the payer.
* If the reservation period passes, all unfinished transactions are finished with zero amount.


== Output properties ==
== Output properties ==


{{api_output_table_header}}
{{api_output_table_header}}
|-
|IsSuccessful || bool || Result of the transaction


|-
|-
Line 52: Line 69:
| Status || [[PaymentStatus]]|| The status of the payment in the Barion system.  
| Status || [[PaymentStatus]]|| The status of the payment in the Barion system.  


|-
|-  
|Isuccessful || bool || Result of the transaction
|Transactions|| [[ProcessedTransaction]][] || Related transactions
|}
|}

Latest revision as of 10:50, 15 November 2022

Barion API: Finish a pending reservation

POST /v2/Payment/FinishReservation

The /payment/finishreservation API endpoint is used to finalize a pending reservation in the Barion system.

Prerequisites before use:

Authentication

Barion Shop Authentication

Use cases

This API endpoint is designed to be used in the following scenarios:

Input properties

Property name Property type Limitations and constraints Description
POSKey Guid
  • Required
The secret API key of the shop, generated by Barion. This lets the shop to authenticate through the Barion API, but does not provide access to the account owning the shop itself.
PaymentId Guid
  • Required
The identifier of the payment in the Barion system.
Transactions TransactionToFinish[]
  • Required
The payment transactions that the shop would like to finish.

Important things about the transaction structure

  • The Transactions[] array should only contain the initial payment transactions. The additional transactions generated by the Barion system (e.g. fees) must not be included in the call.
  • Each payment transaction can only be finished once.
  • It is not neccessary to finish all transactions in the same API call, but one call must contain at least one transaction to finish.
  • If a transaction is finished with a Total amount lesser than its initial value, the remaining amount is refunded to the payer.
  • If the reservation period passes, all unfinished transactions are finished with zero amount.

Output properties

Property name Property type Description
IsSuccessful bool Result of the transaction
PaymentId Guid The identifier of the newly initialized payment, generated by the Barion system.
PaymentRequestId string The payment identifier supplied by the API caller in the request.
Status PaymentStatus The status of the payment in the Barion system.
Transactions ProcessedTransaction[] Related transactions