Skip to content

Commit

Permalink
Merge pull request #72 from buckaroo-it/BA-572-add-shipping-costs-par…
Browse files Browse the repository at this point in the history
…ameter-to-ideal

BA-572 Add shippingCosts parameter to Ideal
  • Loading branch information
DjellzeBllaca authored Oct 23, 2024
2 parents 4bc789c + ffb1337 commit 804a870
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/transaction/ideal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const ideal = buckarooClient.method('ideal');
ideal
.pay({
amountDebit: 10.1,
shippingCosts: 0.01,
issuer: 'ABNANL2A',
description: 'Ideal Payment'
})
Expand All @@ -21,6 +22,7 @@ ideal
.payFastCheckout({
currency: 'EUR',
amountDebit: 10.1,
shippingCosts: 0.01,
invoice: 'Ideal Pay Fast Checkout',
})
//Issuers
Expand Down
2 changes: 2 additions & 0 deletions example/transaction/ideal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const ideal = buckarooClient.method('ideal');
ideal
.pay({
amountDebit: 10.1,
shippingCosts: 0.01,
issuer: 'ABNANL2A',
description: 'Ideal Payment',
})
Expand All @@ -22,6 +23,7 @@ ideal
ideal.payFastCheckout({
currency: 'EUR',
amountDebit: 10.1,
shippingCosts: 0.01,
invoice: 'Ideal Pay Fast Checkout',
});

Expand Down
5 changes: 5 additions & 0 deletions src/PaymentMethods/Ideal/Models/Pay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ import { IPaymentRequest, ServiceParameter } from '../../../Models';

export interface IPay extends IPaymentRequest {
issuer?: string;
shippingCosts?: number;
}

export class Pay extends ServiceParameter {
set issuer(value: string) {
this.set('issuer', value);
}

set shippingCosts(value: number) {
this.set('shippingCosts', value);
}
}
2 changes: 2 additions & 0 deletions tests/PaymentMethods/Ideal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('testing Ideal methods', () => {
return ideal
.pay({
amountDebit: 100,
shippingCosts: 0.01,
issuer: 'ABNANL2A',
continueOnIncomplete: false,
additionalParameters: {
Expand Down Expand Up @@ -60,6 +61,7 @@ describe('testing Ideal methods', () => {
invoice: uniqid(),
currency: 'EUR',
amountDebit: 0.01,
shippingCosts: 0.01,
})
.request()
.then((data) => {
Expand Down

0 comments on commit 804a870

Please sign in to comment.