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

@paypal/checkout-components

Package Overview
Dependencies
Maintainers
23
Versions
507
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paypal/checkout-components - npm Package Compare versions

Comparing version 5.0.295-alpha.0 to 5.0.295-alpha.11

2

package.json
{
"name": "@paypal/checkout-components",
"version": "5.0.295-alpha.0",
"version": "5.0.295-alpha.11",
"description": "PayPal Checkout components, for integrating checkout products.",

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

@@ -61,13 +61,2 @@ /* @flow */

export const getFundingSource = (paymentSource: string): string => {
let fundingSource = paymentSource;
// The SDK uses "credit" for the "Debit or Credit Card" button, but the
// Hosted Buttons API expects "CARD" for the "Debit or Credit Card" button
// as the `funding_source` property.
if (paymentSource === FUNDING.CREDIT) {
fundingSource = FUNDING.CARD;
}
return fundingSource.toUpperCase();
};
export const getHostedButtonDetails: HostedButtonDetailsParams = ({

@@ -137,3 +126,3 @@ hostedButtonId,

entry_point: entryPoint,
funding_source: getFundingSource(data.paymentSource),
funding_source: data.paymentSource.toUpperCase(),
merchant_id: merchantId,

@@ -168,3 +157,3 @@ ...userInputs,

// a checkout via "Debit or Credit Card".
if (data.paymentSource === FUNDING.CREDIT) {
if (data.paymentSource === FUNDING.CARD) {
const url = `${baseUrl}/ncp/payment/${hostedButtonId}/${data.orderID}`;

@@ -171,0 +160,0 @@ if (supportsPopups()) {

@@ -10,3 +10,2 @@ /* @flow */

buildHostedButtonOnApprove,
getFundingSource,
getHostedButtonDetails,

@@ -146,3 +145,3 @@ } from "./utils";

supportsPopups.mockImplementation(() => true);
await onApprove({ orderID, paymentSource: "credit" });
await onApprove({ orderID, paymentSource: "card" });
expect(popup).toHaveBeenCalled();

@@ -153,3 +152,3 @@

supportsPopups.mockImplementation(() => false);
await onApprove({ orderID, paymentSource: "credit" });
await onApprove({ orderID, paymentSource: "card" });
expect(window.location).toMatch(

@@ -162,6 +161,1 @@ `/ncp/payment/${hostedButtonId}/${orderID}`

});
test("getFundingSource", () => {
expect(getFundingSource("paypal")).toEqual("PAYPAL");
expect(getFundingSource("credit")).toEqual("CARD");
});

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

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