-
Notifications
You must be signed in to change notification settings - Fork 0
/
model_refund_payment_request.go
37 lines (35 loc) · 4.24 KB
/
model_refund_payment_request.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Square Connect API
*
* Client library for accessing the Square Connect APIs
*
* API version: 2.0
* Contact: developers@squareup.com
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package models
// Describes a request to refund a payment using [RefundPayment](https://developer.squareup.com/reference/square_2023-12-13/refunds-api/refund-payment).
type RefundPaymentRequest struct {
// A unique string that identifies this `RefundPayment` request. The key can be any valid string but must be unique for every `RefundPayment` request. Keys are limited to a max of 45 characters - however, the number of allowed characters might be less than 45, if multi-byte characters are used. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
IdempotencyKey string `json:"idempotency_key"`
// The amount of money to refund. This amount cannot be more than the `total_money` value of the payment minus the total amount of all previously completed refunds for this payment. This amount must be specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). For more information, see [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts). The currency code must match the currency associated with the business that is charging the card.
AmountMoney *Money `json:"amount_money"`
// The amount of money the developer contributes to help cover the refunded amount. This amount is specified in the smallest denomination of the applicable currency (for example, US dollar amounts are specified in cents). The value cannot be more than the `amount_money`. You can specify this parameter in a refund request only if the same parameter was also included when taking the payment. This is part of the application fee scenario the API supports. For more information, see [Take Payments and Collect Fees](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees). To set this field, `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission is required. For more information, see [Permissions](https://developer.squareup.com/docs/payments-api/take-payments-and-collect-fees#permissions).
AppFeeMoney *Money `json:"app_fee_money,omitempty"`
// The unique ID of the payment being refunded. Required when unlinked=false, otherwise must not be set.
PaymentId string `json:"payment_id,omitempty"`
// The ID indicating where funds will be refunded to, if this is an unlinked refund. This can be any of the following: A token generated by Web Payments SDK; a card-on-file identifier. Required for requests specifying unlinked=true. Otherwise, if included when `unlinked=false`, will throw an error.
DestinationId string `json:"destination_id,omitempty"`
// Indicates that the refund is not linked to a Square payment. If set to true, `destination_id` and `location_id` must be supplied while `payment_id` must not be provided.
Unlinked bool `json:"unlinked,omitempty"`
// The location ID associated with the unlinked refund. Required for requests specifying `unlinked=true`. Otherwise, if included when `unlinked=false`, will throw an error.
LocationId string `json:"location_id,omitempty"`
// The [Customer](https://developer.squareup.com/reference/square_2023-12-13/objects/Customer) ID of the customer associated with the refund. This is required if the `destination_id` refers to a card on file created using the Cards API. Only allowed when `unlinked=true`.
CustomerId string `json:"customer_id,omitempty"`
// A description of the reason for the refund.
Reason string `json:"reason,omitempty"`
// Used for optimistic concurrency. This opaque token identifies the current `Payment` version that the caller expects. If the server has a different version of the Payment, the update fails and a response with a VERSION_MISMATCH error is returned. If the versions match, or the field is not provided, the refund proceeds as normal.
PaymentVersionToken string `json:"payment_version_token,omitempty"`
// An optional [TeamMember](https://developer.squareup.com/reference/square_2023-12-13/objects/TeamMember) ID to associate with this refund.
TeamMemberId string `json:"team_member_id,omitempty"`
}