-
Notifications
You must be signed in to change notification settings - Fork 99
Feature/paymentlinks #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feature/paymentlinks #78
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove Note: 'DONATION' type has limited support and may cause validation errors.
| """ | ||
| Validate payment link type | ||
| """ | ||
| supported_types = ['BUY_NOW', 'DONATION'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove: 'DONATION'
| "field": "type" | ||
| } | ||
|
|
||
| if payment_type == 'DONATION': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove DONATION
| }; | ||
| } | ||
|
|
||
| if (type === 'DONATION') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"
)
perumalcsbe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.