Skip to content

Commit 38fe274

Browse files
committed
Release 2.2.0
1 parent e75ac8b commit 38fe274

File tree

5 files changed

+86
-11
lines changed

5 files changed

+86
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "postfinancecheckout",
33
"title": "PostFinance Checkout",
4-
"version": "2.1.0",
4+
"version": "2.2.0",
55
"description": "TypeScript/JavaScript client for PostFinance Checkout",
66
"homepage": "http://github.com/pfpayments/typescript-sdk",
77
"repository": {

src/api/TransactionService.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -687,22 +687,28 @@ class TransactionService {
687687
* @summary Fetch Possible Payment Methods
688688
* @param spaceId
689689
* @param id The id of the transaction which should be returned.
690+
* @param integrationMode The integration mode defines the type of integration that is applied on the transaction.
690691
* @param {*} [options] Override http request options.
691692
*/
692-
public fetchPossiblePaymentMethods (spaceId: number, id: number, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Array<PaymentMethodConfiguration>; }> {
693-
const localVarPath = this.basePath + '/transaction/fetchPossiblePaymentMethods';
693+
public fetchPaymentMethods (spaceId: number, id: number, integrationMode: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Array<PaymentMethodConfiguration>; }> {
694+
const localVarPath = this.basePath + '/transaction/fetch-payment-methods';
694695
let localVarQueryParameters: any = {};
695696
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
696697
let localVarFormParams: any = {};
697698

698699
// verify required parameter 'spaceId' is not null or undefined
699700
if (spaceId === null || spaceId === undefined) {
700-
throw new Error('Required parameter spaceId was null or undefined when calling fetchPossiblePaymentMethods.');
701+
throw new Error('Required parameter spaceId was null or undefined when calling fetchPaymentMethods.');
701702
}
702703

703704
// verify required parameter 'id' is not null or undefined
704705
if (id === null || id === undefined) {
705-
throw new Error('Required parameter id was null or undefined when calling fetchPossiblePaymentMethods.');
706+
throw new Error('Required parameter id was null or undefined when calling fetchPaymentMethods.');
707+
}
708+
709+
// verify required parameter 'integrationMode' is not null or undefined
710+
if (integrationMode === null || integrationMode === undefined) {
711+
throw new Error('Required parameter integrationMode was null or undefined when calling fetchPaymentMethods.');
706712
}
707713

708714
if (spaceId !== undefined) {
@@ -713,6 +719,10 @@ class TransactionService {
713719
localVarQueryParameters['id'] = ObjectSerializer.serialize(id, "number");
714720
}
715721

722+
if (integrationMode !== undefined) {
723+
localVarQueryParameters['integrationMode'] = ObjectSerializer.serialize(integrationMode, "string");
724+
}
725+
716726
(<any>Object).assign(localVarHeaderParams, options.headers);
717727

718728
let localVarUseFormData = false;
@@ -780,23 +790,33 @@ class TransactionService {
780790
* This operation allows to get the payment method configurations which can be used with the provided transaction.
781791
* @summary Fetch Possible Payment Methods with Credentials
782792
* @param credentials The credentials identifies the transaction and contains the security details which grants the access this operation.
793+
* @param integrationMode The integration mode defines the type of integration that is applied on the transaction.
783794
* @param {*} [options] Override http request options.
784795
*/
785-
public fetchPossiblePaymentMethodsWithCredentials (credentials: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Array<PaymentMethodConfiguration>; }> {
786-
const localVarPath = this.basePath + '/transaction/fetchPossiblePaymentMethodsWithCredentials';
796+
public fetchPaymentMethodsWithCredentials (credentials: string, integrationMode: string, options: any = {}) : Promise<{ response: http.IncomingMessage; body: Array<PaymentMethodConfiguration>; }> {
797+
const localVarPath = this.basePath + '/transaction/fetch-payment-methods-with-credentials';
787798
let localVarQueryParameters: any = {};
788799
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
789800
let localVarFormParams: any = {};
790801

791802
// verify required parameter 'credentials' is not null or undefined
792803
if (credentials === null || credentials === undefined) {
793-
throw new Error('Required parameter credentials was null or undefined when calling fetchPossiblePaymentMethodsWithCredentials.');
804+
throw new Error('Required parameter credentials was null or undefined when calling fetchPaymentMethodsWithCredentials.');
805+
}
806+
807+
// verify required parameter 'integrationMode' is not null or undefined
808+
if (integrationMode === null || integrationMode === undefined) {
809+
throw new Error('Required parameter integrationMode was null or undefined when calling fetchPaymentMethodsWithCredentials.');
794810
}
795811

796812
if (credentials !== undefined) {
797813
localVarQueryParameters['credentials'] = ObjectSerializer.serialize(credentials, "string");
798814
}
799815

816+
if (integrationMode !== undefined) {
817+
localVarQueryParameters['integrationMode'] = ObjectSerializer.serialize(integrationMode, "string");
818+
}
819+
800820
(<any>Object).assign(localVarHeaderParams, options.headers);
801821

802822
let localVarUseFormData = false;

src/models/Account.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ class Account {
1515
*/
1616
'activeOrRestrictedActive'?: boolean;
1717

18+
/**
19+
* The ID of a user that deleted this entity.
20+
*/
21+
'deletedBy'?: number;
22+
23+
/**
24+
* The date and time when this entity was deleted.
25+
*/
26+
'deletedOn'?: Date;
27+
1828
/**
1929
* The ID is the primary key of the entity. The ID identifies the entity uniquely.
2030
*/
@@ -82,6 +92,18 @@ class Account {
8292
"type": "boolean"
8393
},
8494

95+
{
96+
"name": "deletedBy",
97+
"baseName": "deletedBy",
98+
"type": "number"
99+
},
100+
101+
{
102+
"name": "deletedOn",
103+
"baseName": "deletedOn",
104+
"type": "Date"
105+
},
106+
85107
{
86108
"name": "id",
87109
"baseName": "id",

src/models/Space.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ class Space {
2727
*/
2828
'database'?: TenantDatabase;
2929

30+
/**
31+
* The ID of a user that deleted this entity.
32+
*/
33+
'deletedBy'?: number;
34+
35+
/**
36+
* The date and time when this entity was deleted.
37+
*/
38+
'deletedOn'?: Date;
39+
3040
/**
3141
* The ID is the primary key of the entity. The ID identifies the entity uniquely.
3242
*/
@@ -111,6 +121,18 @@ class Space {
111121
"type": "TenantDatabase"
112122
},
113123

124+
{
125+
"name": "deletedBy",
126+
"baseName": "deletedBy",
127+
"type": "number"
128+
},
129+
130+
{
131+
"name": "deletedOn",
132+
"baseName": "deletedOn",
133+
"type": "Date"
134+
},
135+
114136
{
115137
"name": "id",
116138
"baseName": "id",

test/TransactionService.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,19 @@ describe('TransactionService', () => {
164164
* @param id The id of the transaction which should be returned.
165165
* @param {*} [options] Override http request options.
166166
*/
167-
describe('fetchPossiblePaymentMethods', () => {
168-
167+
describe('fetchPaymentMethods', () => {
168+
it('fetchPaymentMethods successful', () => {
169+
let transaction: PostFinanceCheckout.model.Transaction;
170+
transactionService.create(config.space_id, getTransactionPayload())
171+
.then((response: { response: http.IncomingMessage, body: PostFinanceCheckout.model.Transaction }) => {
172+
transaction = response.body;
173+
return transactionService.fetchPaymentMethods(config.space_id, <number>transaction.id, "payment_page");
174+
})
175+
.done((response: { response: http.IncomingMessage, body: Array<PostFinanceCheckout.model.PaymentMethodConfiguration> }) => {
176+
let paymentMethods: Array<PostFinanceCheckout.model.PaymentMethodConfiguration> = response.body;
177+
expect(paymentMethods).to.be.an('array');
178+
});
179+
});
169180
});
170181

171182
/**
@@ -174,7 +185,7 @@ describe('TransactionService', () => {
174185
* @param credentials The credentials identifies the transaction and contains the security details which grants the access this operation.
175186
* @param {*} [options] Override http request options.
176187
*/
177-
describe('fetchPossiblePaymentMethodsWithCredentials', () => {
188+
describe('fetchPaymentMethodsWithCredentials', () => {
178189

179190
});
180191

0 commit comments

Comments
 (0)