Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

paypal-isomorphic-functions

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paypal-isomorphic-functions - npm Package Compare versions

Comparing version 1.0.21 to 1.0.22

17

dist/payments/constants.d.ts

@@ -97,1 +97,18 @@ export declare const DEFAULT_PAYMENT_CREATE_PAYLOAD: {

})[];
export declare const DEFAULT_REFERENCE_TRANSACTION_PAYLOAD: {
intent: string;
payer: {
payment_method: string;
funding_instruments: {
billing: {
billing_agreement_id: string;
};
}[];
};
transactions: {
amount: {
currency: string;
total: string;
};
}[];
};

@@ -106,2 +106,23 @@ "use strict";

];
exports.DEFAULT_REFERENCE_TRANSACTION_PAYLOAD = {
intent: "sale",
payer: {
payment_method: "PAYPAL",
funding_instruments: [
{
billing: {
billing_agreement_id: "B-50V812176H0783741"
}
}
]
},
transactions: [
{
amount: {
currency: "USD",
total: "1.00"
}
}
]
};
//# sourceMappingURL=constants.js.map

1

dist/payments/v1/index.d.ts

@@ -5,1 +5,2 @@ import { IPayPalAccessToken } from "../../oauth/interfaces";

export declare function update(token: IPayPalAccessToken, id: string, data?: any, headers?: any): Promise<Response>;
export declare function referenceTransaction(token: IPayPalAccessToken, billingAgreementId: string, data?: any, headers?: any): Promise<Response>;

@@ -53,2 +53,19 @@ "use strict";

exports.update = update;
async function referenceTransaction(token, billingAgreementId, data, headers) {
const payload = data && Object.keys(data).length > 0
? data
: constants_1.DEFAULT_REFERENCE_TRANSACTION_PAYLOAD;
payload.transactions[0].funding_instruments[0].billing.billing_agreement_id = billingAgreementId;
const options = {
method: "POST",
headers: {
Authorization: `Bearer ${token.access_token}`,
"Content-Type": "application/json",
...headers
},
body: JSON.stringify(payload)
};
return await fetch(`${config_1.CONFIG.get("PAYPAL_REST_HOSTNAME")}/v1/payments/payment`, options);
}
exports.referenceTransaction = referenceTransaction;
//# sourceMappingURL=index.js.map

2

package.json
{
"name": "paypal-isomorphic-functions",
"version": "1.0.21",
"version": "1.0.22",
"description": "Library of helpful paypal functions that can be run in a browser or server",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -106,1 +106,23 @@ export const DEFAULT_PAYMENT_CREATE_PAYLOAD = {

];
export const DEFAULT_REFERENCE_TRANSACTION_PAYLOAD = {
intent: "sale",
payer: {
payment_method: "PAYPAL",
funding_instruments: [
{
billing: {
billing_agreement_id: "B-50V812176H0783741"
}
}
]
},
transactions: [
{
amount: {
currency: "USD",
total: "1.00"
}
}
]
};

@@ -6,3 +6,4 @@ import { IPayPalAccessToken } from "../../oauth/interfaces";

DEFAULT_PAYMENT_CAPTURE_PAYLOAD,
DEFAULT_PAYMENT_UPDATE_PAYLOAD
DEFAULT_PAYMENT_UPDATE_PAYLOAD,
DEFAULT_REFERENCE_TRANSACTION_PAYLOAD
} from "../constants";

@@ -88,1 +89,29 @@

}
export async function referenceTransaction(
token: IPayPalAccessToken,
billingAgreementId: string,
data?: any,
headers?: any
) {
const payload =
data && Object.keys(data).length > 0
? data
: DEFAULT_REFERENCE_TRANSACTION_PAYLOAD;
payload.transactions[0].funding_instruments[0].billing.billing_agreement_id = billingAgreementId;
const options = {
method: "POST",
headers: {
Authorization: `Bearer ${token.access_token}`,
"Content-Type": "application/json",
...headers
},
body: JSON.stringify(payload)
};
return await fetch(
`${CONFIG.get("PAYPAL_REST_HOSTNAME")}/v1/payments/payment`,
options
);
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc