diff --git a/.gitignore b/.gitignore
index c889f486..42d24751 100644
--- a/.gitignore
+++ b/.gitignore
@@ -59,6 +59,7 @@ typings/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
+__pycache__/
# Optional REPL history
.node_repl_history
diff --git a/advanced-integration/v2/server/dotnet/PayPalAdvancedIntegration.csproj b/advanced-integration/v2/server/dotnet/PayPalAdvancedIntegration.csproj
index f6f261a2..c086ae30 100644
--- a/advanced-integration/v2/server/dotnet/PayPalAdvancedIntegration.csproj
+++ b/advanced-integration/v2/server/dotnet/PayPalAdvancedIntegration.csproj
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/advanced-integration/v2/server/dotnet/Server.cs b/advanced-integration/v2/server/dotnet/Server.cs
index 186de46f..2b4a1c4f 100644
--- a/advanced-integration/v2/server/dotnet/Server.cs
+++ b/advanced-integration/v2/server/dotnet/Server.cs
@@ -116,7 +116,7 @@ private async Task _CreateOrder(dynamic cart)
CheckoutPaymentIntent intent = (CheckoutPaymentIntent)
Enum.Parse(typeof(CheckoutPaymentIntent), "CAPTURE", true);
- OrdersCreateInput ordersCreateInput = new OrdersCreateInput
+ CreateOrderInput createOrderInput = new CreateOrderInput
{
Body = new OrderRequest
{
@@ -131,7 +131,7 @@ private async Task _CreateOrder(dynamic cart)
},
};
- ApiResponse result = await _ordersController.OrdersCreateAsync(ordersCreateInput);
+ ApiResponse result = await _ordersController.CreateOrderAsync(createOrderInput);
return result;
}
@@ -152,9 +152,9 @@ public async Task CaptureOrder(string orderID)
private async Task _CaptureOrder(string orderID)
{
- OrdersCaptureInput ordersCaptureInput = new OrdersCaptureInput { Id = orderID, };
+ CaptureOrderInput ordersCaptureInput = new CaptureOrderInput { Id = orderID, };
- ApiResponse result = await _ordersController.OrdersCaptureAsync(ordersCaptureInput);
+ ApiResponse result = await _ordersController.CaptureOrderAsync(ordersCaptureInput);
return result;
}
diff --git a/advanced-integration/v2/server/java/pom.xml b/advanced-integration/v2/server/java/pom.xml
index 8e1872cc..ef04e9c0 100644
--- a/advanced-integration/v2/server/java/pom.xml
+++ b/advanced-integration/v2/server/java/pom.xml
@@ -48,7 +48,7 @@
paypal-server-sdk
- 0.6.0
+ 1.0.0
diff --git a/advanced-integration/v2/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java b/advanced-integration/v2/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
index 742928ef..49e6dd47 100644
--- a/advanced-integration/v2/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
+++ b/advanced-integration/v2/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
@@ -25,8 +25,8 @@
import com.paypal.sdk.models.CheckoutPaymentIntent;
import com.paypal.sdk.models.Order;
import com.paypal.sdk.models.OrderRequest;
-import com.paypal.sdk.models.OrdersCaptureInput;
-import com.paypal.sdk.models.OrdersCreateInput;
+import com.paypal.sdk.models.CaptureOrderInput;
+import com.paypal.sdk.models.CreateOrderInput;
import com.paypal.sdk.models.PurchaseUnitRequest;
import java.util.Arrays;
import org.slf4j.event.Level;
@@ -107,7 +107,7 @@ public ResponseEntity captureOrder(@PathVariable String orderID) {
private Order createOrder(String cart) throws IOException, ApiException {
- OrdersCreateInput ordersCreateInput = new OrdersCreateInput.Builder(
+ CreateOrderInput createOrderInput = new CreateOrderInput.Builder(
null,
new OrderRequest.Builder(
CheckoutPaymentIntent.CAPTURE,
@@ -123,18 +123,18 @@ private Order createOrder(String cart) throws IOException, ApiException {
OrdersController ordersController = client.getOrdersController();
- ApiResponse apiResponse = ordersController.ordersCreate(ordersCreateInput);
+ ApiResponse apiResponse = ordersController.createOrder(createOrderInput);
return apiResponse.getResult();
}
private Order captureOrders(String orderID) throws IOException, ApiException {
- OrdersCaptureInput ordersCaptureInput = new OrdersCaptureInput.Builder(
+ CaptureOrderInput ordersCaptureInput = new CaptureOrderInput.Builder(
orderID,
null)
.build();
OrdersController ordersController = client.getOrdersController();
- ApiResponse apiResponse = ordersController.ordersCapture(ordersCaptureInput);
+ ApiResponse apiResponse = ordersController.captureOrder(ordersCaptureInput);
return apiResponse.getResult();
}
}
diff --git a/advanced-integration/v2/server/node/package.json b/advanced-integration/v2/server/node/package.json
index 68765e3c..120f5b7d 100644
--- a/advanced-integration/v2/server/node/package.json
+++ b/advanced-integration/v2/server/node/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
- "@paypal/paypal-server-sdk": "^0.6.0",
+ "@paypal/paypal-server-sdk": "^1.0.0",
"body-parser": "^1.20.3",
"dotenv": "^16.3.1",
"express": "^4.18.2"
diff --git a/advanced-integration/v2/server/node/server.js b/advanced-integration/v2/server/node/server.js
index db41e0e6..3633923a 100644
--- a/advanced-integration/v2/server/node/server.js
+++ b/advanced-integration/v2/server/node/server.js
@@ -56,7 +56,7 @@ const createOrder = async (cart) => {
};
try {
- const { body, ...httpResponse } = await ordersController.ordersCreate(
+ const { body, ...httpResponse } = await ordersController.createOrder(
collect
);
// Get more response info...
@@ -84,7 +84,7 @@ const captureOrder = async (orderID) => {
};
try {
- const { body, ...httpResponse } = await ordersController.ordersCapture(
+ const { body, ...httpResponse } = await ordersController.captureOrder(
collect
);
// Get more response info...
diff --git a/advanced-integration/v2/server/php/composer.json b/advanced-integration/v2/server/php/composer.json
index 2355b143..4da469d0 100644
--- a/advanced-integration/v2/server/php/composer.json
+++ b/advanced-integration/v2/server/php/composer.json
@@ -4,7 +4,7 @@
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*",
- "paypal/paypal-server-sdk": "0.6.0"
+ "paypal/paypal-server-sdk": "1.0.0"
},
"require-dev": {
},
diff --git a/advanced-integration/v2/server/php/composer.lock b/advanced-integration/v2/server/php/composer.lock
index 62def940..6b63abbe 100644
--- a/advanced-integration/v2/server/php/composer.lock
+++ b/advanced-integration/v2/server/php/composer.lock
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f2e528a550aa0e8926b330dcdcfc67dc",
+ "content-hash": "e0fc9d83942f146aaa20785c7c614107",
"packages": [
{
"name": "apimatic/core",
- "version": "0.3.11",
+ "version": "0.3.14",
"source": {
"type": "git",
"url": "https://github.com/apimatic/core-lib-php.git",
- "reference": "2274f103f9f210664f546f504e4559d772a81fee"
+ "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/2274f103f9f210664f546f504e4559d772a81fee",
- "reference": "2274f103f9f210664f546f504e4559d772a81fee",
+ "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/c3eaad6cf0c00b793ce6d9bee8b87176247da582",
+ "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582",
"shasum": ""
},
"require": {
@@ -32,7 +32,7 @@
"psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0"
},
"require-dev": {
- "phan/phan": "5.4.2",
+ "phan/phan": "5.4.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
@@ -56,9 +56,9 @@
],
"support": {
"issues": "https://github.com/apimatic/core-lib-php/issues",
- "source": "https://github.com/apimatic/core-lib-php/tree/0.3.11"
+ "source": "https://github.com/apimatic/core-lib-php/tree/0.3.14"
},
- "time": "2024-07-08T11:50:08+00:00"
+ "time": "2025-02-27T06:03:30+00:00"
},
{
"name": "apimatic/core-interfaces",
@@ -105,16 +105,16 @@
},
{
"name": "apimatic/jsonmapper",
- "version": "3.1.4",
+ "version": "3.1.6",
"source": {
"type": "git",
"url": "https://github.com/apimatic/jsonmapper.git",
- "reference": "407b455d2adda2efa51a44b99400389fbee0394e"
+ "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/407b455d2adda2efa51a44b99400389fbee0394e",
- "reference": "407b455d2adda2efa51a44b99400389fbee0394e",
+ "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/c6cc21bd56bfe5d5822bbd08f514be465c0b24e7",
+ "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7",
"shasum": ""
},
"require": {
@@ -153,9 +153,9 @@
"support": {
"email": "mehdi.jaffery@apimatic.io",
"issues": "https://github.com/apimatic/jsonmapper/issues",
- "source": "https://github.com/apimatic/jsonmapper/tree/3.1.4"
+ "source": "https://github.com/apimatic/jsonmapper/tree/3.1.6"
},
- "time": "2024-06-11T11:48:30+00:00"
+ "time": "2024-11-28T09:15:32+00:00"
},
{
"name": "apimatic/unirest-php",
@@ -224,27 +224,27 @@
},
{
"name": "paypal/paypal-server-sdk",
- "version": "0.6.0",
+ "version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/paypal/PayPal-PHP-Server-SDK.git",
- "reference": "7d69e118998fdf2ae2cf234f1bd49f4248782380"
+ "reference": "66fd3341bbffafe7d650fe7d9d2699fabf355e67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paypal/PayPal-PHP-Server-SDK/zipball/7d69e118998fdf2ae2cf234f1bd49f4248782380",
- "reference": "7d69e118998fdf2ae2cf234f1bd49f4248782380",
+ "url": "https://api.github.com/repos/paypal/PayPal-PHP-Server-SDK/zipball/66fd3341bbffafe7d650fe7d9d2699fabf355e67",
+ "reference": "66fd3341bbffafe7d650fe7d9d2699fabf355e67",
"shasum": ""
},
"require": {
- "apimatic/core": "~0.3.11",
+ "apimatic/core": "~0.3.13",
"apimatic/core-interfaces": "~0.1.5",
"apimatic/unirest-php": "^4.0.0",
"ext-json": "*",
"php": "^7.2 || ^8.0"
},
"require-dev": {
- "phan/phan": "5.4.2",
+ "phan/phan": "5.4.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
@@ -261,9 +261,9 @@
"homepage": "https://github.com/paypal/PayPal-PHP-Server-SDK",
"support": {
"issues": "https://github.com/paypal/PayPal-PHP-Server-SDK/issues",
- "source": "https://github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0"
+ "source": "https://github.com/paypal/PayPal-PHP-Server-SDK/tree/1.0.0"
},
- "time": "2024-10-18T19:06:27+00:00"
+ "time": "2025-03-24T18:44:18+00:00"
},
{
"name": "php-jsonpointer/php-jsonpointer",
@@ -375,13 +375,13 @@
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.4 || ^8.0",
"ext-json": "*"
},
- "platform-dev": [],
+ "platform-dev": {},
"plugin-api-version": "2.6.0"
}
diff --git a/advanced-integration/v2/server/php/src/index.php b/advanced-integration/v2/server/php/src/index.php
index 551f7cda..5fe563a8 100644
--- a/advanced-integration/v2/server/php/src/index.php
+++ b/advanced-integration/v2/server/php/src/index.php
@@ -44,7 +44,7 @@ function createOrder($cart)
)->build()
];
- $apiResponse = $client->getOrdersController()->ordersCreate($orderBody);
+ $apiResponse = $client->getOrdersController()->createOrder($orderBody);
return handleResponse($apiResponse);
}
@@ -61,7 +61,7 @@ function captureOrder($orderID)
'id' => $orderID
];
- $apiResponse = $client->getOrdersController()->ordersCapture($captureBody);
+ $apiResponse = $client->getOrdersController()->captureOrder($captureBody);
return handleResponse($apiResponse);
}
diff --git a/advanced-integration/v2/server/python/requirements.txt b/advanced-integration/v2/server/python/requirements.txt
index aba5e4cd..361d7b0b 100644
--- a/advanced-integration/v2/server/python/requirements.txt
+++ b/advanced-integration/v2/server/python/requirements.txt
@@ -1,2 +1,2 @@
Flask==3.0.3
-paypal-server-sdk==0.6.0
\ No newline at end of file
+paypal-server-sdk==1.0.0
\ No newline at end of file
diff --git a/advanced-integration/v2/server/python/server.py b/advanced-integration/v2/server/python/server.py
index fed85ed5..09922c26 100644
--- a/advanced-integration/v2/server/python/server.py
+++ b/advanced-integration/v2/server/python/server.py
@@ -1,10 +1,13 @@
import logging
import os
-from flask import Flask, request
+from flask import Flask, Response, request
from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials
-from paypalserversdk.logging.configuration.api_logging_configuration import LoggingConfiguration, \
- RequestLoggingConfiguration, ResponseLoggingConfiguration
+from paypalserversdk.logging.configuration.api_logging_configuration import (
+ LoggingConfiguration,
+ RequestLoggingConfiguration,
+ ResponseLoggingConfiguration,
+)
from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
from paypalserversdk.controllers.orders_controller import OrdersController
from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown
@@ -17,8 +20,8 @@
paypal_client: PaypalServersdkClient = PaypalServersdkClient(
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
- o_auth_client_id=os.getenv('PAYPAL_CLIENT_ID'),
- o_auth_client_secret=os.getenv('PAYPAL_CLIENT_SECRET')
+ o_auth_client_id=os.getenv("PAYPAL_CLIENT_ID"),
+ o_auth_client_secret=os.getenv("PAYPAL_CLIENT_SECRET"),
),
logging_configuration=LoggingConfiguration(
log_level=logging.INFO,
@@ -26,61 +29,64 @@
# This should be set to True (the default if unset)in production.
mask_sensitive_headers=False,
request_logging_config=RequestLoggingConfiguration(
- log_headers=True,
- log_body=True
+ log_headers=True, log_body=True
),
response_logging_config=ResponseLoggingConfiguration(
- log_headers=True,
- log_body=True
- )
- )
+ log_headers=True, log_body=True
+ ),
+ ),
)
-'''
+"""
Health check
-'''
-@app.route('/', methods=['GET'])
+"""
+
+
+@app.route("/", methods=["GET"])
def index():
return {"message": "Server is running"}
+
orders_controller: OrdersController = paypal_client.orders
-'''
+"""
Create an order to start the transaction.
@see https://developer.paypal.com/docs/api/orders/v2/#orders_create
-'''
-@app.route('/api/orders', methods=['POST'])
+"""
+@app.route("/api/orders", methods=["POST"])
def create_order():
request_body = request.get_json()
# use the cart information passed from the front-end to calculate the order amount detals
- cart = request_body['cart']
- order = orders_controller.orders_create({
- "body": OrderRequest(
- intent=CheckoutPaymentIntent.CAPTURE,
- purchase_units=[
- PurchaseUnitRequest(
- AmountWithBreakdown(
- currency_code='USD',
- value='100.00'
- )
- )
- ]
- ),
- "prefer": 'return=representation'
- }
+ cart = request_body["cart"]
+ order = orders_controller.create_order(
+ {
+ "body": OrderRequest(
+ intent=CheckoutPaymentIntent.CAPTURE,
+ purchase_units=[
+ PurchaseUnitRequest(
+ AmountWithBreakdown(currency_code="USD", value="100.00")
+ )
+ ],
+ ),
+ "prefer": "return=representation",
+ }
+ )
+ return Response(
+ ApiHelper.json_serialize(order.body), status=200, mimetype="application/json"
)
- return ApiHelper.json_serialize(order.body)
-'''
+
+"""
Capture payment for the created order to complete the transaction.
@see https://developer.paypal.com/docs/api/orders/v2/#orders_capture
-'''
-@app.route('/api/orders//capture', methods=['POST'])
+"""
+@app.route("/api/orders//capture", methods=["POST"])
def capture_order(order_id):
- order = orders_controller.orders_capture({
- 'id': order_id,
- 'prefer': 'return=representation'
- })
- return ApiHelper.json_serialize(order.body)
\ No newline at end of file
+ order = orders_controller.capture_order(
+ {"id": order_id, "prefer": "return=representation"}
+ )
+ return Response(
+ ApiHelper.json_serialize(order.body), status=200, mimetype="application/json"
+ )
diff --git a/advanced-integration/v2/server/ruby/Gemfile b/advanced-integration/v2/server/ruby/Gemfile
index dc0cacba..8772983f 100644
--- a/advanced-integration/v2/server/ruby/Gemfile
+++ b/advanced-integration/v2/server/ruby/Gemfile
@@ -2,7 +2,7 @@
source "https://rubygems.org"
-gem "paypal-server-sdk", "~> 0.6.0"
+gem "paypal-server-sdk", "~> 1.0.0"
gem "puma", "~> 6.4"
gem "rackup", "~> 2.1"
gem "sinatra", "~> 4.0"
diff --git a/advanced-integration/v2/server/ruby/Gemfile.lock b/advanced-integration/v2/server/ruby/Gemfile.lock
new file mode 100644
index 00000000..64193644
--- /dev/null
+++ b/advanced-integration/v2/server/ruby/Gemfile.lock
@@ -0,0 +1,123 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ apimatic_core (0.3.13)
+ apimatic_core_interfaces (~> 0.2.0)
+ certifi (~> 2018.1, >= 2018.01.18)
+ faraday-multipart (~> 1.0)
+ nokogiri (~> 1.13, >= 1.13.10)
+ apimatic_core_interfaces (0.2.1)
+ apimatic_faraday_client_adapter (0.1.4)
+ apimatic_core_interfaces (~> 0.2.0)
+ certifi (~> 2018.1, >= 2018.01.18)
+ faraday (~> 2.0, >= 2.0.1)
+ faraday-follow_redirects (~> 0.2)
+ faraday-gzip (~> 1.0)
+ faraday-http-cache (~> 2.2)
+ faraday-multipart (~> 1.0)
+ faraday-net_http_persistent (~> 2.0)
+ faraday-retry (~> 2.0)
+ base64 (0.2.0)
+ certifi (2018.01.18)
+ connection_pool (2.5.0)
+ faraday (2.12.2)
+ faraday-net_http (>= 2.0, < 3.5)
+ json
+ logger
+ faraday-follow_redirects (0.3.0)
+ faraday (>= 1, < 3)
+ faraday-gzip (1.0.0)
+ faraday (>= 1.0)
+ zlib (~> 2.1)
+ faraday-http-cache (2.5.1)
+ faraday (>= 0.8)
+ faraday-multipart (1.1.0)
+ multipart-post (~> 2.0)
+ faraday-net_http (3.4.0)
+ net-http (>= 0.5.0)
+ faraday-net_http_persistent (2.3.0)
+ faraday (~> 2.5)
+ net-http-persistent (>= 4.0.4, < 5)
+ faraday-retry (2.2.1)
+ faraday (~> 2.0)
+ json (2.10.2)
+ logger (1.6.6)
+ multi_json (1.15.0)
+ multipart-post (2.4.1)
+ mustermann (3.0.3)
+ ruby2_keywords (~> 0.0.1)
+ net-http (0.6.0)
+ uri
+ net-http-persistent (4.0.5)
+ connection_pool (~> 2.2)
+ nio4r (2.7.4)
+ nokogiri (1.18.5-aarch64-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-aarch64-linux-musl)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm-linux-musl)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-linux-musl)
+ racc (~> 1.4)
+ paypal-server-sdk (1.0.0)
+ apimatic_core (~> 0.3.11)
+ apimatic_core_interfaces (~> 0.2.1)
+ apimatic_faraday_client_adapter (~> 0.1.4)
+ puma (6.6.0)
+ nio4r (~> 2.0)
+ racc (1.8.1)
+ rack (3.1.12)
+ rack-protection (4.1.1)
+ base64 (>= 0.1.0)
+ logger (>= 1.6.0)
+ rack (>= 3.0.0, < 4)
+ rack-session (2.1.0)
+ base64 (>= 0.1.0)
+ rack (>= 3.0.0)
+ rackup (2.2.1)
+ rack (>= 3)
+ ruby2_keywords (0.0.5)
+ sinatra (4.1.1)
+ logger (>= 1.6.0)
+ mustermann (~> 3.0)
+ rack (>= 3.0.0, < 4)
+ rack-protection (= 4.1.1)
+ rack-session (>= 2.0.0, < 3)
+ tilt (~> 2.0)
+ sinatra-contrib (4.1.1)
+ multi_json (>= 0.0.2)
+ mustermann (~> 3.0)
+ rack-protection (= 4.1.1)
+ sinatra (= 4.1.1)
+ tilt (~> 2.0)
+ tilt (2.6.0)
+ uri (1.0.3)
+ zlib (2.1.1)
+
+PLATFORMS
+ aarch64-linux-gnu
+ aarch64-linux-musl
+ arm-linux-gnu
+ arm-linux-musl
+ arm64-darwin
+ x86_64-darwin
+ x86_64-linux-gnu
+ x86_64-linux-musl
+
+DEPENDENCIES
+ paypal-server-sdk (~> 1.0.0)
+ puma (~> 6.4)
+ rackup (~> 2.1)
+ sinatra (~> 4.0)
+ sinatra-contrib (~> 4.0)
+
+BUNDLED WITH
+ 2.5.18
diff --git a/advanced-integration/v2/server/ruby/server.rb b/advanced-integration/v2/server/ruby/server.rb
index 6f0987c8..b87bace7 100644
--- a/advanced-integration/v2/server/ruby/server.rb
+++ b/advanced-integration/v2/server/ruby/server.rb
@@ -37,7 +37,7 @@
post "/api/orders" do
# use the cart information passed from the front-end to calculate the order amount detals
cart = JSON.parse request.body.read
- order_response = paypal_client.orders.orders_create({
+ order_response = paypal_client.orders.create_order({
'body' => OrderRequest.new(
intent: CheckoutPaymentIntent::CAPTURE,
purchase_units: [
@@ -58,7 +58,7 @@
#
# @see https://developer.paypal.com/docs/api/orders/v2/#orders_capture
post '/api/orders/:order_id/capture' do |order_id|
- capture_response = paypal_client.orders.orders_capture({
+ capture_response = paypal_client.orders.capture_order({
'id' => order_id,
'prefer' => 'return=representation'
})
diff --git a/standard-integration/server/dotnet/PayPalStandardIntegration.csproj b/standard-integration/server/dotnet/PayPalStandardIntegration.csproj
index b9a75fff..f74550c1 100644
--- a/standard-integration/server/dotnet/PayPalStandardIntegration.csproj
+++ b/standard-integration/server/dotnet/PayPalStandardIntegration.csproj
@@ -7,6 +7,6 @@
-
+
\ No newline at end of file
diff --git a/standard-integration/server/dotnet/Server.cs b/standard-integration/server/dotnet/Server.cs
index 186de46f..2b4a1c4f 100644
--- a/standard-integration/server/dotnet/Server.cs
+++ b/standard-integration/server/dotnet/Server.cs
@@ -116,7 +116,7 @@ private async Task _CreateOrder(dynamic cart)
CheckoutPaymentIntent intent = (CheckoutPaymentIntent)
Enum.Parse(typeof(CheckoutPaymentIntent), "CAPTURE", true);
- OrdersCreateInput ordersCreateInput = new OrdersCreateInput
+ CreateOrderInput createOrderInput = new CreateOrderInput
{
Body = new OrderRequest
{
@@ -131,7 +131,7 @@ private async Task _CreateOrder(dynamic cart)
},
};
- ApiResponse result = await _ordersController.OrdersCreateAsync(ordersCreateInput);
+ ApiResponse result = await _ordersController.CreateOrderAsync(createOrderInput);
return result;
}
@@ -152,9 +152,9 @@ public async Task CaptureOrder(string orderID)
private async Task _CaptureOrder(string orderID)
{
- OrdersCaptureInput ordersCaptureInput = new OrdersCaptureInput { Id = orderID, };
+ CaptureOrderInput ordersCaptureInput = new CaptureOrderInput { Id = orderID, };
- ApiResponse result = await _ordersController.OrdersCaptureAsync(ordersCaptureInput);
+ ApiResponse result = await _ordersController.CaptureOrderAsync(ordersCaptureInput);
return result;
}
diff --git a/standard-integration/server/java/pom.xml b/standard-integration/server/java/pom.xml
index c6488e92..908af6b3 100644
--- a/standard-integration/server/java/pom.xml
+++ b/standard-integration/server/java/pom.xml
@@ -46,7 +46,7 @@
paypal-server-sdk
- 0.6.0
+ 1.0.0
diff --git a/standard-integration/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java b/standard-integration/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
index 742928ef..15f986c8 100644
--- a/standard-integration/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
+++ b/standard-integration/server/java/src/main/java/com/paypal/sample/SampleAppApplication.java
@@ -25,8 +25,8 @@
import com.paypal.sdk.models.CheckoutPaymentIntent;
import com.paypal.sdk.models.Order;
import com.paypal.sdk.models.OrderRequest;
-import com.paypal.sdk.models.OrdersCaptureInput;
-import com.paypal.sdk.models.OrdersCreateInput;
+import com.paypal.sdk.models.CreateOrderInput;
+import com.paypal.sdk.models.CaptureOrderInput;
import com.paypal.sdk.models.PurchaseUnitRequest;
import java.util.Arrays;
import org.slf4j.event.Level;
@@ -107,7 +107,7 @@ public ResponseEntity captureOrder(@PathVariable String orderID) {
private Order createOrder(String cart) throws IOException, ApiException {
- OrdersCreateInput ordersCreateInput = new OrdersCreateInput.Builder(
+ CreateOrderInput createOrderInput = new CreateOrderInput.Builder(
null,
new OrderRequest.Builder(
CheckoutPaymentIntent.CAPTURE,
@@ -123,18 +123,18 @@ private Order createOrder(String cart) throws IOException, ApiException {
OrdersController ordersController = client.getOrdersController();
- ApiResponse apiResponse = ordersController.ordersCreate(ordersCreateInput);
+ ApiResponse apiResponse = ordersController.createOrder(createOrderInput);
return apiResponse.getResult();
}
private Order captureOrders(String orderID) throws IOException, ApiException {
- OrdersCaptureInput ordersCaptureInput = new OrdersCaptureInput.Builder(
+ CaptureOrderInput ordersCaptureInput = new CaptureOrderInput.Builder(
orderID,
null)
.build();
OrdersController ordersController = client.getOrdersController();
- ApiResponse apiResponse = ordersController.ordersCapture(ordersCaptureInput);
+ ApiResponse apiResponse = ordersController.captureOrder(ordersCaptureInput);
return apiResponse.getResult();
}
}
diff --git a/standard-integration/server/node/package.json b/standard-integration/server/node/package.json
index 6d78f878..ed8cf1e9 100644
--- a/standard-integration/server/node/package.json
+++ b/standard-integration/server/node/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
- "@paypal/paypal-server-sdk": "^0.6.0",
+ "@paypal/paypal-server-sdk": "^1.0.0",
"body-parser": "^1.20.3",
"dotenv": "^16.3.1",
"express": "^4.18.2"
diff --git a/standard-integration/server/node/server.js b/standard-integration/server/node/server.js
index db41e0e6..3633923a 100644
--- a/standard-integration/server/node/server.js
+++ b/standard-integration/server/node/server.js
@@ -56,7 +56,7 @@ const createOrder = async (cart) => {
};
try {
- const { body, ...httpResponse } = await ordersController.ordersCreate(
+ const { body, ...httpResponse } = await ordersController.createOrder(
collect
);
// Get more response info...
@@ -84,7 +84,7 @@ const captureOrder = async (orderID) => {
};
try {
- const { body, ...httpResponse } = await ordersController.ordersCapture(
+ const { body, ...httpResponse } = await ordersController.captureOrder(
collect
);
// Get more response info...
diff --git a/standard-integration/server/php/composer.json b/standard-integration/server/php/composer.json
index d611d31e..bffbaae1 100644
--- a/standard-integration/server/php/composer.json
+++ b/standard-integration/server/php/composer.json
@@ -4,7 +4,7 @@
"require": {
"php": "^7.4 || ^8.0",
"ext-json": "*",
- "paypal/paypal-server-sdk": "0.6.0"
+ "paypal/paypal-server-sdk": "1.0.0"
},
"require-dev": {
},
diff --git a/standard-integration/server/php/composer.lock b/standard-integration/server/php/composer.lock
index 62def940..6b63abbe 100644
--- a/standard-integration/server/php/composer.lock
+++ b/standard-integration/server/php/composer.lock
@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "f2e528a550aa0e8926b330dcdcfc67dc",
+ "content-hash": "e0fc9d83942f146aaa20785c7c614107",
"packages": [
{
"name": "apimatic/core",
- "version": "0.3.11",
+ "version": "0.3.14",
"source": {
"type": "git",
"url": "https://github.com/apimatic/core-lib-php.git",
- "reference": "2274f103f9f210664f546f504e4559d772a81fee"
+ "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/2274f103f9f210664f546f504e4559d772a81fee",
- "reference": "2274f103f9f210664f546f504e4559d772a81fee",
+ "url": "https://api.github.com/repos/apimatic/core-lib-php/zipball/c3eaad6cf0c00b793ce6d9bee8b87176247da582",
+ "reference": "c3eaad6cf0c00b793ce6d9bee8b87176247da582",
"shasum": ""
},
"require": {
@@ -32,7 +32,7 @@
"psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0"
},
"require-dev": {
- "phan/phan": "5.4.2",
+ "phan/phan": "5.4.5",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
"squizlabs/php_codesniffer": "^3.5"
},
@@ -56,9 +56,9 @@
],
"support": {
"issues": "https://github.com/apimatic/core-lib-php/issues",
- "source": "https://github.com/apimatic/core-lib-php/tree/0.3.11"
+ "source": "https://github.com/apimatic/core-lib-php/tree/0.3.14"
},
- "time": "2024-07-08T11:50:08+00:00"
+ "time": "2025-02-27T06:03:30+00:00"
},
{
"name": "apimatic/core-interfaces",
@@ -105,16 +105,16 @@
},
{
"name": "apimatic/jsonmapper",
- "version": "3.1.4",
+ "version": "3.1.6",
"source": {
"type": "git",
"url": "https://github.com/apimatic/jsonmapper.git",
- "reference": "407b455d2adda2efa51a44b99400389fbee0394e"
+ "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/407b455d2adda2efa51a44b99400389fbee0394e",
- "reference": "407b455d2adda2efa51a44b99400389fbee0394e",
+ "url": "https://api.github.com/repos/apimatic/jsonmapper/zipball/c6cc21bd56bfe5d5822bbd08f514be465c0b24e7",
+ "reference": "c6cc21bd56bfe5d5822bbd08f514be465c0b24e7",
"shasum": ""
},
"require": {
@@ -153,9 +153,9 @@
"support": {
"email": "mehdi.jaffery@apimatic.io",
"issues": "https://github.com/apimatic/jsonmapper/issues",
- "source": "https://github.com/apimatic/jsonmapper/tree/3.1.4"
+ "source": "https://github.com/apimatic/jsonmapper/tree/3.1.6"
},
- "time": "2024-06-11T11:48:30+00:00"
+ "time": "2024-11-28T09:15:32+00:00"
},
{
"name": "apimatic/unirest-php",
@@ -224,27 +224,27 @@
},
{
"name": "paypal/paypal-server-sdk",
- "version": "0.6.0",
+ "version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/paypal/PayPal-PHP-Server-SDK.git",
- "reference": "7d69e118998fdf2ae2cf234f1bd49f4248782380"
+ "reference": "66fd3341bbffafe7d650fe7d9d2699fabf355e67"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paypal/PayPal-PHP-Server-SDK/zipball/7d69e118998fdf2ae2cf234f1bd49f4248782380",
- "reference": "7d69e118998fdf2ae2cf234f1bd49f4248782380",
+ "url": "https://api.github.com/repos/paypal/PayPal-PHP-Server-SDK/zipball/66fd3341bbffafe7d650fe7d9d2699fabf355e67",
+ "reference": "66fd3341bbffafe7d650fe7d9d2699fabf355e67",
"shasum": ""
},
"require": {
- "apimatic/core": "~0.3.11",
+ "apimatic/core": "~0.3.13",
"apimatic/core-interfaces": "~0.1.5",
"apimatic/unirest-php": "^4.0.0",
"ext-json": "*",
"php": "^7.2 || ^8.0"
},
"require-dev": {
- "phan/phan": "5.4.2",
+ "phan/phan": "5.4.5",
"squizlabs/php_codesniffer": "^3.5"
},
"type": "library",
@@ -261,9 +261,9 @@
"homepage": "https://github.com/paypal/PayPal-PHP-Server-SDK",
"support": {
"issues": "https://github.com/paypal/PayPal-PHP-Server-SDK/issues",
- "source": "https://github.com/paypal/PayPal-PHP-Server-SDK/tree/0.6.0"
+ "source": "https://github.com/paypal/PayPal-PHP-Server-SDK/tree/1.0.0"
},
- "time": "2024-10-18T19:06:27+00:00"
+ "time": "2025-03-24T18:44:18+00:00"
},
{
"name": "php-jsonpointer/php-jsonpointer",
@@ -375,13 +375,13 @@
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.4 || ^8.0",
"ext-json": "*"
},
- "platform-dev": [],
+ "platform-dev": {},
"plugin-api-version": "2.6.0"
}
diff --git a/standard-integration/server/php/src/index.php b/standard-integration/server/php/src/index.php
index e8fe7765..784baf4c 100644
--- a/standard-integration/server/php/src/index.php
+++ b/standard-integration/server/php/src/index.php
@@ -44,7 +44,7 @@ function createOrder($cart)
)->build()
];
- $apiResponse = $client->getOrdersController()->ordersCreate($orderBody);
+ $apiResponse = $client->getOrdersController()->createOrder($orderBody);
return handleResponse($apiResponse);
}
@@ -61,7 +61,7 @@ function captureOrder($orderID)
'id' => $orderID
];
- $apiResponse = $client->getOrdersController()->ordersCapture($captureBody);
+ $apiResponse = $client->getOrdersController()->captureOrder($captureBody);
return handleResponse($apiResponse);
}
diff --git a/standard-integration/server/python/requirements.txt b/standard-integration/server/python/requirements.txt
index aba5e4cd..361d7b0b 100644
--- a/standard-integration/server/python/requirements.txt
+++ b/standard-integration/server/python/requirements.txt
@@ -1,2 +1,2 @@
Flask==3.0.3
-paypal-server-sdk==0.6.0
\ No newline at end of file
+paypal-server-sdk==1.0.0
\ No newline at end of file
diff --git a/standard-integration/server/python/server.py b/standard-integration/server/python/server.py
index fed85ed5..0c379a55 100644
--- a/standard-integration/server/python/server.py
+++ b/standard-integration/server/python/server.py
@@ -1,10 +1,13 @@
import logging
import os
-from flask import Flask, request
+from flask import Flask, request, Response
from paypalserversdk.http.auth.o_auth_2 import ClientCredentialsAuthCredentials
-from paypalserversdk.logging.configuration.api_logging_configuration import LoggingConfiguration, \
- RequestLoggingConfiguration, ResponseLoggingConfiguration
+from paypalserversdk.logging.configuration.api_logging_configuration import (
+ LoggingConfiguration,
+ RequestLoggingConfiguration,
+ ResponseLoggingConfiguration,
+)
from paypalserversdk.paypal_serversdk_client import PaypalServersdkClient
from paypalserversdk.controllers.orders_controller import OrdersController
from paypalserversdk.models.amount_with_breakdown import AmountWithBreakdown
@@ -17,8 +20,8 @@
paypal_client: PaypalServersdkClient = PaypalServersdkClient(
client_credentials_auth_credentials=ClientCredentialsAuthCredentials(
- o_auth_client_id=os.getenv('PAYPAL_CLIENT_ID'),
- o_auth_client_secret=os.getenv('PAYPAL_CLIENT_SECRET')
+ o_auth_client_id=os.getenv("PAYPAL_CLIENT_ID"),
+ o_auth_client_secret=os.getenv("PAYPAL_CLIENT_SECRET"),
),
logging_configuration=LoggingConfiguration(
log_level=logging.INFO,
@@ -26,61 +29,68 @@
# This should be set to True (the default if unset)in production.
mask_sensitive_headers=False,
request_logging_config=RequestLoggingConfiguration(
- log_headers=True,
- log_body=True
+ log_headers=True, log_body=True
),
response_logging_config=ResponseLoggingConfiguration(
- log_headers=True,
- log_body=True
- )
- )
+ log_headers=True, log_body=True
+ ),
+ ),
)
-'''
+"""
Health check
-'''
-@app.route('/', methods=['GET'])
+"""
+
+
+@app.route("/", methods=["GET"])
def index():
return {"message": "Server is running"}
+
orders_controller: OrdersController = paypal_client.orders
-'''
+"""
Create an order to start the transaction.
@see https://developer.paypal.com/docs/api/orders/v2/#orders_create
-'''
-@app.route('/api/orders', methods=['POST'])
+"""
+
+
+@app.route("/api/orders", methods=["POST"])
def create_order():
request_body = request.get_json()
# use the cart information passed from the front-end to calculate the order amount detals
- cart = request_body['cart']
- order = orders_controller.orders_create({
- "body": OrderRequest(
- intent=CheckoutPaymentIntent.CAPTURE,
- purchase_units=[
- PurchaseUnitRequest(
- AmountWithBreakdown(
- currency_code='USD',
- value='100.00'
- )
- )
- ]
- ),
- "prefer": 'return=representation'
- }
+ cart = request_body["cart"]
+ order = orders_controller.create_order(
+ {
+ "body": OrderRequest(
+ intent=CheckoutPaymentIntent.CAPTURE,
+ purchase_units=[
+ PurchaseUnitRequest(
+ AmountWithBreakdown(currency_code="USD", value="100.00")
+ )
+ ],
+ ),
+ "prefer": "return=representation",
+ }
+ )
+ return Response(
+ ApiHelper.json_serialize(order.body), status=200, mimetype="application/json"
)
- return ApiHelper.json_serialize(order.body)
-'''
+
+"""
Capture payment for the created order to complete the transaction.
@see https://developer.paypal.com/docs/api/orders/v2/#orders_capture
-'''
-@app.route('/api/orders//capture', methods=['POST'])
+"""
+
+
+@app.route("/api/orders//capture", methods=["POST"])
def capture_order(order_id):
- order = orders_controller.orders_capture({
- 'id': order_id,
- 'prefer': 'return=representation'
- })
- return ApiHelper.json_serialize(order.body)
\ No newline at end of file
+ order = orders_controller.capture_order(
+ {"id": order_id, "prefer": "return=representation"}
+ )
+ return Response(
+ ApiHelper.json_serialize(order.body), status=200, mimetype="application/json"
+ )
diff --git a/standard-integration/server/ruby/Gemfile b/standard-integration/server/ruby/Gemfile
index dc0cacba..8772983f 100644
--- a/standard-integration/server/ruby/Gemfile
+++ b/standard-integration/server/ruby/Gemfile
@@ -2,7 +2,7 @@
source "https://rubygems.org"
-gem "paypal-server-sdk", "~> 0.6.0"
+gem "paypal-server-sdk", "~> 1.0.0"
gem "puma", "~> 6.4"
gem "rackup", "~> 2.1"
gem "sinatra", "~> 4.0"
diff --git a/standard-integration/server/ruby/Gemfile.lock b/standard-integration/server/ruby/Gemfile.lock
new file mode 100644
index 00000000..64193644
--- /dev/null
+++ b/standard-integration/server/ruby/Gemfile.lock
@@ -0,0 +1,123 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ apimatic_core (0.3.13)
+ apimatic_core_interfaces (~> 0.2.0)
+ certifi (~> 2018.1, >= 2018.01.18)
+ faraday-multipart (~> 1.0)
+ nokogiri (~> 1.13, >= 1.13.10)
+ apimatic_core_interfaces (0.2.1)
+ apimatic_faraday_client_adapter (0.1.4)
+ apimatic_core_interfaces (~> 0.2.0)
+ certifi (~> 2018.1, >= 2018.01.18)
+ faraday (~> 2.0, >= 2.0.1)
+ faraday-follow_redirects (~> 0.2)
+ faraday-gzip (~> 1.0)
+ faraday-http-cache (~> 2.2)
+ faraday-multipart (~> 1.0)
+ faraday-net_http_persistent (~> 2.0)
+ faraday-retry (~> 2.0)
+ base64 (0.2.0)
+ certifi (2018.01.18)
+ connection_pool (2.5.0)
+ faraday (2.12.2)
+ faraday-net_http (>= 2.0, < 3.5)
+ json
+ logger
+ faraday-follow_redirects (0.3.0)
+ faraday (>= 1, < 3)
+ faraday-gzip (1.0.0)
+ faraday (>= 1.0)
+ zlib (~> 2.1)
+ faraday-http-cache (2.5.1)
+ faraday (>= 0.8)
+ faraday-multipart (1.1.0)
+ multipart-post (~> 2.0)
+ faraday-net_http (3.4.0)
+ net-http (>= 0.5.0)
+ faraday-net_http_persistent (2.3.0)
+ faraday (~> 2.5)
+ net-http-persistent (>= 4.0.4, < 5)
+ faraday-retry (2.2.1)
+ faraday (~> 2.0)
+ json (2.10.2)
+ logger (1.6.6)
+ multi_json (1.15.0)
+ multipart-post (2.4.1)
+ mustermann (3.0.3)
+ ruby2_keywords (~> 0.0.1)
+ net-http (0.6.0)
+ uri
+ net-http-persistent (4.0.5)
+ connection_pool (~> 2.2)
+ nio4r (2.7.4)
+ nokogiri (1.18.5-aarch64-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-aarch64-linux-musl)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm-linux-musl)
+ racc (~> 1.4)
+ nokogiri (1.18.5-arm64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-darwin)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-linux-gnu)
+ racc (~> 1.4)
+ nokogiri (1.18.5-x86_64-linux-musl)
+ racc (~> 1.4)
+ paypal-server-sdk (1.0.0)
+ apimatic_core (~> 0.3.11)
+ apimatic_core_interfaces (~> 0.2.1)
+ apimatic_faraday_client_adapter (~> 0.1.4)
+ puma (6.6.0)
+ nio4r (~> 2.0)
+ racc (1.8.1)
+ rack (3.1.12)
+ rack-protection (4.1.1)
+ base64 (>= 0.1.0)
+ logger (>= 1.6.0)
+ rack (>= 3.0.0, < 4)
+ rack-session (2.1.0)
+ base64 (>= 0.1.0)
+ rack (>= 3.0.0)
+ rackup (2.2.1)
+ rack (>= 3)
+ ruby2_keywords (0.0.5)
+ sinatra (4.1.1)
+ logger (>= 1.6.0)
+ mustermann (~> 3.0)
+ rack (>= 3.0.0, < 4)
+ rack-protection (= 4.1.1)
+ rack-session (>= 2.0.0, < 3)
+ tilt (~> 2.0)
+ sinatra-contrib (4.1.1)
+ multi_json (>= 0.0.2)
+ mustermann (~> 3.0)
+ rack-protection (= 4.1.1)
+ sinatra (= 4.1.1)
+ tilt (~> 2.0)
+ tilt (2.6.0)
+ uri (1.0.3)
+ zlib (2.1.1)
+
+PLATFORMS
+ aarch64-linux-gnu
+ aarch64-linux-musl
+ arm-linux-gnu
+ arm-linux-musl
+ arm64-darwin
+ x86_64-darwin
+ x86_64-linux-gnu
+ x86_64-linux-musl
+
+DEPENDENCIES
+ paypal-server-sdk (~> 1.0.0)
+ puma (~> 6.4)
+ rackup (~> 2.1)
+ sinatra (~> 4.0)
+ sinatra-contrib (~> 4.0)
+
+BUNDLED WITH
+ 2.5.18
diff --git a/standard-integration/server/ruby/server.rb b/standard-integration/server/ruby/server.rb
index 6f0987c8..b87bace7 100644
--- a/standard-integration/server/ruby/server.rb
+++ b/standard-integration/server/ruby/server.rb
@@ -37,7 +37,7 @@
post "/api/orders" do
# use the cart information passed from the front-end to calculate the order amount detals
cart = JSON.parse request.body.read
- order_response = paypal_client.orders.orders_create({
+ order_response = paypal_client.orders.create_order({
'body' => OrderRequest.new(
intent: CheckoutPaymentIntent::CAPTURE,
purchase_units: [
@@ -58,7 +58,7 @@
#
# @see https://developer.paypal.com/docs/api/orders/v2/#orders_capture
post '/api/orders/:order_id/capture' do |order_id|
- capture_response = paypal_client.orders.orders_capture({
+ capture_response = paypal_client.orders.capture_order({
'id' => order_id,
'prefer' => 'return=representation'
})