-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcard-refunds.ts
More file actions
47 lines (41 loc) · 1.49 KB
/
card-refunds.ts
File metadata and controls
47 lines (41 loc) · 1.49 KB
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
38
39
40
41
42
43
44
45
46
47
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as TransactionsAPI from '../transactions';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
export class CardRefunds extends APIResource {
/**
* Simulates refunding a card transaction. The full value of the original sandbox
* transaction is refunded.
*
* @example
* ```ts
* const transaction =
* await client.simulations.cardRefunds.create();
* ```
*/
create(body: CardRefundCreateParams, options?: RequestOptions): APIPromise<TransactionsAPI.Transaction> {
return this._client.post('/simulations/card_refunds', { body, ...options });
}
}
export interface CardRefundCreateParams {
/**
* The refund amount in cents. Pulled off the `pending_transaction` or the
* `transaction` if not provided.
*/
amount?: number;
/**
* The identifier of the Pending Transaction for the refund authorization. If this
* is provided, `transaction` must not be provided as a refund with a refund
* authorized can not be linked to a regular transaction.
*/
pending_transaction_id?: string;
/**
* The identifier for the Transaction to refund. The Transaction's source must have
* a category of card_settlement.
*/
transaction_id?: string;
}
export declare namespace CardRefunds {
export { type CardRefundCreateParams as CardRefundCreateParams };
}