Skip to content

Commit ce0fc4b

Browse files
authored
Merge pull request #5 from NavinPayPal/main
Adding AI Migration Prompt Kit
2 parents 8c7d631 + d818740 commit ce0fc4b

File tree

1 file changed

+156
-0
lines changed

1 file changed

+156
-0
lines changed

PROMPTKIT.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
<div style="background-color:#09326C; color:white; padding:10px; display:flex; align-items:center; height:100%;">
2+
<h2 style="margin-top:4px; margin-bottom:4px; border-bottom:none; font-family:Arial;">
3+
<b>PayPal AI Migration Assistant PromptKit</b>
4+
</h2>
5+
</div>
6+
7+
This Al PromptKit provides ready-to-use prompts for GitHub Copilot Chat to help you migrate from PayPal's legacy NVP/SOAP APIs to the modern REST APIs.
8+
9+
<h2 style="color:#09326C; font-family:Arial;">
10+
<b>Installation</b>
11+
</h2>
12+
13+
1. Start by installing the VS Code Editor.
14+
2. Visit the [VS Code extension marketplace](https://marketplace.visualstudio.com/vscode) or open the Extensions view in the VS Code Integrated Development Environment (IDE).
15+
3. In the Extensions view, enter PayPal in the search bar.
16+
4. Select "Install" to add the extension to your VS Code.
17+
5. Once the extension is installed, click on the Paypal icon on the side navigation or tag <b>@paypal-migration-assistant<b> inside co-pilot chat to start AI migration feature.
18+
19+
<h2 style="color:#09326C; font-family:Arial;">
20+
<b>Migration Prompts Examples</b>
21+
</h2>
22+
23+
1. **Convert Selected Code to PayPal REST API**
24+
25+
- When to use: When you have a specific section of code using NVP/SOAP APIs that you want to convert to REST.
26+
- Instructions:
27+
28+
- Select the code in your editor
29+
- Copy this prompt into GitHub Copilot Chat:
30+
31+
```
32+
Can you convert the selected code to its PayPal REST API equivalent?
33+
```
34+
35+
2. **Understand Parameter Mapping**
36+
37+
- When to use: When you need to understand how specific parameters map between NVP/SOAP and REST APIs.
38+
- Instructions:
39+
40+
- Copy this prompt into GitHub Copilot Chat:
41+
42+
```
43+
What is parameter mapping with PayPal REST API?
44+
```
45+
46+
- If you want to have the mapping explained, use this prompt:
47+
48+
```
49+
For the selected NVP/SOAP code and the PayPal REST API,
50+
identify and explain the mapping of specific parameters between the two API styles.
51+
```
52+
53+
</div>
54+
55+
- Pro tip: For mapping specific parameters, add the following to your query:
56+
57+
- Copy this prompt into GitHub Copilot Chat:
58+
59+
```
60+
What is parameter mapping with PayPal REST API for PAYMENTREQUEST_0_AMT and PAYMENTREQUEST_0_CURRENCYCODE?
61+
```
62+
63+
3. **Convert NVP/SOAP Payload to REST**
64+
65+
- When to use: When you have a specific payload you want to convert to the REST format.
66+
- Instructions:
67+
68+
- Select the NVP/SOAP payload in your editor or enter your payload in the chat
69+
- Copy this prompt into GitHub Copilot Chat:
70+
71+
```
72+
Given this NVP Payload, convert it to the equivalent JSON structure suitable for a REST API request.
73+
```
74+
75+
4. **Convert Code with File Restructuring**
76+
77+
- When to use: When converting larger sections of code that might benefit from being split into multiple files.
78+
- Instructions:
79+
80+
- Select the code in your editor
81+
- Copy this prompt into GitHub Copilot Chat:
82+
83+
```
84+
Analyze the selected code section for potential modularization during its conversion to Paypal REST API.
85+
Identify logical components that could be separated into distinct files in the resulting RESTful implementation.
86+
```
87+
88+
5. **Create REST API Client Class**
89+
90+
- When to use: When you need a reusable REST API client class for your PayPal integration.
91+
- Instructions:
92+
93+
- Copy this prompt into GitHub Copilot Chat:
94+
95+
```
96+
Generate a reusable client class in [language] for interacting with the PayPal REST API,
97+
including methods for payments and refunds.
98+
Ensure the class handles authentication, request formatting (JSON), and basic response handling.
99+
```
100+
101+
6. **Add Error Handling for REST API**
102+
103+
- When to use: When you need robust error handling for your REST API integration.
104+
- Instructions:
105+
106+
- Select your REST API code (if any)
107+
- Copy this prompt into GitHub Copilot Chat:
108+
109+
```
110+
Can you enhance this code with comprehensive error handling for PayPal REST API calls?
111+
```
112+
113+
<h2 style="color:#09326C; font-family:Arial;">
114+
<b>Common Migration Challenges and Solutions</b>
115+
</h2>
116+
117+
- **Authentication**
118+
119+
- NVP/SOAP uses API signatures, while REST uses OAuth 2.0.
120+
- Use this prompt:
121+
122+
- Copy this prompt into GitHub Copilot Chat:
123+
124+
```
125+
Show me the step-by-step process and provide a code example in [language] for
126+
implementing PayPal REST API OAuth 2.0 authentication to replace my existing NVP/SOAP authentication method.
127+
```
128+
129+
- **Sandbox Testing**
130+
131+
- Use this prompt to update your sandbox testing approach:
132+
133+
- Copy this prompt into GitHub Copilot Chat:
134+
135+
```
136+
Guide me through setting up a comprehensive PayPal REST API sandbox testing environment to replace my existing NVP/SOAP sandbox testing.
137+
Include steps for, but not limited to creating sandbox accounts, generating API credentials
138+
([mention specific steps you want to include]), and verifying the behavior of my application with the new REST API
139+
```
140+
141+
<h2 style="color:#09326C; font-family:Arial;">
142+
<b>Migration Best Practices</b>
143+
</h2>
144+
145+
- Migrate incrementally - Convert one endpoint or feature at a time
146+
- Maintain parallel implementations - Keep both API implementations running during transition
147+
- Test thoroughly - Ensure each migrated component works correctly before proceeding
148+
- Update documentation - Keep your internal documentation updated as you migrate
149+
- Monitor errors - Pay close attention to error rates during and after migration
150+
151+
<h2 style="color:#09326C; font-family:Arial;">
152+
<b>Additional Resources</b>
153+
</h2>
154+
155+
- [PayPal REST API Documentation](https://developer.paypal.com/api/rest/)
156+
- [PayPal API GitHub Samples](https://github.com/paypal-examples)

0 commit comments

Comments
 (0)