Skip to content

Commit

Permalink
Merge pull request #17 from buckaroo-it/BP-2554-add-sepa-direct-debit…
Browse files Browse the repository at this point in the history
…-b-2-b

Bp 2554 add sepa direct debit b 2 b
  • Loading branch information
Rinor12010 authored Jul 11, 2023
2 parents 5ed4540 + 6ae4a7d commit 1b83e3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 22 deletions.
13 changes: 3 additions & 10 deletions src/PaymentMethods/Ideal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,13 @@ import { IPay } from './Models/Pay'
import { PayablePaymentMethod } from '../PayablePaymentMethod'
import { RefundPayload } from '../../Models/ITransaction'

const enum IdealServiceCodes {
ideal = 'ideal',
idealProcessing = 'idealprocessing'
}
export default class Ideal extends PayablePaymentMethod {
protected _paymentName = 'ideal'
protected _serviceVersion = 2
constructor(type?: keyof typeof IdealServiceCodes) {
constructor(type?:'processing') {
super();

switch (type) {
case 'idealProcessing':
this._paymentName = IdealServiceCodes.idealProcessing
break;
if(type){
this._paymentName = 'idealprocessing'
}
}
pay(payload: IPay) {
Expand Down
15 changes: 4 additions & 11 deletions src/PaymentMethods/SEPA/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@ import { IExtraInfo } from './Models/ExtraInfo'
import { IEmandate } from './Models/Emandate'
import { uniqid } from '../../Utils/Functions'

const enum SepaServiceCodes {
sepaDirectDebit = 'sepadirectdebit',
sepaDirectDebitB2B = 'sepadirectdebitb2b'
}
export default class SEPA extends PayablePaymentMethod {

protected _paymentName = SepaServiceCodes.sepaDirectDebit
protected _paymentName = 'sepadirectdebit'
protected _serviceVersion = 1

constructor(type?:keyof typeof SepaServiceCodes) {
constructor(type?:'B2B') {
super();

switch (type) {
case 'sepaDirectDebitB2B':
this._paymentName = SepaServiceCodes.sepaDirectDebitB2B
break;
if(type){
this._paymentName = 'sepadirectdebitb2b'
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/PaymentMethods/SEPAB2B.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require('../BuckarooClient.test')
import SEPA from '../../src/PaymentMethods/SEPA'

const sepab2b = new SEPA('sepaDirectDebitB2B')
const sepab2b = new SEPA('B2B')
describe('SEPA', () => {
test('Pay', async () => {
await sepab2b
Expand Down

0 comments on commit 1b83e3a

Please sign in to comment.