@alphawebai/hs-prism 0.1.0-rc.44 → 0.1.0-rc.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/alphaweb/manifest.d.ts +1 -1
- package/dist/src/alphaweb/manifest.js +1 -1
- package/dist/src/alphaweb/paypal-connector.js +128 -25
- package/dist/src/alphaweb/types.d.ts +24 -1
- package/dist/src/payments/generated/libconnector_service_ffi.so +2 -2
- package/dist/src/payments/generated/proto.d.ts +169 -0
- package/dist/src/payments/generated/proto.js +430 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const ALPHAWEB_STRIPE_WEBHOOK_EVENTS: readonly ["charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "refund.created", "refund.failed", "refund.updated", "setup_intent.canceled", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded"];
|
|
2
2
|
export declare const ALPHAWEB_PAYPAL_WEBHOOK_EVENTS: readonly ["CHECKOUT.ORDER.APPROVED", "CHECKOUT.ORDER.COMPLETED", "CHECKOUT.ORDER.PROCESSED", "CHECKOUT.PAYMENT-APPROVAL.REVERSED", "CUSTOMER.DISPUTE.CREATED", "CUSTOMER.DISPUTE.RESOLVED", "CUSTOMER.DISPUTE.UPDATED", "PAYMENT.AUTHORIZATION.CREATED", "PAYMENT.AUTHORIZATION.VOIDED", "PAYMENT.CAPTURE.COMPLETED", "PAYMENT.CAPTURE.DECLINED", "PAYMENT.CAPTURE.PENDING", "PAYMENT.CAPTURE.REFUNDED", "PAYMENT.CAPTURE.REVERSED", "PAYMENT.REFUND.FAILED", "PAYMENT.REFUND.PENDING", "RISK.DISPUTE.CREATED", "VAULT.PAYMENT-TOKEN.CREATED", "VAULT.PAYMENT-TOKEN.DELETED", "VAULT.PAYMENT-TOKEN.DELETION-INITIATED"];
|
|
3
3
|
export declare const ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST: Readonly<{
|
|
4
|
-
readonly release: "0.1.0-rc.
|
|
4
|
+
readonly release: "0.1.0-rc.45";
|
|
5
5
|
readonly upstreamCommit: "b07af7d9dac271de729548e74217ddcf895c602b";
|
|
6
6
|
readonly medusaRange: ">=2.17.2 <2.18.0";
|
|
7
7
|
readonly stripeApiVersion: "2026-06-24.dahlia";
|
|
@@ -49,7 +49,7 @@ exports.ALPHAWEB_PAYPAL_WEBHOOK_EVENTS = Object.freeze([
|
|
|
49
49
|
'VAULT.PAYMENT-TOKEN.DELETION-INITIATED',
|
|
50
50
|
]);
|
|
51
51
|
exports.ALPHAWEB_PRISM_COMPATIBILITY_MANIFEST = Object.freeze({
|
|
52
|
-
release: '0.1.0-rc.
|
|
52
|
+
release: '0.1.0-rc.45',
|
|
53
53
|
upstreamCommit: 'b07af7d9dac271de729548e74217ddcf895c602b',
|
|
54
54
|
medusaRange: '>=2.17.2 <2.18.0',
|
|
55
55
|
stripeApiVersion: '2026-06-24.dahlia',
|
|
@@ -134,9 +134,81 @@ function browserContinuation(input) {
|
|
|
134
134
|
}
|
|
135
135
|
return { returnUrl: returnUrl.toString(), cancelUrl: cancelUrl.toString() };
|
|
136
136
|
}
|
|
137
|
+
const PAYPAL_INTERVAL_MAXIMUM = {
|
|
138
|
+
day: 365,
|
|
139
|
+
week: 52,
|
|
140
|
+
month: 12,
|
|
141
|
+
year: 1,
|
|
142
|
+
};
|
|
143
|
+
function assertPayPalAgreementTerms(agreement) {
|
|
144
|
+
const planName = typeof agreement.planName === 'string' ? agreement.planName.trim() : '';
|
|
145
|
+
if (!planName || [...planName].length > 127) {
|
|
146
|
+
throw validationError('PayPal recurring plan name is invalid.', 'PRISM_PAYPAL_RECURRING_PLAN_NAME');
|
|
147
|
+
}
|
|
148
|
+
const maximumIntervalCount = Object.hasOwn(PAYPAL_INTERVAL_MAXIMUM, agreement.intervalUnit)
|
|
149
|
+
? PAYPAL_INTERVAL_MAXIMUM[agreement.intervalUnit]
|
|
150
|
+
: undefined;
|
|
151
|
+
if (maximumIntervalCount === undefined ||
|
|
152
|
+
!Number.isSafeInteger(agreement.intervalCount) ||
|
|
153
|
+
agreement.intervalCount < 1 ||
|
|
154
|
+
agreement.intervalCount > maximumIntervalCount) {
|
|
155
|
+
throw validationError('PayPal recurring interval is outside the supported range.', 'PRISM_PAYPAL_RECURRING_INTERVAL');
|
|
156
|
+
}
|
|
157
|
+
if (agreement.totalPayments !== null &&
|
|
158
|
+
(!Number.isSafeInteger(agreement.totalPayments) ||
|
|
159
|
+
agreement.totalPayments < 2 ||
|
|
160
|
+
agreement.totalPayments > 999)) {
|
|
161
|
+
throw validationError('PayPal finite recurring agreements require between 2 and 999 total payments.', 'PRISM_PAYPAL_RECURRING_TOTAL');
|
|
162
|
+
}
|
|
163
|
+
return planName;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Independent plans never reach PayPal as a billing plan (Orders v2 accepts one
|
|
167
|
+
* billing_plan item), so PayPal's billing-plan cadence limits do not apply to
|
|
168
|
+
* them. They are validated for shape here so the vault-only order still carries
|
|
169
|
+
* the recurring usage pattern that matches the merchant's disclosure.
|
|
170
|
+
*/
|
|
171
|
+
function assertIndependentAgreements(agreements, money) {
|
|
172
|
+
const transactionMoney = (0, money_1.assertSafeProviderMoney)(money);
|
|
173
|
+
if (!Array.isArray(agreements) || agreements.length === 0) {
|
|
174
|
+
throw validationError('Independent recurring agreements cannot be empty.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
175
|
+
}
|
|
176
|
+
const keys = new Set();
|
|
177
|
+
for (const agreement of agreements) {
|
|
178
|
+
const planKey = typeof agreement.planKey === 'string' ? agreement.planKey.trim() : '';
|
|
179
|
+
if (!planKey || keys.has(planKey)) {
|
|
180
|
+
throw validationError('Independent recurring agreements need unique plan keys.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
181
|
+
}
|
|
182
|
+
keys.add(planKey);
|
|
183
|
+
if (!Number.isSafeInteger(agreement.quantity) || agreement.quantity < 1) {
|
|
184
|
+
throw validationError('Independent recurring agreement quantity is invalid.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
185
|
+
}
|
|
186
|
+
const planName = typeof agreement.planName === 'string' ? agreement.planName.trim() : '';
|
|
187
|
+
if (!planName) {
|
|
188
|
+
throw validationError('PayPal recurring plan name is invalid.', 'PRISM_PAYPAL_RECURRING_PLAN_NAME');
|
|
189
|
+
}
|
|
190
|
+
if (!Object.hasOwn(PAYPAL_INTERVAL_MAXIMUM, agreement.intervalUnit) ||
|
|
191
|
+
!Number.isSafeInteger(agreement.intervalCount) ||
|
|
192
|
+
agreement.intervalCount < 1) {
|
|
193
|
+
throw validationError('PayPal recurring interval is invalid.', 'PRISM_PAYPAL_RECURRING_INTERVAL');
|
|
194
|
+
}
|
|
195
|
+
if (agreement.totalPayments !== null &&
|
|
196
|
+
(!Number.isSafeInteger(agreement.totalPayments) || agreement.totalPayments < 1)) {
|
|
197
|
+
throw validationError('PayPal finite recurring agreements require a positive total payment count.', 'PRISM_PAYPAL_RECURRING_TOTAL');
|
|
198
|
+
}
|
|
199
|
+
const recurringMoney = (0, money_1.assertSafeProviderMoney)(agreement.recurringMoney);
|
|
200
|
+
if (recurringMoney.currency !== transactionMoney.currency) {
|
|
201
|
+
throw validationError('PayPal recurring money must use the checkout currency.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
137
205
|
function futureUseMitCategoryFromIntent(futureUse) {
|
|
138
|
-
|
|
139
|
-
|
|
206
|
+
const independent = futureUse?.recurringAgreements;
|
|
207
|
+
if (independent) {
|
|
208
|
+
return independent.length > 0 &&
|
|
209
|
+
independent.every((agreement) => agreement.totalPayments !== null)
|
|
210
|
+
? proto_1.types.MitCategory.INSTALLMENT_MIT
|
|
211
|
+
: proto_1.types.MitCategory.RECURRING_MIT;
|
|
140
212
|
}
|
|
141
213
|
if (futureUse?.recurringAgreement?.totalPayments !== null &&
|
|
142
214
|
futureUse?.recurringAgreement?.totalPayments !== undefined) {
|
|
@@ -162,6 +234,17 @@ function repeatPaymentMitCategory(input) {
|
|
|
162
234
|
function recurringAgreementMessage(input) {
|
|
163
235
|
const wantsSubscription = input.futureUse?.purposes.includes('subscription') ?? false;
|
|
164
236
|
const agreement = input.futureUse?.recurringAgreement;
|
|
237
|
+
const independent = input.futureUse?.recurringAgreements;
|
|
238
|
+
if (independent) {
|
|
239
|
+
if (agreement) {
|
|
240
|
+
throw validationError('Supply either the single PayPal agreement or independent agreements, not both.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
241
|
+
}
|
|
242
|
+
if (!wantsSubscription) {
|
|
243
|
+
throw validationError('Independent recurring agreements require subscription future use.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
244
|
+
}
|
|
245
|
+
assertIndependentAgreements(independent, input.money);
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
165
248
|
if (!wantsSubscription && agreement) {
|
|
166
249
|
throw validationError('A recurring agreement requires subscription future use.', 'PRISM_PAYPAL_RECURRING_AGREEMENT');
|
|
167
250
|
}
|
|
@@ -172,43 +255,63 @@ function recurringAgreementMessage(input) {
|
|
|
172
255
|
return undefined;
|
|
173
256
|
const transactionMoney = (0, money_1.assertSafeProviderMoney)(input.money);
|
|
174
257
|
const recurringMoney = (0, money_1.assertSafeProviderMoney)(agreement.recurringMoney);
|
|
175
|
-
if (transactionMoney.
|
|
176
|
-
transactionMoney.
|
|
258
|
+
if (transactionMoney.currency !== recurringMoney.currency ||
|
|
259
|
+
(!agreement.initialPayment && transactionMoney.amountMinor !== recurringMoney.amountMinor)) {
|
|
177
260
|
throw validationError('PayPal recurring money must match the first checkout payment.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
178
261
|
}
|
|
179
|
-
const planName = agreement
|
|
180
|
-
if (!planName || [...planName].length > 127) {
|
|
181
|
-
throw validationError('PayPal recurring plan name is invalid.', 'PRISM_PAYPAL_RECURRING_PLAN_NAME');
|
|
182
|
-
}
|
|
183
|
-
const maximumIntervalCount = {
|
|
184
|
-
day: 365,
|
|
185
|
-
week: 52,
|
|
186
|
-
month: 12,
|
|
187
|
-
year: 1,
|
|
188
|
-
}[agreement.intervalUnit];
|
|
189
|
-
if (!Number.isSafeInteger(agreement.intervalCount) ||
|
|
190
|
-
agreement.intervalCount < 1 ||
|
|
191
|
-
agreement.intervalCount > maximumIntervalCount) {
|
|
192
|
-
throw validationError('PayPal recurring interval is outside the supported range.', 'PRISM_PAYPAL_RECURRING_INTERVAL');
|
|
193
|
-
}
|
|
194
|
-
if (agreement.totalPayments !== null &&
|
|
195
|
-
(!Number.isSafeInteger(agreement.totalPayments) ||
|
|
196
|
-
agreement.totalPayments < 2 ||
|
|
197
|
-
agreement.totalPayments > 999)) {
|
|
198
|
-
throw validationError('PayPal finite recurring agreements require between 2 and 999 total payments.', 'PRISM_PAYPAL_RECURRING_TOTAL');
|
|
199
|
-
}
|
|
262
|
+
const planName = assertPayPalAgreementTerms(agreement);
|
|
200
263
|
const intervalUnit = {
|
|
201
264
|
day: proto_1.types.RecurringPaymentIntervalUnit.DAY,
|
|
202
265
|
week: proto_1.types.RecurringPaymentIntervalUnit.WEEK,
|
|
203
266
|
month: proto_1.types.RecurringPaymentIntervalUnit.MONTH,
|
|
204
267
|
year: proto_1.types.RecurringPaymentIntervalUnit.YEAR,
|
|
205
268
|
}[agreement.intervalUnit];
|
|
269
|
+
const initial = agreement.initialPayment;
|
|
270
|
+
let initialPayment;
|
|
271
|
+
if (initial) {
|
|
272
|
+
const minor = (value) => {
|
|
273
|
+
if (typeof value !== 'string' || !/^(0|[1-9][0-9]*)$/.test(value) || BigInt(value) > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
274
|
+
throw validationError('PayPal initial payment amounts are invalid.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
275
|
+
}
|
|
276
|
+
return BigInt(value);
|
|
277
|
+
};
|
|
278
|
+
const plan = minor(initial.amountMinor);
|
|
279
|
+
const shipping = minor(initial.shippingAmountMinor);
|
|
280
|
+
const tax = minor(initial.taxAmountMinor);
|
|
281
|
+
const products = initial.oneTimeProducts ?? [];
|
|
282
|
+
let productTotal = 0n;
|
|
283
|
+
const oneTimeProducts = [];
|
|
284
|
+
if (!Array.isArray(products)) {
|
|
285
|
+
throw validationError('PayPal initial payment products are invalid.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
286
|
+
}
|
|
287
|
+
for (const product of products) {
|
|
288
|
+
const name = typeof product?.name === 'string' ? product.name.trim() : '';
|
|
289
|
+
const amount = minor(product?.amountMinor);
|
|
290
|
+
if (!name || [...name].length > 127 || amount <= 0n || typeof product.requiresShipping !== 'boolean') {
|
|
291
|
+
throw validationError('PayPal initial payment products are invalid.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
292
|
+
}
|
|
293
|
+
productTotal += amount;
|
|
294
|
+
oneTimeProducts.push({ name, amountMinor: Number(amount), requiresShipping: product.requiresShipping });
|
|
295
|
+
}
|
|
296
|
+
if (plan + shipping + tax + productTotal !== BigInt(input.money.amountMinor) ||
|
|
297
|
+
!/^\d{4}-\d{2}-\d{2}$/.test(initial.nextBillingDate) ||
|
|
298
|
+
!Number.isFinite(Date.parse(initial.nextBillingDate)) ||
|
|
299
|
+
new Date(initial.nextBillingDate).toISOString().slice(0, 10) !== initial.nextBillingDate) {
|
|
300
|
+
throw validationError('PayPal initial payment allocation is invalid.', 'PRISM_PAYPAL_RECURRING_MONEY');
|
|
301
|
+
}
|
|
302
|
+
initialPayment = {
|
|
303
|
+
amountMinor: Number(plan), shippingAmountMinor: Number(shipping), taxAmountMinor: Number(tax),
|
|
304
|
+
oneTimeProducts,
|
|
305
|
+
nextBillingDate: initial.nextBillingDate,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
206
308
|
return {
|
|
207
309
|
planName,
|
|
208
310
|
recurringAmount: moneyMessage(agreement.recurringMoney),
|
|
209
311
|
intervalUnit,
|
|
210
312
|
intervalCount: agreement.intervalCount,
|
|
211
313
|
...(agreement.totalPayments === null ? {} : { totalPayments: agreement.totalPayments }),
|
|
314
|
+
...(initialPayment ? { initialPayment } : {}),
|
|
212
315
|
};
|
|
213
316
|
}
|
|
214
317
|
function paymentStatus(status) {
|
|
@@ -21,11 +21,34 @@ export interface PrismRecurringAgreement {
|
|
|
21
21
|
/** Total payments including the first checkout payment; null means until canceled. */
|
|
22
22
|
totalPayments: number | null;
|
|
23
23
|
recurringMoney: PrismMoney;
|
|
24
|
+
/** Initial checkout allocation; omitted for the existing equal-price single-plan flow. */
|
|
25
|
+
initialPayment?: {
|
|
26
|
+
/** This plan's initial item amount, excluding the separately disclosed shipping and tax. */
|
|
27
|
+
amountMinor: string;
|
|
28
|
+
shippingAmountMinor: string;
|
|
29
|
+
taxAmountMinor: string;
|
|
30
|
+
/**
|
|
31
|
+
* Every product or native bundle line paid today alongside the plan, each with
|
|
32
|
+
* its own net amount. Omit zero-priced lines; PayPal has no free-item representation.
|
|
33
|
+
*/
|
|
34
|
+
oneTimeProducts?: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
amountMinor: string;
|
|
37
|
+
requiresShipping: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
/** First regular renewal after an introductory period, as YYYY-MM-DD. */
|
|
40
|
+
nextBillingDate: string;
|
|
41
|
+
};
|
|
24
42
|
}
|
|
25
43
|
export interface PrismFutureUseIntent {
|
|
26
44
|
purposes: [PrismFutureUsePurpose, ...PrismFutureUsePurpose[]];
|
|
27
45
|
recurringAgreement?: PrismRecurringAgreement;
|
|
28
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Independent merchant-managed plans, mutually exclusive with the legacy single
|
|
48
|
+
* agreement. Stripe saves the method for every plan. PayPal vaults the wallet for
|
|
49
|
+
* merchant-initiated renewals without a PayPal-side billing plan, because Orders v2
|
|
50
|
+
* carries at most one billing_plan item; the merchant checkout discloses each plan.
|
|
51
|
+
*/
|
|
29
52
|
recurringAgreements?: Array<PrismRecurringAgreement & {
|
|
30
53
|
planKey: string;
|
|
31
54
|
quantity: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/dist/src/payments/generated/libconnector_service_ffi.so
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 105627896 bytes
|
|
4
|
+
sha256: 338db46bdefabbbfe0a0bad89f21961c800ddb7d2dca338005861f4c6a8c49d0
|
|
@@ -12034,6 +12034,9 @@ export namespace types {
|
|
|
12034
12034
|
* agreement continues until canceled.
|
|
12035
12035
|
*/
|
|
12036
12036
|
totalPayments?: (number|null);
|
|
12037
|
+
|
|
12038
|
+
/** RecurringAgreement initialPayment */
|
|
12039
|
+
initialPayment?: (types.IRecurringInitialPayment|null);
|
|
12037
12040
|
}
|
|
12038
12041
|
|
|
12039
12042
|
/**
|
|
@@ -12067,6 +12070,9 @@ export namespace types {
|
|
|
12067
12070
|
*/
|
|
12068
12071
|
public totalPayments?: (number|null);
|
|
12069
12072
|
|
|
12073
|
+
/** RecurringAgreement initialPayment. */
|
|
12074
|
+
public initialPayment?: (types.IRecurringInitialPayment|null);
|
|
12075
|
+
|
|
12070
12076
|
/**
|
|
12071
12077
|
* Creates a new RecurringAgreement instance using the specified properties.
|
|
12072
12078
|
* @param [properties] Properties to set
|
|
@@ -12107,6 +12113,169 @@ export namespace types {
|
|
|
12107
12113
|
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
12108
12114
|
}
|
|
12109
12115
|
|
|
12116
|
+
/** Properties of a RecurringInitialPayment. */
|
|
12117
|
+
interface IRecurringInitialPayment {
|
|
12118
|
+
|
|
12119
|
+
/** RecurringInitialPayment amountMinor */
|
|
12120
|
+
amountMinor?: (number|Long|null);
|
|
12121
|
+
|
|
12122
|
+
/** RecurringInitialPayment shippingAmountMinor */
|
|
12123
|
+
shippingAmountMinor?: (number|Long|null);
|
|
12124
|
+
|
|
12125
|
+
/** RecurringInitialPayment taxAmountMinor */
|
|
12126
|
+
taxAmountMinor?: (number|Long|null);
|
|
12127
|
+
|
|
12128
|
+
/**
|
|
12129
|
+
* Every product or native bundle line paid today alongside the plan, each
|
|
12130
|
+
* with its own net amount. Empty for a plan-only first payment.
|
|
12131
|
+
*/
|
|
12132
|
+
oneTimeProducts?: (types.IRecurringInitialOneTimeProduct[]|null);
|
|
12133
|
+
|
|
12134
|
+
/** RecurringInitialPayment nextBillingDate */
|
|
12135
|
+
nextBillingDate?: (string|null);
|
|
12136
|
+
}
|
|
12137
|
+
|
|
12138
|
+
/**
|
|
12139
|
+
* Initial checkout amounts use the agreement's currency. The recurring amount
|
|
12140
|
+
* remains the disclosed future plan price, not the combined checkout total.
|
|
12141
|
+
*/
|
|
12142
|
+
class RecurringInitialPayment implements IRecurringInitialPayment {
|
|
12143
|
+
|
|
12144
|
+
/**
|
|
12145
|
+
* Constructs a new RecurringInitialPayment.
|
|
12146
|
+
* @param [properties] Properties to set
|
|
12147
|
+
*/
|
|
12148
|
+
constructor(properties?: types.IRecurringInitialPayment);
|
|
12149
|
+
|
|
12150
|
+
/** RecurringInitialPayment amountMinor. */
|
|
12151
|
+
public amountMinor: (number|Long);
|
|
12152
|
+
|
|
12153
|
+
/** RecurringInitialPayment shippingAmountMinor. */
|
|
12154
|
+
public shippingAmountMinor: (number|Long);
|
|
12155
|
+
|
|
12156
|
+
/** RecurringInitialPayment taxAmountMinor. */
|
|
12157
|
+
public taxAmountMinor: (number|Long);
|
|
12158
|
+
|
|
12159
|
+
/**
|
|
12160
|
+
* Every product or native bundle line paid today alongside the plan, each
|
|
12161
|
+
* with its own net amount. Empty for a plan-only first payment.
|
|
12162
|
+
*/
|
|
12163
|
+
public oneTimeProducts: types.IRecurringInitialOneTimeProduct[];
|
|
12164
|
+
|
|
12165
|
+
/** RecurringInitialPayment nextBillingDate. */
|
|
12166
|
+
public nextBillingDate: string;
|
|
12167
|
+
|
|
12168
|
+
/**
|
|
12169
|
+
* Creates a new RecurringInitialPayment instance using the specified properties.
|
|
12170
|
+
* @param [properties] Properties to set
|
|
12171
|
+
* @returns RecurringInitialPayment instance
|
|
12172
|
+
*/
|
|
12173
|
+
public static create(properties?: types.IRecurringInitialPayment): types.RecurringInitialPayment;
|
|
12174
|
+
|
|
12175
|
+
/**
|
|
12176
|
+
* Encodes the specified RecurringInitialPayment message. Does not implicitly {@link types.RecurringInitialPayment.verify|verify} messages.
|
|
12177
|
+
* @param message RecurringInitialPayment message or plain object to encode
|
|
12178
|
+
* @param [writer] Writer to encode to
|
|
12179
|
+
* @returns Writer
|
|
12180
|
+
*/
|
|
12181
|
+
public static encode(message: types.IRecurringInitialPayment, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
12182
|
+
|
|
12183
|
+
/**
|
|
12184
|
+
* Decodes a RecurringInitialPayment message from the specified reader or buffer.
|
|
12185
|
+
* @param reader Reader or buffer to decode from
|
|
12186
|
+
* @param [length] Message length if known beforehand
|
|
12187
|
+
* @returns RecurringInitialPayment
|
|
12188
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
12189
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
12190
|
+
*/
|
|
12191
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.RecurringInitialPayment;
|
|
12192
|
+
|
|
12193
|
+
/**
|
|
12194
|
+
* Verifies a RecurringInitialPayment message.
|
|
12195
|
+
* @param message Plain object to verify
|
|
12196
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
12197
|
+
*/
|
|
12198
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
12199
|
+
|
|
12200
|
+
/**
|
|
12201
|
+
* Gets the default type url for RecurringInitialPayment
|
|
12202
|
+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
12203
|
+
* @returns The default type url
|
|
12204
|
+
*/
|
|
12205
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
12206
|
+
}
|
|
12207
|
+
|
|
12208
|
+
/** Properties of a RecurringInitialOneTimeProduct. */
|
|
12209
|
+
interface IRecurringInitialOneTimeProduct {
|
|
12210
|
+
|
|
12211
|
+
/** RecurringInitialOneTimeProduct name */
|
|
12212
|
+
name?: (string|null);
|
|
12213
|
+
|
|
12214
|
+
/** RecurringInitialOneTimeProduct amountMinor */
|
|
12215
|
+
amountMinor?: (number|Long|null);
|
|
12216
|
+
|
|
12217
|
+
/** RecurringInitialOneTimeProduct requiresShipping */
|
|
12218
|
+
requiresShipping?: (boolean|null);
|
|
12219
|
+
}
|
|
12220
|
+
|
|
12221
|
+
/** Represents a RecurringInitialOneTimeProduct. */
|
|
12222
|
+
class RecurringInitialOneTimeProduct implements IRecurringInitialOneTimeProduct {
|
|
12223
|
+
|
|
12224
|
+
/**
|
|
12225
|
+
* Constructs a new RecurringInitialOneTimeProduct.
|
|
12226
|
+
* @param [properties] Properties to set
|
|
12227
|
+
*/
|
|
12228
|
+
constructor(properties?: types.IRecurringInitialOneTimeProduct);
|
|
12229
|
+
|
|
12230
|
+
/** RecurringInitialOneTimeProduct name. */
|
|
12231
|
+
public name: string;
|
|
12232
|
+
|
|
12233
|
+
/** RecurringInitialOneTimeProduct amountMinor. */
|
|
12234
|
+
public amountMinor: (number|Long);
|
|
12235
|
+
|
|
12236
|
+
/** RecurringInitialOneTimeProduct requiresShipping. */
|
|
12237
|
+
public requiresShipping: boolean;
|
|
12238
|
+
|
|
12239
|
+
/**
|
|
12240
|
+
* Creates a new RecurringInitialOneTimeProduct instance using the specified properties.
|
|
12241
|
+
* @param [properties] Properties to set
|
|
12242
|
+
* @returns RecurringInitialOneTimeProduct instance
|
|
12243
|
+
*/
|
|
12244
|
+
public static create(properties?: types.IRecurringInitialOneTimeProduct): types.RecurringInitialOneTimeProduct;
|
|
12245
|
+
|
|
12246
|
+
/**
|
|
12247
|
+
* Encodes the specified RecurringInitialOneTimeProduct message. Does not implicitly {@link types.RecurringInitialOneTimeProduct.verify|verify} messages.
|
|
12248
|
+
* @param message RecurringInitialOneTimeProduct message or plain object to encode
|
|
12249
|
+
* @param [writer] Writer to encode to
|
|
12250
|
+
* @returns Writer
|
|
12251
|
+
*/
|
|
12252
|
+
public static encode(message: types.IRecurringInitialOneTimeProduct, writer?: $protobuf.Writer): $protobuf.Writer;
|
|
12253
|
+
|
|
12254
|
+
/**
|
|
12255
|
+
* Decodes a RecurringInitialOneTimeProduct message from the specified reader or buffer.
|
|
12256
|
+
* @param reader Reader or buffer to decode from
|
|
12257
|
+
* @param [length] Message length if known beforehand
|
|
12258
|
+
* @returns RecurringInitialOneTimeProduct
|
|
12259
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
12260
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
12261
|
+
*/
|
|
12262
|
+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.RecurringInitialOneTimeProduct;
|
|
12263
|
+
|
|
12264
|
+
/**
|
|
12265
|
+
* Verifies a RecurringInitialOneTimeProduct message.
|
|
12266
|
+
* @param message Plain object to verify
|
|
12267
|
+
* @returns `null` if valid, otherwise the reason why it is not
|
|
12268
|
+
*/
|
|
12269
|
+
public static verify(message: { [k: string]: any }): (string|null);
|
|
12270
|
+
|
|
12271
|
+
/**
|
|
12272
|
+
* Gets the default type url for RecurringInitialOneTimeProduct
|
|
12273
|
+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
12274
|
+
* @returns The default type url
|
|
12275
|
+
*/
|
|
12276
|
+
public static getTypeUrl(typeUrlPrefix?: string): string;
|
|
12277
|
+
}
|
|
12278
|
+
|
|
12110
12279
|
/** Properties of a PaypalClientAuthenticationResponse. */
|
|
12111
12280
|
interface IPaypalClientAuthenticationResponse {
|
|
12112
12281
|
|
|
@@ -36110,6 +36110,7 @@ $root.types = (function() {
|
|
|
36110
36110
|
* @property {number|null} [intervalCount] RecurringAgreement intervalCount
|
|
36111
36111
|
* @property {number|null} [totalPayments] Total payments includes the first checkout payment. Omitted means the
|
|
36112
36112
|
* agreement continues until canceled.
|
|
36113
|
+
* @property {types.IRecurringInitialPayment|null} [initialPayment] RecurringAgreement initialPayment
|
|
36113
36114
|
*/
|
|
36114
36115
|
|
|
36115
36116
|
/**
|
|
@@ -36170,6 +36171,14 @@ $root.types = (function() {
|
|
|
36170
36171
|
*/
|
|
36171
36172
|
RecurringAgreement.prototype.totalPayments = null;
|
|
36172
36173
|
|
|
36174
|
+
/**
|
|
36175
|
+
* RecurringAgreement initialPayment.
|
|
36176
|
+
* @member {types.IRecurringInitialPayment|null|undefined} initialPayment
|
|
36177
|
+
* @memberof types.RecurringAgreement
|
|
36178
|
+
* @instance
|
|
36179
|
+
*/
|
|
36180
|
+
RecurringAgreement.prototype.initialPayment = null;
|
|
36181
|
+
|
|
36173
36182
|
// OneOf field names bound to virtual getters and setters
|
|
36174
36183
|
var $oneOfFields;
|
|
36175
36184
|
|
|
@@ -36179,6 +36188,12 @@ $root.types = (function() {
|
|
|
36179
36188
|
set: $util.oneOfSetter($oneOfFields)
|
|
36180
36189
|
});
|
|
36181
36190
|
|
|
36191
|
+
// Virtual OneOf for proto3 optional field
|
|
36192
|
+
Object.defineProperty(RecurringAgreement.prototype, "_initialPayment", {
|
|
36193
|
+
get: $util.oneOfGetter($oneOfFields = ["initialPayment"]),
|
|
36194
|
+
set: $util.oneOfSetter($oneOfFields)
|
|
36195
|
+
});
|
|
36196
|
+
|
|
36182
36197
|
/**
|
|
36183
36198
|
* Creates a new RecurringAgreement instance using the specified properties.
|
|
36184
36199
|
* @function create
|
|
@@ -36217,6 +36232,8 @@ $root.types = (function() {
|
|
|
36217
36232
|
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.intervalCount);
|
|
36218
36233
|
if (message.totalPayments != null && Object.hasOwnProperty.call(message, "totalPayments"))
|
|
36219
36234
|
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.totalPayments);
|
|
36235
|
+
if (message.initialPayment != null && Object.hasOwnProperty.call(message, "initialPayment"))
|
|
36236
|
+
$root.types.RecurringInitialPayment.encode(message.initialPayment, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim();
|
|
36220
36237
|
return writer;
|
|
36221
36238
|
};
|
|
36222
36239
|
|
|
@@ -36264,6 +36281,10 @@ $root.types = (function() {
|
|
|
36264
36281
|
message.totalPayments = reader.uint32();
|
|
36265
36282
|
break;
|
|
36266
36283
|
}
|
|
36284
|
+
case 6: {
|
|
36285
|
+
message.initialPayment = $root.types.RecurringInitialPayment.decode(reader, reader.uint32(), undefined, long + 1);
|
|
36286
|
+
break;
|
|
36287
|
+
}
|
|
36267
36288
|
default:
|
|
36268
36289
|
reader.skipType(tag & 7, long);
|
|
36269
36290
|
break;
|
|
@@ -36317,6 +36338,14 @@ $root.types = (function() {
|
|
|
36317
36338
|
if (!$util.isInteger(message.totalPayments))
|
|
36318
36339
|
return "totalPayments: integer expected";
|
|
36319
36340
|
}
|
|
36341
|
+
if (message.initialPayment != null && Object.hasOwnProperty.call(message, "initialPayment")) {
|
|
36342
|
+
properties._initialPayment = 1;
|
|
36343
|
+
{
|
|
36344
|
+
var error = $root.types.RecurringInitialPayment.verify(message.initialPayment, long + 1);
|
|
36345
|
+
if (error)
|
|
36346
|
+
return "initialPayment." + error;
|
|
36347
|
+
}
|
|
36348
|
+
}
|
|
36320
36349
|
return null;
|
|
36321
36350
|
};
|
|
36322
36351
|
|
|
@@ -36338,6 +36367,407 @@ $root.types = (function() {
|
|
|
36338
36367
|
return RecurringAgreement;
|
|
36339
36368
|
})();
|
|
36340
36369
|
|
|
36370
|
+
types.RecurringInitialPayment = (function() {
|
|
36371
|
+
|
|
36372
|
+
/**
|
|
36373
|
+
* Properties of a RecurringInitialPayment.
|
|
36374
|
+
* @memberof types
|
|
36375
|
+
* @interface IRecurringInitialPayment
|
|
36376
|
+
* @property {number|Long|null} [amountMinor] RecurringInitialPayment amountMinor
|
|
36377
|
+
* @property {number|Long|null} [shippingAmountMinor] RecurringInitialPayment shippingAmountMinor
|
|
36378
|
+
* @property {number|Long|null} [taxAmountMinor] RecurringInitialPayment taxAmountMinor
|
|
36379
|
+
* @property {Array.<types.IRecurringInitialOneTimeProduct>|null} [oneTimeProducts] Every product or native bundle line paid today alongside the plan, each
|
|
36380
|
+
* with its own net amount. Empty for a plan-only first payment.
|
|
36381
|
+
* @property {string|null} [nextBillingDate] RecurringInitialPayment nextBillingDate
|
|
36382
|
+
*/
|
|
36383
|
+
|
|
36384
|
+
/**
|
|
36385
|
+
* Constructs a new RecurringInitialPayment.
|
|
36386
|
+
* @memberof types
|
|
36387
|
+
* @classdesc Initial checkout amounts use the agreement's currency. The recurring amount
|
|
36388
|
+
* remains the disclosed future plan price, not the combined checkout total.
|
|
36389
|
+
* @implements IRecurringInitialPayment
|
|
36390
|
+
* @constructor
|
|
36391
|
+
* @param {types.IRecurringInitialPayment=} [properties] Properties to set
|
|
36392
|
+
*/
|
|
36393
|
+
function RecurringInitialPayment(properties) {
|
|
36394
|
+
this.oneTimeProducts = [];
|
|
36395
|
+
if (properties)
|
|
36396
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
36397
|
+
if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
36398
|
+
this[keys[i]] = properties[keys[i]];
|
|
36399
|
+
}
|
|
36400
|
+
|
|
36401
|
+
/**
|
|
36402
|
+
* RecurringInitialPayment amountMinor.
|
|
36403
|
+
* @member {number|Long} amountMinor
|
|
36404
|
+
* @memberof types.RecurringInitialPayment
|
|
36405
|
+
* @instance
|
|
36406
|
+
*/
|
|
36407
|
+
RecurringInitialPayment.prototype.amountMinor = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
36408
|
+
|
|
36409
|
+
/**
|
|
36410
|
+
* RecurringInitialPayment shippingAmountMinor.
|
|
36411
|
+
* @member {number|Long} shippingAmountMinor
|
|
36412
|
+
* @memberof types.RecurringInitialPayment
|
|
36413
|
+
* @instance
|
|
36414
|
+
*/
|
|
36415
|
+
RecurringInitialPayment.prototype.shippingAmountMinor = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
36416
|
+
|
|
36417
|
+
/**
|
|
36418
|
+
* RecurringInitialPayment taxAmountMinor.
|
|
36419
|
+
* @member {number|Long} taxAmountMinor
|
|
36420
|
+
* @memberof types.RecurringInitialPayment
|
|
36421
|
+
* @instance
|
|
36422
|
+
*/
|
|
36423
|
+
RecurringInitialPayment.prototype.taxAmountMinor = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
36424
|
+
|
|
36425
|
+
/**
|
|
36426
|
+
* Every product or native bundle line paid today alongside the plan, each
|
|
36427
|
+
* with its own net amount. Empty for a plan-only first payment.
|
|
36428
|
+
* @member {Array.<types.IRecurringInitialOneTimeProduct>} oneTimeProducts
|
|
36429
|
+
* @memberof types.RecurringInitialPayment
|
|
36430
|
+
* @instance
|
|
36431
|
+
*/
|
|
36432
|
+
RecurringInitialPayment.prototype.oneTimeProducts = $util.emptyArray;
|
|
36433
|
+
|
|
36434
|
+
/**
|
|
36435
|
+
* RecurringInitialPayment nextBillingDate.
|
|
36436
|
+
* @member {string} nextBillingDate
|
|
36437
|
+
* @memberof types.RecurringInitialPayment
|
|
36438
|
+
* @instance
|
|
36439
|
+
*/
|
|
36440
|
+
RecurringInitialPayment.prototype.nextBillingDate = "";
|
|
36441
|
+
|
|
36442
|
+
/**
|
|
36443
|
+
* Creates a new RecurringInitialPayment instance using the specified properties.
|
|
36444
|
+
* @function create
|
|
36445
|
+
* @memberof types.RecurringInitialPayment
|
|
36446
|
+
* @static
|
|
36447
|
+
* @param {types.IRecurringInitialPayment=} [properties] Properties to set
|
|
36448
|
+
* @returns {types.RecurringInitialPayment} RecurringInitialPayment instance
|
|
36449
|
+
*/
|
|
36450
|
+
RecurringInitialPayment.create = function create(properties) {
|
|
36451
|
+
return new RecurringInitialPayment(properties);
|
|
36452
|
+
};
|
|
36453
|
+
|
|
36454
|
+
/**
|
|
36455
|
+
* Encodes the specified RecurringInitialPayment message. Does not implicitly {@link types.RecurringInitialPayment.verify|verify} messages.
|
|
36456
|
+
* @function encode
|
|
36457
|
+
* @memberof types.RecurringInitialPayment
|
|
36458
|
+
* @static
|
|
36459
|
+
* @param {types.IRecurringInitialPayment} message RecurringInitialPayment message or plain object to encode
|
|
36460
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
36461
|
+
* @returns {$protobuf.Writer} Writer
|
|
36462
|
+
*/
|
|
36463
|
+
RecurringInitialPayment.encode = function encode(message, writer, q) {
|
|
36464
|
+
if (!writer)
|
|
36465
|
+
writer = $Writer.create();
|
|
36466
|
+
if (q === undefined)
|
|
36467
|
+
q = 0;
|
|
36468
|
+
if (q > $util.recursionLimit)
|
|
36469
|
+
throw Error("max depth exceeded");
|
|
36470
|
+
if (message.amountMinor != null && Object.hasOwnProperty.call(message, "amountMinor"))
|
|
36471
|
+
writer.uint32(/* id 1, wireType 0 =*/8).int64(message.amountMinor);
|
|
36472
|
+
if (message.shippingAmountMinor != null && Object.hasOwnProperty.call(message, "shippingAmountMinor"))
|
|
36473
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.shippingAmountMinor);
|
|
36474
|
+
if (message.taxAmountMinor != null && Object.hasOwnProperty.call(message, "taxAmountMinor"))
|
|
36475
|
+
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.taxAmountMinor);
|
|
36476
|
+
if (message.oneTimeProducts != null && message.oneTimeProducts.length)
|
|
36477
|
+
for (var i = 0; i < message.oneTimeProducts.length; ++i)
|
|
36478
|
+
$root.types.RecurringInitialOneTimeProduct.encode(message.oneTimeProducts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim();
|
|
36479
|
+
if (message.nextBillingDate != null && Object.hasOwnProperty.call(message, "nextBillingDate"))
|
|
36480
|
+
writer.uint32(/* id 5, wireType 2 =*/42).string(message.nextBillingDate);
|
|
36481
|
+
return writer;
|
|
36482
|
+
};
|
|
36483
|
+
|
|
36484
|
+
/**
|
|
36485
|
+
* Decodes a RecurringInitialPayment message from the specified reader or buffer.
|
|
36486
|
+
* @function decode
|
|
36487
|
+
* @memberof types.RecurringInitialPayment
|
|
36488
|
+
* @static
|
|
36489
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
36490
|
+
* @param {number} [length] Message length if known beforehand
|
|
36491
|
+
* @returns {types.RecurringInitialPayment} RecurringInitialPayment
|
|
36492
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
36493
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
36494
|
+
*/
|
|
36495
|
+
RecurringInitialPayment.decode = function decode(reader, length, error, long) {
|
|
36496
|
+
if (!(reader instanceof $Reader))
|
|
36497
|
+
reader = $Reader.create(reader);
|
|
36498
|
+
if (long === undefined)
|
|
36499
|
+
long = 0;
|
|
36500
|
+
if (long > $Reader.recursionLimit)
|
|
36501
|
+
throw Error("maximum nesting depth exceeded");
|
|
36502
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.RecurringInitialPayment();
|
|
36503
|
+
while (reader.pos < end) {
|
|
36504
|
+
var tag = reader.uint32();
|
|
36505
|
+
if (tag === error)
|
|
36506
|
+
break;
|
|
36507
|
+
switch (tag >>> 3) {
|
|
36508
|
+
case 1: {
|
|
36509
|
+
message.amountMinor = reader.int64();
|
|
36510
|
+
break;
|
|
36511
|
+
}
|
|
36512
|
+
case 2: {
|
|
36513
|
+
message.shippingAmountMinor = reader.int64();
|
|
36514
|
+
break;
|
|
36515
|
+
}
|
|
36516
|
+
case 3: {
|
|
36517
|
+
message.taxAmountMinor = reader.int64();
|
|
36518
|
+
break;
|
|
36519
|
+
}
|
|
36520
|
+
case 4: {
|
|
36521
|
+
if (!(message.oneTimeProducts && message.oneTimeProducts.length))
|
|
36522
|
+
message.oneTimeProducts = [];
|
|
36523
|
+
message.oneTimeProducts.push($root.types.RecurringInitialOneTimeProduct.decode(reader, reader.uint32(), undefined, long + 1));
|
|
36524
|
+
break;
|
|
36525
|
+
}
|
|
36526
|
+
case 5: {
|
|
36527
|
+
message.nextBillingDate = reader.string();
|
|
36528
|
+
break;
|
|
36529
|
+
}
|
|
36530
|
+
default:
|
|
36531
|
+
reader.skipType(tag & 7, long);
|
|
36532
|
+
break;
|
|
36533
|
+
}
|
|
36534
|
+
}
|
|
36535
|
+
return message;
|
|
36536
|
+
};
|
|
36537
|
+
|
|
36538
|
+
/**
|
|
36539
|
+
* Verifies a RecurringInitialPayment message.
|
|
36540
|
+
* @function verify
|
|
36541
|
+
* @memberof types.RecurringInitialPayment
|
|
36542
|
+
* @static
|
|
36543
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
36544
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
36545
|
+
*/
|
|
36546
|
+
RecurringInitialPayment.verify = function verify(message, long) {
|
|
36547
|
+
if (typeof message !== "object" || message === null)
|
|
36548
|
+
return "object expected";
|
|
36549
|
+
if (long === undefined)
|
|
36550
|
+
long = 0;
|
|
36551
|
+
if (long > $util.recursionLimit)
|
|
36552
|
+
return "maximum nesting depth exceeded";
|
|
36553
|
+
if (message.amountMinor != null && Object.hasOwnProperty.call(message, "amountMinor"))
|
|
36554
|
+
if (!$util.isInteger(message.amountMinor) && !(message.amountMinor && $util.isInteger(message.amountMinor.low) && $util.isInteger(message.amountMinor.high)))
|
|
36555
|
+
return "amountMinor: integer|Long expected";
|
|
36556
|
+
if (message.shippingAmountMinor != null && Object.hasOwnProperty.call(message, "shippingAmountMinor"))
|
|
36557
|
+
if (!$util.isInteger(message.shippingAmountMinor) && !(message.shippingAmountMinor && $util.isInteger(message.shippingAmountMinor.low) && $util.isInteger(message.shippingAmountMinor.high)))
|
|
36558
|
+
return "shippingAmountMinor: integer|Long expected";
|
|
36559
|
+
if (message.taxAmountMinor != null && Object.hasOwnProperty.call(message, "taxAmountMinor"))
|
|
36560
|
+
if (!$util.isInteger(message.taxAmountMinor) && !(message.taxAmountMinor && $util.isInteger(message.taxAmountMinor.low) && $util.isInteger(message.taxAmountMinor.high)))
|
|
36561
|
+
return "taxAmountMinor: integer|Long expected";
|
|
36562
|
+
if (message.oneTimeProducts != null && Object.hasOwnProperty.call(message, "oneTimeProducts")) {
|
|
36563
|
+
if (!Array.isArray(message.oneTimeProducts))
|
|
36564
|
+
return "oneTimeProducts: array expected";
|
|
36565
|
+
for (var i = 0; i < message.oneTimeProducts.length; ++i) {
|
|
36566
|
+
var error = $root.types.RecurringInitialOneTimeProduct.verify(message.oneTimeProducts[i], long + 1);
|
|
36567
|
+
if (error)
|
|
36568
|
+
return "oneTimeProducts." + error;
|
|
36569
|
+
}
|
|
36570
|
+
}
|
|
36571
|
+
if (message.nextBillingDate != null && Object.hasOwnProperty.call(message, "nextBillingDate"))
|
|
36572
|
+
if (!$util.isString(message.nextBillingDate))
|
|
36573
|
+
return "nextBillingDate: string expected";
|
|
36574
|
+
return null;
|
|
36575
|
+
};
|
|
36576
|
+
|
|
36577
|
+
/**
|
|
36578
|
+
* Gets the default type url for RecurringInitialPayment
|
|
36579
|
+
* @function getTypeUrl
|
|
36580
|
+
* @memberof types.RecurringInitialPayment
|
|
36581
|
+
* @static
|
|
36582
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
36583
|
+
* @returns {string} The default type url
|
|
36584
|
+
*/
|
|
36585
|
+
RecurringInitialPayment.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
36586
|
+
if (typeUrlPrefix === undefined) {
|
|
36587
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
36588
|
+
}
|
|
36589
|
+
return typeUrlPrefix + "/types.RecurringInitialPayment";
|
|
36590
|
+
};
|
|
36591
|
+
|
|
36592
|
+
return RecurringInitialPayment;
|
|
36593
|
+
})();
|
|
36594
|
+
|
|
36595
|
+
types.RecurringInitialOneTimeProduct = (function() {
|
|
36596
|
+
|
|
36597
|
+
/**
|
|
36598
|
+
* Properties of a RecurringInitialOneTimeProduct.
|
|
36599
|
+
* @memberof types
|
|
36600
|
+
* @interface IRecurringInitialOneTimeProduct
|
|
36601
|
+
* @property {string|null} [name] RecurringInitialOneTimeProduct name
|
|
36602
|
+
* @property {number|Long|null} [amountMinor] RecurringInitialOneTimeProduct amountMinor
|
|
36603
|
+
* @property {boolean|null} [requiresShipping] RecurringInitialOneTimeProduct requiresShipping
|
|
36604
|
+
*/
|
|
36605
|
+
|
|
36606
|
+
/**
|
|
36607
|
+
* Constructs a new RecurringInitialOneTimeProduct.
|
|
36608
|
+
* @memberof types
|
|
36609
|
+
* @classdesc Represents a RecurringInitialOneTimeProduct.
|
|
36610
|
+
* @implements IRecurringInitialOneTimeProduct
|
|
36611
|
+
* @constructor
|
|
36612
|
+
* @param {types.IRecurringInitialOneTimeProduct=} [properties] Properties to set
|
|
36613
|
+
*/
|
|
36614
|
+
function RecurringInitialOneTimeProduct(properties) {
|
|
36615
|
+
if (properties)
|
|
36616
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
36617
|
+
if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
36618
|
+
this[keys[i]] = properties[keys[i]];
|
|
36619
|
+
}
|
|
36620
|
+
|
|
36621
|
+
/**
|
|
36622
|
+
* RecurringInitialOneTimeProduct name.
|
|
36623
|
+
* @member {string} name
|
|
36624
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36625
|
+
* @instance
|
|
36626
|
+
*/
|
|
36627
|
+
RecurringInitialOneTimeProduct.prototype.name = "";
|
|
36628
|
+
|
|
36629
|
+
/**
|
|
36630
|
+
* RecurringInitialOneTimeProduct amountMinor.
|
|
36631
|
+
* @member {number|Long} amountMinor
|
|
36632
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36633
|
+
* @instance
|
|
36634
|
+
*/
|
|
36635
|
+
RecurringInitialOneTimeProduct.prototype.amountMinor = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
|
|
36636
|
+
|
|
36637
|
+
/**
|
|
36638
|
+
* RecurringInitialOneTimeProduct requiresShipping.
|
|
36639
|
+
* @member {boolean} requiresShipping
|
|
36640
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36641
|
+
* @instance
|
|
36642
|
+
*/
|
|
36643
|
+
RecurringInitialOneTimeProduct.prototype.requiresShipping = false;
|
|
36644
|
+
|
|
36645
|
+
/**
|
|
36646
|
+
* Creates a new RecurringInitialOneTimeProduct instance using the specified properties.
|
|
36647
|
+
* @function create
|
|
36648
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36649
|
+
* @static
|
|
36650
|
+
* @param {types.IRecurringInitialOneTimeProduct=} [properties] Properties to set
|
|
36651
|
+
* @returns {types.RecurringInitialOneTimeProduct} RecurringInitialOneTimeProduct instance
|
|
36652
|
+
*/
|
|
36653
|
+
RecurringInitialOneTimeProduct.create = function create(properties) {
|
|
36654
|
+
return new RecurringInitialOneTimeProduct(properties);
|
|
36655
|
+
};
|
|
36656
|
+
|
|
36657
|
+
/**
|
|
36658
|
+
* Encodes the specified RecurringInitialOneTimeProduct message. Does not implicitly {@link types.RecurringInitialOneTimeProduct.verify|verify} messages.
|
|
36659
|
+
* @function encode
|
|
36660
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36661
|
+
* @static
|
|
36662
|
+
* @param {types.IRecurringInitialOneTimeProduct} message RecurringInitialOneTimeProduct message or plain object to encode
|
|
36663
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
36664
|
+
* @returns {$protobuf.Writer} Writer
|
|
36665
|
+
*/
|
|
36666
|
+
RecurringInitialOneTimeProduct.encode = function encode(message, writer, q) {
|
|
36667
|
+
if (!writer)
|
|
36668
|
+
writer = $Writer.create();
|
|
36669
|
+
if (q === undefined)
|
|
36670
|
+
q = 0;
|
|
36671
|
+
if (q > $util.recursionLimit)
|
|
36672
|
+
throw Error("max depth exceeded");
|
|
36673
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
36674
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
|
|
36675
|
+
if (message.amountMinor != null && Object.hasOwnProperty.call(message, "amountMinor"))
|
|
36676
|
+
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.amountMinor);
|
|
36677
|
+
if (message.requiresShipping != null && Object.hasOwnProperty.call(message, "requiresShipping"))
|
|
36678
|
+
writer.uint32(/* id 3, wireType 0 =*/24).bool(message.requiresShipping);
|
|
36679
|
+
return writer;
|
|
36680
|
+
};
|
|
36681
|
+
|
|
36682
|
+
/**
|
|
36683
|
+
* Decodes a RecurringInitialOneTimeProduct message from the specified reader or buffer.
|
|
36684
|
+
* @function decode
|
|
36685
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36686
|
+
* @static
|
|
36687
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
36688
|
+
* @param {number} [length] Message length if known beforehand
|
|
36689
|
+
* @returns {types.RecurringInitialOneTimeProduct} RecurringInitialOneTimeProduct
|
|
36690
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
36691
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
36692
|
+
*/
|
|
36693
|
+
RecurringInitialOneTimeProduct.decode = function decode(reader, length, error, long) {
|
|
36694
|
+
if (!(reader instanceof $Reader))
|
|
36695
|
+
reader = $Reader.create(reader);
|
|
36696
|
+
if (long === undefined)
|
|
36697
|
+
long = 0;
|
|
36698
|
+
if (long > $Reader.recursionLimit)
|
|
36699
|
+
throw Error("maximum nesting depth exceeded");
|
|
36700
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.RecurringInitialOneTimeProduct();
|
|
36701
|
+
while (reader.pos < end) {
|
|
36702
|
+
var tag = reader.uint32();
|
|
36703
|
+
if (tag === error)
|
|
36704
|
+
break;
|
|
36705
|
+
switch (tag >>> 3) {
|
|
36706
|
+
case 1: {
|
|
36707
|
+
message.name = reader.string();
|
|
36708
|
+
break;
|
|
36709
|
+
}
|
|
36710
|
+
case 2: {
|
|
36711
|
+
message.amountMinor = reader.int64();
|
|
36712
|
+
break;
|
|
36713
|
+
}
|
|
36714
|
+
case 3: {
|
|
36715
|
+
message.requiresShipping = reader.bool();
|
|
36716
|
+
break;
|
|
36717
|
+
}
|
|
36718
|
+
default:
|
|
36719
|
+
reader.skipType(tag & 7, long);
|
|
36720
|
+
break;
|
|
36721
|
+
}
|
|
36722
|
+
}
|
|
36723
|
+
return message;
|
|
36724
|
+
};
|
|
36725
|
+
|
|
36726
|
+
/**
|
|
36727
|
+
* Verifies a RecurringInitialOneTimeProduct message.
|
|
36728
|
+
* @function verify
|
|
36729
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36730
|
+
* @static
|
|
36731
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
36732
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
36733
|
+
*/
|
|
36734
|
+
RecurringInitialOneTimeProduct.verify = function verify(message, long) {
|
|
36735
|
+
if (typeof message !== "object" || message === null)
|
|
36736
|
+
return "object expected";
|
|
36737
|
+
if (long === undefined)
|
|
36738
|
+
long = 0;
|
|
36739
|
+
if (long > $util.recursionLimit)
|
|
36740
|
+
return "maximum nesting depth exceeded";
|
|
36741
|
+
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
|
|
36742
|
+
if (!$util.isString(message.name))
|
|
36743
|
+
return "name: string expected";
|
|
36744
|
+
if (message.amountMinor != null && Object.hasOwnProperty.call(message, "amountMinor"))
|
|
36745
|
+
if (!$util.isInteger(message.amountMinor) && !(message.amountMinor && $util.isInteger(message.amountMinor.low) && $util.isInteger(message.amountMinor.high)))
|
|
36746
|
+
return "amountMinor: integer|Long expected";
|
|
36747
|
+
if (message.requiresShipping != null && Object.hasOwnProperty.call(message, "requiresShipping"))
|
|
36748
|
+
if (typeof message.requiresShipping !== "boolean")
|
|
36749
|
+
return "requiresShipping: boolean expected";
|
|
36750
|
+
return null;
|
|
36751
|
+
};
|
|
36752
|
+
|
|
36753
|
+
/**
|
|
36754
|
+
* Gets the default type url for RecurringInitialOneTimeProduct
|
|
36755
|
+
* @function getTypeUrl
|
|
36756
|
+
* @memberof types.RecurringInitialOneTimeProduct
|
|
36757
|
+
* @static
|
|
36758
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
36759
|
+
* @returns {string} The default type url
|
|
36760
|
+
*/
|
|
36761
|
+
RecurringInitialOneTimeProduct.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
36762
|
+
if (typeUrlPrefix === undefined) {
|
|
36763
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
36764
|
+
}
|
|
36765
|
+
return typeUrlPrefix + "/types.RecurringInitialOneTimeProduct";
|
|
36766
|
+
};
|
|
36767
|
+
|
|
36768
|
+
return RecurringInitialOneTimeProduct;
|
|
36769
|
+
})();
|
|
36770
|
+
|
|
36341
36771
|
types.PaypalClientAuthenticationResponse = (function() {
|
|
36342
36772
|
|
|
36343
36773
|
/**
|
package/package.json
CHANGED