Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Iulian Masar committed Dec 22, 2023
1 parent 7bd216e commit 6465e03
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 18 deletions.
6 changes: 1 addition & 5 deletions lib/models/PayIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ var PayIn = Transaction.extend({
/**
* One of PayInExecutionDetails implementations, depending on ExecutionType
*/
ExecutionDetails: null,
/**
* Information about the card
*/
CardInfo: null
ExecutionDetails: null
}),

getReadOnlyProperties: function() {
Expand Down
3 changes: 2 additions & 1 deletion lib/models/PayInPaymentDetailsCardDirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ var PayInPaymentDetailsCardDirect = PayInPaymentDetailsCard.extend({
CardId: null,
IpAddress: null,
Shipping: null,
BrowserInfo: null
BrowserInfo: null,
CardInfo: null
})
});

Expand Down
3 changes: 2 additions & 1 deletion test/services/CardPreAuthorizations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var expect = require('chai').expect;

var api = require('../main');
var helpers = require('../helpers');

describe('Card PreAuthorizations', function() {
Expand Down Expand Up @@ -27,6 +27,7 @@ describe('Card PreAuthorizations', function() {
expect(preAuthorization.ExecutionType).to.equal('DIRECT');
expect(preAuthorization.PayInId).to.be.null;
expect(preAuthorization.RemainingFunds).to.exist;
expect(preAuthorization.CardInfo).to.not.be.null;
});
});

Expand Down
5 changes: 3 additions & 2 deletions test/services/PayIns.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ describe('PayIns', function () {
expect(payIn.AuthorId).to.equal(john.Id);
expect(payIn.Status).to.equal('SUCCEEDED');
expect(payIn.Type).to.equal('PAYIN');
expect(payIn.SecurityInfo.AVSResult).to.equal('NO_CHECK')
expect(payIn.SecurityInfo.AVSResult).to.equal('NO_CHECK');
expect(payIn.CardInfo).not.to.be.undefined;
});
});

Expand Down Expand Up @@ -728,7 +729,7 @@ describe('PayIns', function () {
})
})

describe('Create a Recurring Payment Check Card Data', function() {
describe('Create a Recurring Payment Check Card Info', function() {
var recurring;
before(function(done){
recurringPayin = {
Expand Down
27 changes: 25 additions & 2 deletions typings/models/card.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {CountryISO, CurrencyISO} from "../types";
import {entityBase} from "./entityBase";
import { CountryISO, CurrencyISO } from "../types";
import { entityBase } from "./entityBase";

export namespace card {
type CardType = "CB_VISA_MASTERCARD" | "DINERS" | "MASTERPASS" | "MAESTRO" | "P24" | "IDEAL" | "BCMC" | "PAYLIB";
Expand Down Expand Up @@ -74,11 +74,34 @@ export namespace card {
}

interface CardInfoData {
/**
* The 6-digit bank identification number (BIN) of the card issuer.
*/
BIN: string;

/**
* The name of the card issuer.
*/
IssuingBank: string;

/**
* The country where the card was issued.
*/
IssuerCountryCode: CountryISO;

/**
* The type of card product: DEBIT, CREDIT, CHARGE CARD.
*/
Type: CardInfoType;

/**
* The card brand. Examples include: AMERICAN EXPRESS, DISCOVER, JCB, MASTERCARD, VISA, etc.
*/
Brand: string;

/**
* The subtype of the card product. Examples include: CLASSIC, GOLD, PLATINUM, PREPAID, etc.
*/
SubType: string;
}
}
2 changes: 1 addition & 1 deletion typings/models/cardPreauthorization.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { base } from "../base";
import { money } from "./money";
import { securityInfo } from "./securityInfo";
import { shipping } from "./shipping";
import { card } from "mangopay2-nodejs-sdk";
import { card } from "./card";

export namespace cardPreAuthorization {
import BillingData = billing.BillingData;
Expand Down
2 changes: 1 addition & 1 deletion typings/models/deposit.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { payIn } from "./payIn";
import { base } from "../base";
import { billing } from "./billing";
import { shipping } from "./shipping";
import { card } from "mangopay2-nodejs-sdk";
import { card } from "./card";

export namespace deposit {
import MoneyData = money.MoneyData;
Expand Down
15 changes: 10 additions & 5 deletions typings/models/payIn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,6 @@ export namespace payIn {
* The type of execution for the payin
*/
ExecutionType: PayInExecutionType;

/**
* Information about the card
*/
CardInfo: CardInfoData;
}

interface CardWebPayInData extends BasePayInData {
Expand Down Expand Up @@ -306,6 +301,11 @@ export namespace payIn {
* This is the URL where to redirect users to proceed to 3D secure validation
*/
SecureModeRedirectURL: string;

/**
* Information about the card
*/
CardInfo: CardInfoData;
}

interface MbwayWebPayInData extends BasePayInData {
Expand Down Expand Up @@ -1265,6 +1265,11 @@ export namespace payIn {
Applied3DSVersion: _3DSVersion;

RecurringPayinRegistrationId: string;

/**
* Information about the card
*/
CardInfo: CardInfoData;
}

interface CreateRecurringPayInCIT {
Expand Down

0 comments on commit 6465e03

Please sign in to comment.