Skip to content

Commit

Permalink
Merge pull request #763 from inplayer-org/feature/sepa-address
Browse files Browse the repository at this point in the history
Added an additional address param used for specific countries
  • Loading branch information
vkochovski authored Aug 17, 2022
2 parents cd2230d + 003f963 commit ca91a39
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

# [3.13.1] - 16-08-2022

### Added

- Added `address` param in direct debit payments method which is needed for specific coutries

# [3.13.0] - 26-06-2022

### Added
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ export interface DefaultCreditCardData {
export interface DirectDebitMandateData {
name: string;
iban: string;
address?: string;
}

export interface DirectDebitChargeData {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inplayer-org/inplayer.js",
"version": "3.13.0",
"version": "3.13.1",
"author": "InPlayer",
"license": "MIT",
"description": "A Javascript SDK for Inplayer's RESTful API",
Expand Down
4 changes: 4 additions & 0 deletions src/endpoints/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ class Payment extends BaseExtend {
* @async
* @param {string} name The customer's bank full name
* @param {string} iban The customer's bank IBAN number
* @param {string} address The customer's address used for specific countries
* @example
* InPlayer.Payment
* .createDirectDebitMandate({
Expand Down Expand Up @@ -673,13 +674,16 @@ class Payment extends BaseExtend {
async createDirectDebitMandate({
name,
iban,
address,
}: {
name: string;
iban: string;
address?: string;
}): Promise<AxiosResponse<CreateDirectDebitResponse>> {
const body = {
name,
iban,
...(address && { address }),
};

const tokenObject = await this.request.getToken();
Expand Down
2 changes: 2 additions & 0 deletions src/models/IPayment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export interface ConfirmDonationPaymentRequestBody {
export interface CreateDirectDebitMandateData {
name: string;
iban: string;
address?: string;
}

export interface DirectDebitData {
Expand Down Expand Up @@ -193,6 +194,7 @@ export interface CreateDirectDebitResponse {
export interface DirectDebitMandateData {
name: string;
iban: string;
address?: string;
}

export interface PurchaseDetails {
Expand Down

0 comments on commit ca91a39

Please sign in to comment.