-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9841693
commit 887874b
Showing
4 changed files
with
62 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,29 @@ | ||
import buckaroo from '../buckarooClient'; | ||
|
||
const subscription = buckaroo.method('CreditManagement3'); | ||
const subscription = buckaroo.method('subscriptions'); | ||
|
||
subscription.createCombined({ | ||
address: undefined, | ||
allowedServices: '', | ||
b2b: '', | ||
bankAccount: { accountName: '', bic: '', iban: '' }, | ||
billingTiming: 0, | ||
company: undefined, | ||
configuration: undefined, | ||
configurationCode: '', | ||
customerAccountName: '', | ||
customerBIC: '', | ||
customerIBAN: '', | ||
debtor: { code: '' }, | ||
email: '345345345', | ||
includeTransaction: false, | ||
mandateReference: '', | ||
subscriptionGuid: '', | ||
termStartDay: 0, | ||
termStartMonth: 0, | ||
termStartWeek: '', | ||
transactionVatPercentage: 0, | ||
}); | ||
|
||
buckaroo | ||
.method('ideal') | ||
.combine(subscription) | ||
.pay({ | ||
amountDebit: 1, | ||
currency: 'EUR', | ||
description: 'test', | ||
subscription | ||
.create({ | ||
additionalParameters: { | ||
signature: 'XXXXXXXX' | ||
}, | ||
ratePlans: { | ||
add: { | ||
startDate: '2024-07-23', | ||
ratePlanCode: 'XXXXXXXX' | ||
} | ||
}, | ||
ratePlanCharges: { | ||
add: { | ||
ratePlanChargeCode: 'XXXXXXXX' | ||
} | ||
}, | ||
configurationCode: 'XXXXXXXX', | ||
configuration: { | ||
name: 'XXXXXXXX' | ||
}, | ||
debtor: { | ||
code: 'XXXXXXXX' | ||
} | ||
}) | ||
.request(); | ||
const getActiveSubscriptions = subscription.getActiveSubscriptions() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,38 +3,37 @@ import buckarooClientTest from '../BuckarooClient.test'; | |
const subscription = buckarooClientTest.method('subscriptions'); | ||
|
||
describe('Subscription methods', () => { | ||
test('Create', () => { | ||
test('Create', async () => { | ||
return subscription | ||
.create({ | ||
additionalParameters: { | ||
signature: 'XXXXXXXX', | ||
signature: 'XXXXXXXX' | ||
}, | ||
ratePlans: { | ||
add: { | ||
startDate: '2024-07-23', | ||
ratePlanCode: 'XXXXXXXX', | ||
}, | ||
ratePlanCode: 'XXXXXXXX' | ||
} | ||
}, | ||
ratePlanCharges: { | ||
add: { | ||
ratePlanChargeCode: 'XXXXXXXX', | ||
}, | ||
ratePlanChargeCode: 'XXXXXXXX' | ||
} | ||
}, | ||
configurationCode: 'XXXXXXXX', | ||
configuration: { | ||
name: 'XXXXXXXX', | ||
name: 'XXXXXXXX' | ||
}, | ||
debtor: { | ||
code: 'XXXXXXXX', | ||
}, | ||
code: 'XXXXXXXX' | ||
} | ||
}) | ||
.request() | ||
.then((data) => { | ||
.request().then((data) => { | ||
expect(data.hasError()).toBeTruthy(); | ||
}); | ||
}); | ||
test('Update', async () => { | ||
subscription | ||
return subscription | ||
.update({ | ||
email: '[email protected]', | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
|
@@ -86,7 +85,7 @@ describe('Subscription methods', () => { | |
country: 'NL', | ||
}, | ||
}); | ||
subscription | ||
return subscription | ||
.combine('ideal') | ||
.pay({ | ||
issuer: 'ABNANL2A', | ||
|
@@ -98,12 +97,11 @@ describe('Subscription methods', () => { | |
expect(data).toBeDefined(); | ||
}); | ||
}); | ||
|
||
test('Update Combined Subscription', async () => { | ||
subscription.updateCombined({ | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
}); | ||
subscription | ||
return subscription | ||
.combine('ideal') | ||
.pay({ | ||
issuer: 'ABNANL2A', | ||
|
@@ -114,21 +112,22 @@ describe('Subscription methods', () => { | |
expect(data).toBeDefined(); | ||
}); | ||
}); | ||
|
||
test('Stop Subscription', async () => { | ||
const stop = await subscription.stop({ | ||
return subscription.stop({ | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
}).request().then((res) => { | ||
expect(res.httpResponse.status === 200).toBeTruthy(); | ||
}); | ||
expect(stop).toBeDefined(); | ||
}); | ||
test('Subscription Info', async () => { | ||
const info = await subscription.info({ | ||
return await subscription.info({ | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
}).request().then((res) => { | ||
expect(res.httpResponse.status === 200).toBeTruthy(); | ||
}); | ||
expect(info).toBeDefined(); | ||
}); | ||
test('Delete Subscription Config', async () => { | ||
await subscription | ||
return subscription | ||
.deletePaymentConfig({ | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
}) | ||
|
@@ -138,17 +137,24 @@ describe('Subscription methods', () => { | |
}); | ||
}); | ||
test('Subscription Pause', async () => { | ||
const pause = await subscription.pause({ | ||
return subscription.pause({ | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
resumeDate: '2030-01-01', | ||
}); | ||
expect(pause).toBeDefined(); | ||
}).request().then((res) => { | ||
expect(res.httpResponse.status === 200).toBeTruthy(); | ||
}) | ||
}); | ||
test('Subscription Resume', async () => { | ||
const resume = await subscription.resume({ | ||
return subscription.resume({ | ||
resumeDate: '2030-01-01', | ||
subscriptionGuid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
}).request().then((res) => { | ||
expect(res.httpResponse.status === 200).toBeTruthy(); | ||
}); | ||
}); | ||
test('Get All Active Subscriptions', async () => { | ||
return subscription.getActiveSubscriptions().request().then((res) => { | ||
expect(res.httpResponse.status === 200).toBeTruthy(); | ||
}); | ||
expect(resume).toBeDefined(); | ||
}); | ||
}); |