From 87ce558d63405241f6b3c9b59d7a3bb550dff071 Mon Sep 17 00:00:00 2001 From: "Balachandiran E (CW)" Date: Tue, 31 Mar 2026 22:27:54 +0530 Subject: [PATCH] add processing_instruction to OrderRequest --- doc/models/order-request.md | 1 + doc/models/processing-instruction.md | 16 ++++++++++++++++ src/index.ts | 1 + src/models/orderRequest.ts | 10 ++++++++++ src/models/processingInstruction.ts | 25 +++++++++++++++++++++++++ 5 files changed, 53 insertions(+) create mode 100644 doc/models/processing-instruction.md create mode 100644 src/models/processingInstruction.ts diff --git a/doc/models/order-request.md b/doc/models/order-request.md index 4426144..93940b4 100644 --- a/doc/models/order-request.md +++ b/doc/models/order-request.md @@ -16,6 +16,7 @@ The order request details. | `purchaseUnits` | [`PurchaseUnitRequest[]`](../../doc/models/purchase-unit-request.md) | Required | An array of purchase units. Each purchase unit establishes a contract between a payer and the payee. Each purchase unit represents either a full or partial order that the payer intends to purchase from the payee.

**Constraints**: *Minimum Items*: `1`, *Maximum Items*: `10` | | `paymentSource` | [`PaymentSource \| undefined`](../../doc/models/payment-source.md) | Optional | The payment source definition. | | `applicationContext` | [`OrderApplicationContext \| undefined`](../../doc/models/order-application-context.md) | Optional | Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values. | +| `processingInstruction` | [`ProcessingInstruction \| undefined`](../../doc/models/processing-instruction.md) | Optional | The instruction to process an order. | ## Example (as JSON) diff --git a/doc/models/processing-instruction.md b/doc/models/processing-instruction.md new file mode 100644 index 0000000..11589de --- /dev/null +++ b/doc/models/processing-instruction.md @@ -0,0 +1,16 @@ + +# Processing Instruction + +The instruction to process an order. + +## Enumeration + +`ProcessingInstruction` + +## Fields + +| Name | Description | +| --- | --- | +| `OrderCompleteOnPaymentApproval` | API Caller expects the Order to be auto completed (i.e. for PayPal to authorize or capture depending on the intent) on completion of payer approval. This option is not relevant for payment_source that typically do not require a payer approval or interaction. | +| `NoInstruction` | The API caller intends to authorize or capture the order after the payer approves it. | + diff --git a/src/index.ts b/src/index.ts index 7b6faad..a91a993 100644 --- a/src/index.ts +++ b/src/index.ts @@ -273,6 +273,7 @@ export type { PricingScheme } from './models/pricingScheme.js'; export type { PricingTier } from './models/pricingTier.js'; export type { ProcessorResponse } from './models/processorResponse.js'; export { ProcessorResponseCode } from './models/processorResponseCode.js'; +export { ProcessingInstruction } from './models/processingInstruction.js'; export type { PurchaseUnit } from './models/purchaseUnit.js'; export type { PurchaseUnitRequest } from './models/purchaseUnitRequest.js'; export { ReasonCode } from './models/reasonCode.js'; diff --git a/src/models/orderRequest.ts b/src/models/orderRequest.ts index 312de95..b301f59 100644 --- a/src/models/orderRequest.ts +++ b/src/models/orderRequest.ts @@ -15,6 +15,10 @@ import { } from './orderApplicationContext.js'; import { Payer, payerSchema } from './payer.js'; import { PaymentSource, paymentSourceSchema } from './paymentSource.js'; +import { + ProcessingInstruction, + processingInstructionSchema, +} from './processingInstruction.js'; import { PurchaseUnitRequest, purchaseUnitRequestSchema, @@ -32,6 +36,8 @@ export interface OrderRequest { paymentSource?: PaymentSource; /** Customizes the payer experience during the approval process for the payment with PayPal. Note: Partners and Marketplaces might configure brand_name and shipping_preference during partner account setup, which overrides the request values. */ applicationContext?: OrderApplicationContext; + /** The instruction to process an order. */ + processingInstruction?: ProcessingInstruction; } export const orderRequestSchema: Schema = lazy(() => @@ -44,5 +50,9 @@ export const orderRequestSchema: Schema = lazy(() => 'application_context', optional(orderApplicationContextSchema), ], + processingInstruction: [ + 'processing_instruction', + optional(processingInstructionSchema), + ], }) ); diff --git a/src/models/processingInstruction.ts b/src/models/processingInstruction.ts new file mode 100644 index 0000000..422dbec --- /dev/null +++ b/src/models/processingInstruction.ts @@ -0,0 +1,25 @@ +/** + * PayPal Server SDKLib + * + * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). + */ + +import { Schema, stringEnum } from '../schema.js'; + +/** + * Enum for ProcessingInstruction + */ +export enum ProcessingInstruction { + /** API Caller expects the Order to be auto completed (i.e. for PayPal to authorize or capture depending on the intent) on completion of payer approval. This option is not relevant for payment_source that typically do not require a payer approval or interaction. */ + OrderCompleteOnPaymentApproval = 'ORDER_COMPLETE_ON_PAYMENT_APPROVAL', + /** The API caller intends to authorize v2/checkout/orders/{id}/authorize or capture v2/checkout/orders/{id}/capture after the payer approves the order. */ + NoInstruction = 'NO_INSTRUCTION', +} + +/** + * Schema for ProcessingInstruction + */ +export const processingInstructionSchema: Schema = stringEnum( + ProcessingInstruction, + true +);