docs: improve payment related guides (#12502)

* improve guide

* update guides

* small change
This commit is contained in:
Shahed Nasser
2025-05-15 18:40:21 +03:00
committed by GitHub
parent b312a7e077
commit 22cdcedddc
26 changed files with 15844 additions and 15704 deletions
@@ -35,3 +35,19 @@ When a payment is refunded, a refund, represented by the [Refund data model](/re
A payment can be refunded multiple times, and each time a refund record is created.
![A diagram showcasing how a payment's multiple refunds are stored](https://res.cloudinary.com/dza7lstvk/image/upload/v1711565555/Medusa%20Resources/payment-refund_lgfvyy.jpg)
---
## data Property
Payment providers may need additional data to process the payment later. For example, the ID of the associated payment in the third-party provider.
The `Payment` data model has a `data` property used to store that data. The first time it's set is when the [payment provider in Medusa](../payment-provider/page.mdx) authorizes the payment.
Then, the `data` property is passed to the Medusa payment provider when the payment is captured or refunded, allowing the payment provider to utilize the data to process the payment with the third-party provider.
<Note title="Tip">
If you're building a custom payment provider, learn more about authorizing and capturing the payments and setting the `data` property in the [Create Payment Provider](/references/payment/provider) guide.
</Note>