Skip to content

Commit

Permalink
added PayPal shippingPreference param
Browse files Browse the repository at this point in the history
  • Loading branch information
Iulian Masar committed Sep 12, 2023
1 parent 26678eb commit 751f314
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/models/PayInPaymentDetailsPayPal.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ var PayInPaymentDetailsPayPal = PayInPaymentDetails.extend({
/**
* Information about the items bought by the customer
*/
LineItems: null
LineItems: null,

ShippingPreference: null
}
});

Expand Down
5 changes: 5 additions & 0 deletions lib/models/ShippingPreference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
SetProvidedAddress: 'SET_PROVIDED_ADDRESS',
GetFromFile: 'GET_FROM_FILE',
NoShipping: 'NO_SHIPPING'
};
1 change: 1 addition & 0 deletions test/helpers.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/services/PayIns.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ describe('PayIns', function () {
});
});

describe('PayPal Web', function () {
describe('PayPal Web V2', function () {
var payIn;

before(function (done) {
Expand Down
6 changes: 6 additions & 0 deletions typings/enums.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,10 @@ export namespace enums {
Waiting: "WAITING";
Canceled: "CANCELED";
}

interface IShippingPreference {
SetProvidedAddress: "SET_PROVIDED_ADDRESS";
GetFromFile: "GET_FROM_FILE";
NoShipping: "NO_SHIPPING";
}
}
1 change: 1 addition & 0 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ declare namespace MangoPay {
const UserNaturalCapacity: enums.IUserNaturalCapacity;
const DepositStatus: enums.IDepositStatus;
const PaymentStatus: enums.IPaymentStatus;
const ShippingPreference: enums.IShippingPreference;

interface ModelMethods<T extends {}> {
initialize(): void;
Expand Down
6 changes: 6 additions & 0 deletions typings/models/payIn.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export namespace payIn {

type UpdateRecurringPaymentStatus = "ENDED";

type ShippingPreference = ValueOf<enums.IShippingPreference>;

interface TemplateURLOptions {
Payline: string;

Expand Down Expand Up @@ -348,6 +350,8 @@ export namespace payIn {
* The language in which the PayPal payment page is to be displayed.
*/
Culture: CountryISO;

ShippingPreference: ShippingPreference;
}

interface MultibancoWebPayInData extends BasePayInData {
Expand Down Expand Up @@ -572,6 +576,8 @@ export namespace payIn {
* The language in which the PayPal payment page is to be displayed.
*/
Culture?: CountryISO;

ShippingPreference?: ShippingPreference;
}

interface CreateMultibancoWebPayIn {
Expand Down

0 comments on commit 751f314

Please sign in to comment.