@paypal/checkout-components
Advanced tools
Comparing version 4.1.43 to 4.1.44
{ | ||
"name": "@paypal/checkout-components", | ||
"version": "4.1.43", | ||
"version": "4.1.44", | ||
"description": "PayPal Checkout components, for integrating checkout products.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -191,2 +191,33 @@ /* @flow */ | ||
createBillingAgreement: { | ||
type: 'function', | ||
required: false, | ||
validate: ({ props }) => { | ||
if (props.createOrder) { | ||
throw new Error(`Do not pass both createOrder and createBillingAgreement`); | ||
} | ||
}, | ||
decorate({ value }) : Function { | ||
return function decoratedCreateBillingAgreement() : ZalgoPromise<string> { | ||
return ZalgoPromise.try(() => { | ||
// $FlowFixMe | ||
return value(); | ||
}).then(billingToken => { | ||
const logger = getLogger(); | ||
if (!billingToken || typeof billingToken !== 'string') { | ||
logger.error(`no_billing_token_passed_to_createbillingagreement`); | ||
throw new Error(`Expected a promise for a string billing token to be passed to createBillingAgreement`); | ||
} | ||
logger.flush(); | ||
return billingToken; | ||
}); | ||
}; | ||
} | ||
}, | ||
onApprove: { | ||
@@ -193,0 +224,0 @@ type: 'function', |
@@ -35,2 +35,4 @@ /* @flow */ | ||
export type CreateBillingAgreement = () => ZalgoPromise<string> | string; | ||
export type OnApproveActions = {| | ||
@@ -115,2 +117,3 @@ redirect : (string, CrossDomainWindowType) => ZalgoPromise<void>, | ||
createOrder : CreateOrder, | ||
createBillingAgreement : CreateBillingAgreement, | ||
oncancel : OnCancel, | ||
@@ -117,0 +120,0 @@ onApprove : OnApprove, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
3785
1
419252
100