You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/hosted-fields/index.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,7 @@ var VERSION = process.env.npm_package_version;
132
132
* @param {styleOptions} [options.styles] {@link module:braintree-web/hosted-fields~styleOptions Styles} applied to each field.
133
133
* @param {boolean} [options.preventAutofill=false] When true, browsers will not try to prompt the customer to autofill their credit card information.
134
134
* @param {callback} [callback] The second argument, `data`, is the {@link HostedFields} instance. If no callback is provided, `create` returns a promise that resolves with the {@link HostedFields} instance.
135
+
* @param {string} [options.sessionId] Used in specific cases where associating SDK events with a specific external id is required.
@@ -364,6 +365,36 @@ PayPalCheckout.prototype._setupFrameService = function (client) {
364
365
* @property {string} amount.value The amount the shipping option will cost. Includes the specified number of digits after decimal separator for the ISO-4217 currency code.
* @property {string} pricingModel The pricing model. Options are `FIXED`, `VARIABLE`, or `AUTO_RELOAD`.
370
+
* @property {string} price The price for the billing cycle.
371
+
* @property {string} reloadThresholdAmount The amount at which to reload on auto_reload plans.
372
+
*/
373
+
374
+
/**
375
+
* @typedef {Object} PayPalCheckout~billingCycles
376
+
* @property {(string|number)} billingFrequency The frequency of billing.
377
+
* @property {string} billingFrequencyUnit The unit of billing frequency. Options are `DAY`, `WEEK`, `MONTH`, or `YEAR`.
378
+
* @property {(string|number)} numberOfExecutions The number of executions for the billing cycle.
379
+
* @property {(string|number)} sequence The order in the upcoming billing cycles.
380
+
* @property {string} startDate The start date in ISO 8601 format (`2024-04-06T00:00:00Z`). If populated and the intent is to charge the buyer for the billing cycle at the checkout, it should be populated as current time in ISO 8601 format.
381
+
* @property {boolean} trial Indicates if the billing cycle is a trial.
382
+
* @property {pricingScheme} pricingScheme The {@link PayPalCheckout~pricingScheme|pricing scheme object} for this billing cycle.
383
+
*/
384
+
385
+
/**
386
+
* @typedef {Object} PayPalCheckout~planMetadata
387
+
* @property {billingCycles[]} [billingCycles] An array of {@link PayPalCheckout~billingCycles|billing cyles} for this plan.
388
+
* @property {string} currencyIsoCode The ISO code for the currency, for example `USD`.
389
+
* @property {string} name The name of the plan.
390
+
* @property {string} productDescription A description of the product. (Accepts only one element)
391
+
* @property {(string|number)} productQuantity The quantity of the product. (Accepts only one element)
392
+
* @property {(string|number)} oneTimeFeeAmount The one-time fee amount.
393
+
* @property {(string|number)} shippingAmount The amount for shipping.
394
+
* @property {(string|number)} productPrice The price of the product.
395
+
* @property {(string|number)} taxAmount The amount of tax.
396
+
*/
397
+
367
398
/**
368
399
* Creates a PayPal payment ID or billing token using the given options. This is meant to be passed to the PayPal JS SDK.
369
400
* When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.
@@ -400,6 +431,10 @@ PayPalCheckout.prototype._setupFrameService = function (client) {
400
431
* * `login` - A PayPal account login page is used.
401
432
* * `billing` - A non-PayPal account landing page is used.
402
433
* @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.
434
+
*
435
+
* @param {string} [options.planType] Determines the charge pattern for the Recurring Billing Agreement. Can be 'RECURRING', 'SUBSCRIPTION', 'UNSCHEDULED', or 'INSTALLMENTS'.
436
+
* @param {planMetadata} [options.planMetadata] When plan type is defined, allows for {@link PayPalCheckout~planMetadata|plan metadata} to be set for the Billing Agreement.
437
+
*
403
438
* @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.
404
439
* @example
405
440
* // this paypal object is created by the PayPal JS SDK
@@ -479,9 +514,65 @@ PayPalCheckout.prototype._setupFrameService = function (client) {
479
514
* }).catch(function (err) {
480
515
* console.error('Error!', err);
481
516
* });
517
+
*
482
518
* ```
483
519
*
484
-
* @returns {(Promise|void)} Returns a promise if no callback is provided.
520
+
* @example <caption>use the new plan features</caption>
521
+
* // Plan and plan metadata are passed to createPayment
0 commit comments