Conversation
| class UpdatePaymentLinkParameters(BaseModel): | ||
| """Parameters for updating a payment link (full replacement)""" | ||
| payment_link_id: str = Field(..., pattern=PAYMENT_LINK_ID_REGEX, description="The PayPal Payment Link ID to update. Format: PLB-XXXXXXXXXXXX (PLB- prefix followed by 12-16 alphanumeric characters). Example: 'PLB-1A2B3C4D5E6F'") | ||
| integration_mode: str = Field(default="LINK", description="The integration mode for the payment link. Default and recommended: 'LINK'.") |
There was a problem hiding this comment.
remove Note: 'DONATION' type has limited support and may cause validation errors.
| """ | ||
| Validate payment link type | ||
| """ | ||
| supported_types = ['BUY_NOW', 'DONATION'] |
| "field": "type" | ||
| } | ||
|
|
||
| if payment_type == 'DONATION': |
typescript/src/shared/parameters.ts
Outdated
|
|
||
| export const updatePaymentLinkParameters = (context: Context) => z.object({ | ||
| payment_link_id: z.string().regex(PAYMENT_LINK_ID_REGEX, "Invalid PayPal Payment Link ID").describe('The PayPal Payment Link ID to update. Format: PLB-XXXXXXXXXXXX (PLB- prefix followed by 12-16 alphanumeric characters). Example: "PLB-1A2B3C4D5E6F"'), | ||
| type: z.string().describe('The type of payment link. Use "BUY_NOW" for standard e-commerce purchases (fully supported). Note: "DONATION" type has limited support and may cause validation errors.'), |
There was a problem hiding this comment.
remove Note: 'DONATION' type has limited support and may cause validation errors.
typescript/src/shared/parameters.ts
Outdated
|
|
||
| export const createPaymentLinkParameters = (context: Context) => z.object({ | ||
| integration_mode: z.string().optional().default('LINK').describe('The integration mode for the payment link. Default and recommended: "LINK". This determines how the payment link is presented.'), | ||
| type: z.string().describe('The type of payment link. Use "BUY_NOW" for standard e-commerce purchases (fully supported). Note: "DONATION" type has limited support and may cause validation errors.'), |
There was a problem hiding this comment.
remove Note: 'DONATION' type has limited support and may cause validation errors.
| * Validate payment link type | ||
| */ | ||
| export function validatePaymentLinkType(type: string): ValidationResult { | ||
| const supportedTypes = ['BUY_NOW', 'DONATION']; |
| }; | ||
| } | ||
|
|
||
| if (type === 'DONATION') { |
typescript/src/shared/prompts.ts
Outdated
|
|
||
| This function permanently deletes a payment link. Once deleted, the shareable link URL will no longer work and the operation cannot be undone. Use with caution. | ||
|
|
||
| Note: PayPal API may return a 500 error instead of 404 for non-existent payment link IDs. This is expected API behavior. |
There was a problem hiding this comment.
500 ?
Delete a payment link created through the PayPal Pay Links & Buttons API.
This operation deactivates the payment link so it can no longer be used by customers.
Once deleted, the shareable link URL will stop working.
### Important notes
- Deletion removes the payment resource from active use. A deleted link cannot be used for future payments.
- If an invalid or non-existent payment link ID is provided, the PayPal API may return a 404 Not Found error.
- This operation does not affect completed transactions tied to the link.
### Required fields
- `id`: Unique identifier of the payment link you want to delete.
### Example usage
To delete a payment link:
delete_payment_link(
id="PR-1234567890"
)
Mister-g666
left a comment
There was a problem hiding this comment.
curl -v -X POST https://api-m.sandbox.paypal.com/v2/checkout/orders
-H 'Content-Type: application/json'
-H 'Authorization: Bearer ACCESS-TOKEN'
-H 'PayPal-Partner-Attribution-Id: BN-CODE'
-H 'PayPal-Auth-Assertion: AUTH-ASSERTION-JWT'
-H 'PayPal-Request-Id: REQUEST-ID'
-d '{
"intent": "CAPTURE",
"payer": {
"name": {
"given_name": "Firstname",
"surname": "Lastname"
},
"address": {
"address_line_1": "123 Main St.",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "12345",
"country_code": "US"
}
},
"purchase_units": [
{
"reference_id": "Reference_ID_L2L32",
"description": "Description of PU",
"custom_id": "Custom-ID",
"soft_descriptor": "Purchase Descriptor",
"invoice_id": "INV_202302011234",
"supplementary_data": {
"card": {
"level_2": {
"invoice_id": "INV_202302011234",
"tax_total": {
"currency_code": "USD",
"value": "5.20"
}
},
"level_3": {
"shipping_amount": {
"currency_code": "USD",
"value": "1.17"
},
"duty_amount": {
"currency_code": "USD",
"value": "1.16"
},
"discount_amount": {
"currency_code": "USD",
"value": "1.15"
},
"shipping_address": {
"address_line_1": "123 Main St.",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "12345",
"country_code": "US"
},
"ships_from_postal_code": "12345",
"line_items": [
{
"name": "Item1",
"description": "Description of Item1",
"upc": {
"type": "UPC-A",
"code": "001004697"
},
"unit_amount": {
"currency_code": "USD",
"value": "9.50"
},
"tax": {
"currency_code": "USD",
"value": "5.12"
},
"discount_amount": {
"currency_code": "USD",
"value": "1.11"
},
"total_amount": {
"currency_code": "USD",
"value": "95.10"
},
"unit_of_measure": "POUND_GB_US",
"quantity": "10",
"commodity_code": "98756"
}
]
}
}
},
"amount": {
"currency_code": "USD",
"value": "100.30",
"breakdown": {
"item_total": {
"currency_code": "USD",
"value": "90.20"
},
"tax_total": {
"currency_code": "USD",
"value": "10.10"
},
"shipping": {
"currency_code": "USD",
"value": "10.00"
},
"discount": {
"currency_code": "USD",
"value": "10.00"
}
}
},
"items": [
{
"name": "Item1",
"description": "Description of Item1",
"sku": "SKU - 0",
"url": "http: //example.com",
"unit_amount": {
"currency_code": "USD",
"value": "45.10"
},
"tax": {
"currency_code": "USD",
"value": "5.05"
},
"quantity": "2",
"category": "PHYSICAL_GOODS"
}
],
"shipping": {
"address": {
"address_line_1": "123 Main St.",
"admin_area_2": "Anytown",
"admin_area_1": "CA",
"postal_code": "12345",
"country_code": "US"
}
}
}
]
}'
No description provided.