Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/models/order-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br><br>**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)

Expand Down
16 changes: 16 additions & 0 deletions doc/models/processing-instruction.md
Original file line number Diff line number Diff line change
@@ -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. |

1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
10 changes: 10 additions & 0 deletions src/models/orderRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<OrderRequest> = lazy(() =>
Expand All @@ -44,5 +50,9 @@ export const orderRequestSchema: Schema<OrderRequest> = lazy(() =>
'application_context',
optional(orderApplicationContextSchema),
],
processingInstruction: [
'processing_instruction',
optional(processingInstructionSchema),
],
})
);
25 changes: 25 additions & 0 deletions src/models/processingInstruction.ts
Original file line number Diff line number Diff line change
@@ -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<ProcessingInstruction> = stringEnum(
ProcessingInstruction,
true
);