Question on PHP server side API found at https://github.com/paypal/Checkout-PHP-SDK

arcomber
Contributor
Contributor

I have a question on how to get started on the latest PHP SDK, is this the correct place to post?  The other relevant forum was REST APIs.  Is that different?

 

Anyway, I have dowloaded the SDK and edited samples/PayPalClient.php and added my client ID and secret as in these lines:

$clientId = getenv("CLIENT_ID") ?: "I added my client id here";
$clientSecret = getenv("CLIENT_SECRET") ?: "and my secret here";

 

I made a copy of samples/CaptureIntentExamples/CreateOrder.php and renamed to MyCreateOder.php.

 

When I open a web browser and navigate to MyCreateOrder.php I see:

Status Code: 201
Status: CREATED
Order ID: <removed>BS875062H
Intent: CAPTURE
Links:
self: https://api.sandbox.paypal.com/v2/checkout/orders/<removed>BS875062H Call Type: GET
approve: https://www.sandbox.paypal.com/checkoutnow?token=<removed>BS875062H Call Type: GET
update: https://api.sandbox.paypal.com/v2/checkout/orders/84102147BS875062H Call Type: PATCH
capture: https://api.sandbox.paypal.com/v2/checkout/orders/84102147BS875062H/capture Call Type: POST
{
"id": "<removed>BS875062H",
"intent": "CAPTURE",
"status": "CREATED",
"purchase_units": [

etc

 

Which all looks right.  Is that the correct way to get started?

 

But I am new to this and a lot of the terms don't mean much to me.  Eg 'intent' => 'CAPTURE'  Where do I find help on these terms.  A basic tutorial would also be very useful.

 

Any help would be much appreciated.

 

Angus

 

 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.