-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcard-settlements.ts
More file actions
55 lines (49 loc) · 1.75 KB
/
card-settlements.ts
File metadata and controls
55 lines (49 loc) · 1.75 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
48
49
50
51
52
53
54
55
// 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 CardSettlements extends APIResource {
/**
* Simulates the settlement of an authorization by a card acquirer. After a card
* authorization is created, the merchant will eventually send a settlement. This
* simulates that event, which may occur many days after the purchase in
* production. The amount settled can be different from the amount originally
* authorized, for example, when adding a tip to a restaurant bill.
*
* @example
* ```ts
* const transaction =
* await client.simulations.cardSettlements.create({
* card_id: 'card_oubs0hwk5rn6knuecxg2',
* pending_transaction_id:
* 'pending_transaction_k1sfetcau2qbvjbzgju4',
* });
* ```
*/
create(
body: CardSettlementCreateParams,
options?: RequestOptions,
): APIPromise<TransactionsAPI.Transaction> {
return this._client.post('/simulations/card_settlements', { body, ...options });
}
}
export interface CardSettlementCreateParams {
/**
* The identifier of the Card to create a settlement on.
*/
card_id: string;
/**
* The identifier of the Pending Transaction for the Card Authorization you wish to
* settle.
*/
pending_transaction_id: string;
/**
* The amount to be settled. This defaults to the amount of the Pending Transaction
* being settled.
*/
amount?: number;
}
export declare namespace CardSettlements {
export { type CardSettlementCreateParams as CardSettlementCreateParams };
}