@alphawebai/hs-prism 0.1.0-rc.44 → 0.1.0-rc.46
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/stripe-connector.d.ts +1 -0
- package/dist/src/alphaweb/stripe-connector.js +66 -8
- 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 +175 -0
- package/dist/src/payments/generated/proto.js +456 -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.46";
|
|
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.46',
|
|
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) {
|
|
@@ -30,6 +30,7 @@ export declare class PrismStripeConnector implements PrismStripeConnectorV1 {
|
|
|
30
30
|
private assertOperation;
|
|
31
31
|
private recoverRepeatPayment;
|
|
32
32
|
private stripeRequest;
|
|
33
|
+
private checkoutPaymentMethodSelection;
|
|
33
34
|
createPayment(input: PrismMerchantOperation): Promise<PrismPaymentResult>;
|
|
34
35
|
repeatPayment(input: PrismMerchantOperation): Promise<PrismPaymentResult>;
|
|
35
36
|
retryPayment(input: PrismRetryPaymentInput): Promise<PrismPaymentResult>;
|
|
@@ -167,9 +167,8 @@ function buildResult(response, money, fallbackConnectorPaymentId = null) {
|
|
|
167
167
|
* Package-owned intersection of Stripe's API support contract and the payment
|
|
168
168
|
* method types represented by Prism's recurring-payment ABI.
|
|
169
169
|
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
* Stripe has attached the method to the proven Customer.
|
|
170
|
+
* One-time interactive payments retain Stripe's dynamic methods. Future-use
|
|
171
|
+
* checkout and server-side reuse share this capability authority.
|
|
173
172
|
*/
|
|
174
173
|
const STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES = Object.freeze({
|
|
175
174
|
amazon_pay: {
|
|
@@ -191,6 +190,7 @@ const STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES = Object.freeze({
|
|
|
191
190
|
prismPaymentMethodType: proto_1.types.PaymentMethodType.IDEAL,
|
|
192
191
|
supportsFutureUsage: true,
|
|
193
192
|
supportsManualCapture: false,
|
|
193
|
+
requiresGeneratedDebit: true,
|
|
194
194
|
},
|
|
195
195
|
link: {
|
|
196
196
|
prismPaymentMethodType: proto_1.types.PaymentMethodType.CREDIT,
|
|
@@ -207,6 +207,11 @@ const STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES = Object.freeze({
|
|
|
207
207
|
supportsFutureUsage: true,
|
|
208
208
|
supportsManualCapture: true,
|
|
209
209
|
},
|
|
210
|
+
satispay: {
|
|
211
|
+
prismPaymentMethodType: proto_1.types.PaymentMethodType.SATISPAY,
|
|
212
|
+
supportsFutureUsage: true,
|
|
213
|
+
supportsManualCapture: true,
|
|
214
|
+
},
|
|
210
215
|
sepa_debit: {
|
|
211
216
|
prismPaymentMethodType: proto_1.types.PaymentMethodType.SEPA,
|
|
212
217
|
supportsFutureUsage: true,
|
|
@@ -223,13 +228,20 @@ const STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES = Object.freeze({
|
|
|
223
228
|
supportsManualCapture: false,
|
|
224
229
|
},
|
|
225
230
|
});
|
|
226
|
-
function reusablePaymentMethodProfile(type) {
|
|
231
|
+
function reusablePaymentMethodProfile(type, manualCapture = false) {
|
|
227
232
|
const profile = STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES[type];
|
|
228
233
|
if (!profile?.supportsFutureUsage) {
|
|
229
234
|
throw configurationError('The saved Stripe payment method is not supported for a reusable Prism payment.', 'PRISM_REUSABLE_METHOD_UNSUPPORTED');
|
|
230
235
|
}
|
|
236
|
+
if (manualCapture && !profile.supportsManualCapture) {
|
|
237
|
+
throw configurationError('The saved Stripe payment method does not support manual capture.', 'PRISM_REUSABLE_CAPTURE_UNSUPPORTED');
|
|
238
|
+
}
|
|
231
239
|
return profile;
|
|
232
240
|
}
|
|
241
|
+
function supportsStripeFutureUse(profile, purposes) {
|
|
242
|
+
return profile.supportsFutureUsage &&
|
|
243
|
+
(!purposes.includes('post_purchase') || profile.supportsManualCapture);
|
|
244
|
+
}
|
|
233
245
|
const STRIPE_HARD_DECLINE_CODES = new Set([
|
|
234
246
|
'authentication_required',
|
|
235
247
|
'highest_risk_level',
|
|
@@ -749,6 +761,49 @@ class PrismStripeConnector {
|
|
|
749
761
|
clearTimeout(timeout);
|
|
750
762
|
}
|
|
751
763
|
}
|
|
764
|
+
async checkoutPaymentMethodSelection(input) {
|
|
765
|
+
const purposes = input.futureUse?.purposes ??
|
|
766
|
+
(input.metadata.alphaweb_setup_future_usage === 'off_session' ? ['post_purchase'] : []);
|
|
767
|
+
if (purposes.length === 0)
|
|
768
|
+
return undefined;
|
|
769
|
+
const configurationId = input.methodSelection.kind === 'interactive_dynamic'
|
|
770
|
+
? input.methodSelection.paymentMethodConfigurationId : undefined;
|
|
771
|
+
let configuration;
|
|
772
|
+
if (configurationId) {
|
|
773
|
+
configuration = recordOf(await this.stripeRequest('GET', `/payment_method_configurations/${encodeURIComponent(configurationId)}`));
|
|
774
|
+
}
|
|
775
|
+
else {
|
|
776
|
+
let after = null;
|
|
777
|
+
do {
|
|
778
|
+
const params = new URLSearchParams({ limit: '100', ...(after ? { starting_after: after } : {}) });
|
|
779
|
+
const page = recordOf(await this.stripeRequest('GET', `/payment_method_configurations?${params}`));
|
|
780
|
+
const configurations = Array.isArray(page.data) ? page.data.map(recordOf) : [];
|
|
781
|
+
configuration = configurations.find((entry) => entry.is_default === true);
|
|
782
|
+
if (configuration)
|
|
783
|
+
break;
|
|
784
|
+
after = page.has_more === true ? stringOf(configurations.at(-1)?.id) : null;
|
|
785
|
+
} while (after);
|
|
786
|
+
}
|
|
787
|
+
const selectedId = stringOf(configuration?.id);
|
|
788
|
+
if (configuration?.active !== true || !selectedId) {
|
|
789
|
+
throw configurationError('Stripe payment method configuration is unavailable.', 'PRISM_METHOD_CONFIGURATION_UNAVAILABLE');
|
|
790
|
+
}
|
|
791
|
+
// Keep Stripe's configuration (including wallet controls). Translate our
|
|
792
|
+
// supported-flow table into native exclusions using Stripe's own method list.
|
|
793
|
+
const methods = Object.entries(configuration).filter(([, value]) => recordOf(value).display_preference);
|
|
794
|
+
const excludedPaymentMethodTypes = methods.filter(([type]) => {
|
|
795
|
+
// These configuration controls are card wallets/networks, not distinct PM types.
|
|
796
|
+
const method = ['apple_pay', 'google_pay', 'cartes_bancaires'].includes(type) ? 'card' : type;
|
|
797
|
+
const profile = STRIPE_REUSABLE_PAYMENT_METHOD_PROFILES[method];
|
|
798
|
+
return !profile || !supportsStripeFutureUse(profile, purposes) || profile.requiresGeneratedDebit ||
|
|
799
|
+
(input.metadata.alphaweb_capture_method === 'manual' && !profile.supportsManualCapture);
|
|
800
|
+
}).map(([type]) => type);
|
|
801
|
+
if (!methods.some(([type, value]) => !excludedPaymentMethodTypes.includes(type) &&
|
|
802
|
+
recordOf(value).available === true && recordOf(recordOf(value).display_preference).value === 'on')) {
|
|
803
|
+
throw configurationError('No enabled Stripe payment method supports this purchase and its future payments.', 'PRISM_PAYMENT_METHOD_FLOW_UNSUPPORTED');
|
|
804
|
+
}
|
|
805
|
+
return { paymentMethodConfigurationId: selectedId, excludedPaymentMethodTypes };
|
|
806
|
+
}
|
|
752
807
|
async createPayment(input) {
|
|
753
808
|
this.assertOperation(input);
|
|
754
809
|
if (input.methodSelection.kind !== 'interactive_dynamic' || input.reusableReference) {
|
|
@@ -758,6 +813,7 @@ class PrismStripeConnector {
|
|
|
758
813
|
throw configurationError('Interactive Stripe checkout requires a publishable key.', 'PRISM_PUBLISHABLE_KEY_REQUIRED');
|
|
759
814
|
}
|
|
760
815
|
try {
|
|
816
|
+
const methodSelection = await this.checkoutPaymentMethodSelection(input);
|
|
761
817
|
const response = await this.dependencies.merchantAuthentication.createClientAuthenticationToken({
|
|
762
818
|
merchantClientSessionId: input.idempotencyKey,
|
|
763
819
|
testMode: this.options.environment === 'test',
|
|
@@ -771,7 +827,9 @@ class PrismStripeConnector {
|
|
|
771
827
|
captureMethod: input.metadata.alphaweb_capture_method === 'manual'
|
|
772
828
|
? proto_1.types.CaptureMethod.MANUAL
|
|
773
829
|
: proto_1.types.CaptureMethod.AUTOMATIC,
|
|
774
|
-
paymentMethodConfigurationId:
|
|
830
|
+
paymentMethodConfigurationId: methodSelection?.paymentMethodConfigurationId ??
|
|
831
|
+
input.methodSelection.paymentMethodConfigurationId,
|
|
832
|
+
excludedPaymentMethodTypes: methodSelection?.excludedPaymentMethodTypes,
|
|
775
833
|
merchantMetadata: operationMetadata(input),
|
|
776
834
|
},
|
|
777
835
|
});
|
|
@@ -838,7 +896,7 @@ class PrismStripeConnector {
|
|
|
838
896
|
? proto_1.types.CaptureMethod.MANUAL
|
|
839
897
|
: proto_1.types.CaptureMethod.AUTOMATIC,
|
|
840
898
|
connectorCustomerId: reference.connectorCustomerId,
|
|
841
|
-
paymentMethodType: reusablePaymentMethodProfile(paymentMethod.type).prismPaymentMethodType,
|
|
899
|
+
paymentMethodType: reusablePaymentMethodProfile(paymentMethod.type, input.metadata.alphaweb_capture_method === 'manual').prismPaymentMethodType,
|
|
842
900
|
offSession: true,
|
|
843
901
|
metadata: secret(JSON.stringify(operationMetadata(input))),
|
|
844
902
|
});
|
|
@@ -892,7 +950,7 @@ class PrismStripeConnector {
|
|
|
892
950
|
paymentMethod.livemode !== reference.livemode) {
|
|
893
951
|
throw configurationError('Existing Stripe PaymentIntent is not eligible for this retry.', 'PRISM_RETRY_OWNERSHIP');
|
|
894
952
|
}
|
|
895
|
-
reusablePaymentMethodProfile(paymentMethod.type);
|
|
953
|
+
reusablePaymentMethodProfile(paymentMethod.type, input.metadata.alphaweb_capture_method === 'manual');
|
|
896
954
|
const body = new URLSearchParams({
|
|
897
955
|
payment_method: reference.connectorPaymentMethodId,
|
|
898
956
|
off_session: 'true',
|
|
@@ -989,7 +1047,7 @@ class PrismStripeConnector {
|
|
|
989
1047
|
}
|
|
990
1048
|
const requested = new Set(input.purposes);
|
|
991
1049
|
const capabilities = ['off_session'];
|
|
992
|
-
if (requested.has('post_purchase') && profile
|
|
1050
|
+
if (requested.has('post_purchase') && supportsStripeFutureUse(profile, ['post_purchase'])) {
|
|
993
1051
|
capabilities.push('post_purchase', 'manual_capture');
|
|
994
1052
|
}
|
|
995
1053
|
if (requested.has('subscription'))
|
|
@@ -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: 105630648 bytes
|
|
4
|
+
sha256: 93607402e9d0d7ffa2a03ca3c6ca04573d10d767acc8dca694864c2f65280ffc
|
|
@@ -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
|
|
|
@@ -14624,6 +14793,9 @@ export namespace types {
|
|
|
14624
14793
|
|
|
14625
14794
|
/** PaymentClientAuthenticationContext merchantMetadata */
|
|
14626
14795
|
merchantMetadata?: ({ [k: string]: string }|null);
|
|
14796
|
+
|
|
14797
|
+
/** Flow-specific exclusions; empty retains the connector's dynamic defaults. */
|
|
14798
|
+
excludedPaymentMethodTypes?: (string[]|null);
|
|
14627
14799
|
}
|
|
14628
14800
|
|
|
14629
14801
|
/** Payment-specific context for client authentication token creation */
|
|
@@ -14674,6 +14846,9 @@ export namespace types {
|
|
|
14674
14846
|
/** PaymentClientAuthenticationContext merchantMetadata. */
|
|
14675
14847
|
public merchantMetadata: { [k: string]: string };
|
|
14676
14848
|
|
|
14849
|
+
/** Flow-specific exclusions; empty retains the connector's dynamic defaults. */
|
|
14850
|
+
public excludedPaymentMethodTypes: string[];
|
|
14851
|
+
|
|
14677
14852
|
/**
|
|
14678
14853
|
* Creates a new PaymentClientAuthenticationContext instance using the specified properties.
|
|
14679
14854
|
* @param [properties] Properties to set
|
|
@@ -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
|
/**
|
|
@@ -45486,6 +45916,7 @@ $root.types = (function() {
|
|
|
45486
45916
|
* @property {types.CaptureMethod|null} [captureMethod] PaymentClientAuthenticationContext captureMethod
|
|
45487
45917
|
* @property {string|null} [paymentMethodConfigurationId] PaymentClientAuthenticationContext paymentMethodConfigurationId
|
|
45488
45918
|
* @property {Object.<string,string>|null} [merchantMetadata] PaymentClientAuthenticationContext merchantMetadata
|
|
45919
|
+
* @property {Array.<string>|null} [excludedPaymentMethodTypes] Flow-specific exclusions; empty retains the connector's dynamic defaults.
|
|
45489
45920
|
*/
|
|
45490
45921
|
|
|
45491
45922
|
/**
|
|
@@ -45498,6 +45929,7 @@ $root.types = (function() {
|
|
|
45498
45929
|
*/
|
|
45499
45930
|
function PaymentClientAuthenticationContext(properties) {
|
|
45500
45931
|
this.merchantMetadata = {};
|
|
45932
|
+
this.excludedPaymentMethodTypes = [];
|
|
45501
45933
|
if (properties)
|
|
45502
45934
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
45503
45935
|
if (properties[keys[i]] != null && keys[i] !== "__proto__")
|
|
@@ -45608,6 +46040,14 @@ $root.types = (function() {
|
|
|
45608
46040
|
*/
|
|
45609
46041
|
PaymentClientAuthenticationContext.prototype.merchantMetadata = $util.emptyObject;
|
|
45610
46042
|
|
|
46043
|
+
/**
|
|
46044
|
+
* Flow-specific exclusions; empty retains the connector's dynamic defaults.
|
|
46045
|
+
* @member {Array.<string>} excludedPaymentMethodTypes
|
|
46046
|
+
* @memberof types.PaymentClientAuthenticationContext
|
|
46047
|
+
* @instance
|
|
46048
|
+
*/
|
|
46049
|
+
PaymentClientAuthenticationContext.prototype.excludedPaymentMethodTypes = $util.emptyArray;
|
|
46050
|
+
|
|
45611
46051
|
// OneOf field names bound to virtual getters and setters
|
|
45612
46052
|
var $oneOfFields;
|
|
45613
46053
|
|
|
@@ -45732,6 +46172,9 @@ $root.types = (function() {
|
|
|
45732
46172
|
if (message.merchantMetadata != null && Object.hasOwnProperty.call(message, "merchantMetadata"))
|
|
45733
46173
|
for (var keys = Object.keys(message.merchantMetadata), i = 0; i < keys.length; ++i)
|
|
45734
46174
|
writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.merchantMetadata[keys[i]]).ldelim();
|
|
46175
|
+
if (message.excludedPaymentMethodTypes != null && message.excludedPaymentMethodTypes.length)
|
|
46176
|
+
for (var i = 0; i < message.excludedPaymentMethodTypes.length; ++i)
|
|
46177
|
+
writer.uint32(/* id 14, wireType 2 =*/114).string(message.excludedPaymentMethodTypes[i]);
|
|
45735
46178
|
return writer;
|
|
45736
46179
|
};
|
|
45737
46180
|
|
|
@@ -45832,6 +46275,12 @@ $root.types = (function() {
|
|
|
45832
46275
|
message.merchantMetadata[key] = value;
|
|
45833
46276
|
break;
|
|
45834
46277
|
}
|
|
46278
|
+
case 14: {
|
|
46279
|
+
if (!(message.excludedPaymentMethodTypes && message.excludedPaymentMethodTypes.length))
|
|
46280
|
+
message.excludedPaymentMethodTypes = [];
|
|
46281
|
+
message.excludedPaymentMethodTypes.push(reader.string());
|
|
46282
|
+
break;
|
|
46283
|
+
}
|
|
45835
46284
|
default:
|
|
45836
46285
|
reader.skipType(tag & 7, long);
|
|
45837
46286
|
break;
|
|
@@ -46316,6 +46765,13 @@ $root.types = (function() {
|
|
|
46316
46765
|
if (!$util.isString(message.merchantMetadata[key[i]]))
|
|
46317
46766
|
return "merchantMetadata: string{k:string} expected";
|
|
46318
46767
|
}
|
|
46768
|
+
if (message.excludedPaymentMethodTypes != null && Object.hasOwnProperty.call(message, "excludedPaymentMethodTypes")) {
|
|
46769
|
+
if (!Array.isArray(message.excludedPaymentMethodTypes))
|
|
46770
|
+
return "excludedPaymentMethodTypes: array expected";
|
|
46771
|
+
for (var i = 0; i < message.excludedPaymentMethodTypes.length; ++i)
|
|
46772
|
+
if (!$util.isString(message.excludedPaymentMethodTypes[i]))
|
|
46773
|
+
return "excludedPaymentMethodTypes: string[] expected";
|
|
46774
|
+
}
|
|
46319
46775
|
return null;
|
|
46320
46776
|
};
|
|
46321
46777
|
|
package/package.json
CHANGED