pcp-server-ruby-sdk 1.12.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +1 -1
- data/api-definition.yaml +323 -41
- data/lib/PCP-server-Ruby-SDK/endpoints/payment_intent_api_client.rb +37 -0
- data/lib/PCP-server-Ruby-SDK/models/address.rb +9 -237
- data/lib/PCP-server-Ruby-SDK/models/address_personal.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/amount_of_money.rb +4 -195
- data/lib/PCP-server-Ruby-SDK/models/api_error.rb +27 -232
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_header_information.rb +6 -194
- data/lib/PCP-server-Ruby-SDK/models/apple_payment_data_token_information.rb +8 -229
- data/lib/PCP-server-Ruby-SDK/models/bank_account_information.rb +11 -207
- data/lib/PCP-server-Ruby-SDK/models/bank_payout_method_specific_input.rb +4 -187
- data/lib/PCP-server-Ruby-SDK/models/cancel_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_request.rb +6 -222
- data/lib/PCP-server-Ruby-SDK/models/cancel_payment_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/cancel_request.rb +6 -224
- data/lib/PCP-server-Ruby-SDK/models/cancel_response.rb +4 -190
- data/lib/PCP-server-Ruby-SDK/models/capture_output.rb +9 -214
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_request.rb +14 -253
- data/lib/PCP-server-Ruby-SDK/models/capture_payment_response.rb +7 -239
- data/lib/PCP-server-Ruby-SDK/models/card_fraud_results.rb +29 -184
- data/lib/PCP-server-Ruby-SDK/models/card_info.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/card_payment_details.rb +8 -210
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_input.rb +32 -307
- data/lib/PCP-server-Ruby-SDK/models/card_payment_method_specific_output.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/card_recurrence_details.rb +12 -186
- data/lib/PCP-server-Ruby-SDK/models/cart_item_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/cart_item_input.rb +5 -198
- data/lib/PCP-server-Ruby-SDK/models/cart_item_invoice_data.rb +5 -184
- data/lib/PCP-server-Ruby-SDK/models/cart_item_order_status.rb +4 -213
- data/lib/PCP-server-Ruby-SDK/models/cart_item_patch.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_result.rb +5 -200
- data/lib/PCP-server-Ruby-SDK/models/cart_item_supplier_references.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/checkout_references.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/checkout_response.rb +15 -319
- data/lib/PCP-server-Ruby-SDK/models/checkouts_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/company_information.rb +3 -182
- data/lib/PCP-server-Ruby-SDK/models/complete_financing_payment_method_specific_input.rb +12 -202
- data/lib/PCP-server-Ruby-SDK/models/complete_order_request.rb +3 -181
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_method_specific_input.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_product840_specific_input.rb +7 -226
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_request.rb +6 -209
- data/lib/PCP-server-Ruby-SDK/models/complete_payment_response.rb +5 -199
- data/lib/PCP-server-Ruby-SDK/models/complete_redirect_payment_method_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/contact_details.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_request.rb +13 -240
- data/lib/PCP-server-Ruby-SDK/models/create_checkout_response.rb +16 -307
- data/lib/PCP-server-Ruby-SDK/models/create_commerce_case_response.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_request.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent_response.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_response.rb +7 -218
- data/lib/PCP-server-Ruby-SDK/models/customer.rb +28 -260
- data/lib/PCP-server-Ruby-SDK/models/customer_account.rb +10 -44
- data/lib/PCP-server-Ruby-SDK/models/customer_device.rb +8 -209
- data/lib/PCP-server-Ruby-SDK/models/deliver_item.rb +6 -195
- data/lib/PCP-server-Ruby-SDK/models/deliver_request.rb +10 -246
- data/lib/PCP-server-Ruby-SDK/models/deliver_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/delivery_information.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_input.rb +15 -203
- data/lib/PCP-server-Ruby-SDK/models/financing_payment_method_specific_output.rb +10 -196
- data/lib/PCP-server-Ruby-SDK/models/fund_distribution.rb +12 -263
- data/lib/PCP-server-Ruby-SDK/models/fund_split.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/fund_split_request.rb +3 -147
- data/lib/PCP-server-Ruby-SDK/models/fund_split_response.rb +10 -174
- data/lib/PCP-server-Ruby-SDK/models/installment_option.rb +13 -273
- data/lib/PCP-server-Ruby-SDK/models/link_information.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/merchant_action.rb +16 -194
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_input.rb +13 -246
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_method_specific_output.rb +7 -219
- data/lib/PCP-server-Ruby-SDK/models/mobile_payment_three_dsecure.rb +3 -179
- data/lib/PCP-server-Ruby-SDK/models/model_base.rb +147 -0
- data/lib/PCP-server-Ruby-SDK/models/order.rb +7 -221
- data/lib/PCP-server-Ruby-SDK/models/order_item.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_input.rb +29 -305
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_patch.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_line_details_result.rb +5 -326
- data/lib/PCP-server-Ruby-SDK/models/order_request.rb +7 -244
- data/lib/PCP-server-Ruby-SDK/models/order_response.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/patch_checkout_request.rb +8 -228
- data/lib/PCP-server-Ruby-SDK/models/patch_commerce_case_request.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_request.rb +2 -165
- data/lib/PCP-server-Ruby-SDK/models/pause_payment_response.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/payee.rb +6 -204
- data/lib/PCP-server-Ruby-SDK/models/payment_creation_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_event.rb +19 -274
- data/lib/PCP-server-Ruby-SDK/models/payment_execution.rb +29 -335
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_request.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/payment_execution_specific_input.rb +6 -212
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_request.rb +7 -205
- data/lib/PCP-server-Ruby-SDK/models/payment_information_refund_response.rb +5 -196
- data/lib/PCP-server-Ruby-SDK/models/payment_information_request.rb +10 -249
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +30 -314
- data/lib/PCP-server-Ruby-SDK/models/payment_instructions.rb +8 -214
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_output.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_intent_response_data.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input.rb +9 -261
- data/lib/PCP-server-Ruby-SDK/models/payment_method_specific_input_for_intent.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_output.rb +11 -255
- data/lib/PCP-server-Ruby-SDK/models/payment_product302_specific_input.rb +11 -225
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_input.rb +6 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_product3391_specific_output.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product3392_specific_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/payment_product5002_specific_input.rb +7 -203
- data/lib/PCP-server-Ruby-SDK/models/payment_product771_specific_output.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +5 -209
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_data.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_references.rb +6 -184
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_refund.rb +12 -197
- data/lib/PCP-server-Ruby-SDK/models/payment_response.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payment_status_output.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/payout_output.rb +5 -205
- data/lib/PCP-server-Ruby-SDK/models/payout_response.rb +6 -215
- data/lib/PCP-server-Ruby-SDK/models/personal_information.rb +11 -227
- data/lib/PCP-server-Ruby-SDK/models/personal_name.rb +5 -201
- data/lib/PCP-server-Ruby-SDK/models/positive_amount_of_money.rb +4 -196
- data/lib/PCP-server-Ruby-SDK/models/processing_mandate_information.rb +9 -254
- data/lib/PCP-server-Ruby-SDK/models/redirect_data.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input.rb +14 -249
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_input_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output.rb +6 -211
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_create_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_method_specific_output_for_intent.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input.rb +6 -205
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product840_specific_input_data.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/redirect_payment_product900_specific_input.rb +12 -177
- data/lib/PCP-server-Ruby-SDK/models/redirection_data.rb +11 -186
- data/lib/PCP-server-Ruby-SDK/models/references.rb +47 -205
- data/lib/PCP-server-Ruby-SDK/models/refresh_payment_request.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/refund_error_response.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/refund_output.rb +8 -211
- data/lib/PCP-server-Ruby-SDK/models/refund_payment_response.rb +7 -242
- data/lib/PCP-server-Ruby-SDK/models/refund_request.rb +6 -210
- data/lib/PCP-server-Ruby-SDK/models/return_information.rb +4 -194
- data/lib/PCP-server-Ruby-SDK/models/return_item.rb +6 -196
- data/lib/PCP-server-Ruby-SDK/models/return_request.rb +6 -234
- data/lib/PCP-server-Ruby-SDK/models/return_response.rb +4 -191
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_input.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_method_specific_output.rb +4 -193
- data/lib/PCP-server-Ruby-SDK/models/sepa_direct_debit_payment_product771_specific_input.rb +4 -192
- data/lib/PCP-server-Ruby-SDK/models/sepa_transfer_payment_product_772_specific_input.rb +3 -186
- data/lib/PCP-server-Ruby-SDK/models/shipping.rb +3 -183
- data/lib/PCP-server-Ruby-SDK/models/shipping_address.rb +14 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_data.rb +9 -0
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_input.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_patch.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/shopping_cart_result.rb +3 -185
- data/lib/PCP-server-Ruby-SDK/models/status_output.rb +21 -264
- data/lib/PCP-server-Ruby-SDK/models/three_d_secure_results.rb +6 -226
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +18 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/scripts/convert_models_to_model_base.rb +128 -0
- data/spec/endpoints/payment_intent_api_client_spec.rb +43 -0
- data/spec/models/api_definition_conformance_spec.rb +88 -0
- data/spec/models/model_base_spec.rb +87 -0
- data/spec/models/payment_intent_models_spec.rb +25 -0
- data/spec/models/required_field_validation_spec.rb +5 -5
- metadata +35 -11
- data/lib/PCP-server-Ruby-SDK/models/action_type.rb +0 -34
- data/lib/PCP-server-Ruby-SDK/models/avs_result.rb +0 -52
- data/lib/PCP-server-Ruby-SDK/models/business_relation.rb +0 -30
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1a9875fc08007fe360fc31df9900dc68079bf5d2f36f5d45506afcddf1ffd78
|
|
4
|
+
data.tar.gz: cd2ca48761ba4ca6ae6b5dff334eac7071dc3782204c935bb270aca291668ce9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: df7bc19cb5a08913bfb6d3fc8999e80b265df84c2a5e13d3e6f66622b703a6fbcf36617a7e2e1b4d1b041157a78643241069d8768fffd8dcc320c0c1d968a279
|
|
7
|
+
data.tar.gz: 12300375a10d05501deee7cd489fcdee071d60d5c96c87dd201a926a4874221b824667d522a0708e227edb07cc3db9feb4c10704e0d1f9762e6a7132bd82ac71
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [1.13.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v1.12.0...v1.13.0) (2026-07-23)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* feat: update API version to 1.59.0 ([ea64ca9e4cf232bc1dc90c563038e79d415e83af](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/ea64ca9e4cf232bc1dc90c563038e79d415e83af))
|
|
6
|
+
* feat: update API version to 1.60.0 ([9b5ebe858a46e671c57c85902445543dbbddcec2](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/9b5ebe858a46e671c57c85902445543dbbddcec2))
|
|
7
|
+
* feat: update API version to 1.61.0 ([a2f143cfd34405f1c23450932069f7fb8106c0f9](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/a2f143cfd34405f1c23450932069f7fb8106c0f9))
|
|
8
|
+
|
|
1
9
|
# [1.12.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v1.11.0...v1.12.0) (2026-07-08)
|
|
2
10
|
|
|
3
11
|
### Features
|
data/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|

|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
Welcome to the Ruby SDK for the PAYONE Commerce Platform (api-version 1.
|
|
9
|
+
Welcome to the Ruby SDK for the PAYONE Commerce Platform (api-version 1.61.0)! This repository contains a powerful, easy-to-use software development kit (SDK) designed to simplify the integration of online payment processing into your applications.
|
|
10
10
|
|
|
11
11
|
## Requirements
|
|
12
12
|
|
data/api-definition.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
openapi: "3.0.3"
|
|
2
2
|
|
|
3
3
|
info:
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.61.0
|
|
5
5
|
title: "Commerce Platform API"
|
|
6
6
|
description: |
|
|
7
7
|
RESTful API for the creation of Commerce Cases with Checkouts and the execution of Payments.
|
|
@@ -23,6 +23,8 @@ tags:
|
|
|
23
23
|
description: Resource for operations on Payment Executions. Requires PAYMENT_EXECUTION as allowedPaymentActions.
|
|
24
24
|
- name: PaymentInformation
|
|
25
25
|
description: Resource for operations on Payment Information.
|
|
26
|
+
- name: PaymentIntent
|
|
27
|
+
description: Resource for operations on Payment Intent.
|
|
26
28
|
|
|
27
29
|
paths:
|
|
28
30
|
'/v1/{merchantId}/commerce-cases':
|
|
@@ -1473,6 +1475,85 @@ paths:
|
|
|
1473
1475
|
schema:
|
|
1474
1476
|
$ref: '#/components/schemas/RefundErrorResponse'
|
|
1475
1477
|
|
|
1478
|
+
'/v1/{merchantId}/payment-intents':
|
|
1479
|
+
post:
|
|
1480
|
+
summary: Create a Payment Intent
|
|
1481
|
+
description: |-
|
|
1482
|
+
This endpoint can be used to create a payment intent for PayPal payment method.
|
|
1483
|
+
tags:
|
|
1484
|
+
- PaymentIntent
|
|
1485
|
+
operationId: createPaymentIntemt
|
|
1486
|
+
parameters:
|
|
1487
|
+
- $ref: '#/components/parameters/merchantIdPath'
|
|
1488
|
+
requestBody:
|
|
1489
|
+
required: true
|
|
1490
|
+
content:
|
|
1491
|
+
application/json:
|
|
1492
|
+
schema:
|
|
1493
|
+
$ref: '#/components/schemas/CreatePaymentIntentRequest'
|
|
1494
|
+
responses:
|
|
1495
|
+
'201':
|
|
1496
|
+
x-nullable: true
|
|
1497
|
+
description: The response contains the reference of the created Payment Intent.
|
|
1498
|
+
content:
|
|
1499
|
+
application/json:
|
|
1500
|
+
schema:
|
|
1501
|
+
$ref: '#/components/schemas/CreatePaymentIntentResponse'
|
|
1502
|
+
'400':
|
|
1503
|
+
x-nullable: true
|
|
1504
|
+
description: Incorrect input data
|
|
1505
|
+
content:
|
|
1506
|
+
application/json:
|
|
1507
|
+
schema:
|
|
1508
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
1509
|
+
'404':
|
|
1510
|
+
x-nullable: true
|
|
1511
|
+
description: Payment not found
|
|
1512
|
+
content:
|
|
1513
|
+
application/json:
|
|
1514
|
+
schema:
|
|
1515
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
1516
|
+
'409':
|
|
1517
|
+
x-nullable: true
|
|
1518
|
+
description: Creation of Payment Information is not allowed
|
|
1519
|
+
content:
|
|
1520
|
+
application/json:
|
|
1521
|
+
schema:
|
|
1522
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
1523
|
+
'500':
|
|
1524
|
+
x-nullable: true
|
|
1525
|
+
description: Internal server exception
|
|
1526
|
+
content:
|
|
1527
|
+
application/json:
|
|
1528
|
+
schema:
|
|
1529
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
1530
|
+
'/v1/{merchantId}/payment-intents/{paymentIntentId}':
|
|
1531
|
+
get:
|
|
1532
|
+
summary: Get a Payment Intent
|
|
1533
|
+
description: |-
|
|
1534
|
+
This endpoint can be used to get a paymentIntent.
|
|
1535
|
+
tags:
|
|
1536
|
+
- PaymentIntent
|
|
1537
|
+
operationId: getPaymentIntent
|
|
1538
|
+
parameters:
|
|
1539
|
+
- $ref: '#/components/parameters/merchantIdPath'
|
|
1540
|
+
- $ref: '#/components/parameters/paymentIntentId'
|
|
1541
|
+
responses:
|
|
1542
|
+
'200':
|
|
1543
|
+
x-nullable: true
|
|
1544
|
+
description: The response contains the reference of the created Payment Intent.
|
|
1545
|
+
content:
|
|
1546
|
+
application/json:
|
|
1547
|
+
schema:
|
|
1548
|
+
$ref: '#/components/schemas/PaymentIntentResponse'
|
|
1549
|
+
'404':
|
|
1550
|
+
x-nullable: true
|
|
1551
|
+
description: Payment not found
|
|
1552
|
+
content:
|
|
1553
|
+
application/json:
|
|
1554
|
+
schema:
|
|
1555
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
1556
|
+
|
|
1476
1557
|
components:
|
|
1477
1558
|
parameters:
|
|
1478
1559
|
checkoutIdPath:
|
|
@@ -1749,6 +1830,14 @@ components:
|
|
|
1749
1830
|
schema:
|
|
1750
1831
|
type: string
|
|
1751
1832
|
format: UUID
|
|
1833
|
+
paymentIntentId:
|
|
1834
|
+
in: path
|
|
1835
|
+
name: paymentIntentId
|
|
1836
|
+
description: Unique identifier of a paymentIntent
|
|
1837
|
+
required: true
|
|
1838
|
+
schema:
|
|
1839
|
+
type: string
|
|
1840
|
+
format: UUID
|
|
1752
1841
|
paymentReference:
|
|
1753
1842
|
in: query
|
|
1754
1843
|
name: paymentReference
|
|
@@ -1986,6 +2075,15 @@ components:
|
|
|
1986
2075
|
maxLength: 10
|
|
1987
2076
|
name:
|
|
1988
2077
|
$ref: '#/components/schemas/PersonalName'
|
|
2078
|
+
AddressSelectionAtPayPal:
|
|
2079
|
+
type: boolean
|
|
2080
|
+
description: |-
|
|
2081
|
+
Indicates whether to use PayPal Express Checkout Shortcut.
|
|
2082
|
+
* true = When shortcut is enabled, the consumer can select a shipping address during PayPal checkout.
|
|
2083
|
+
* false = When shortcut is disabled, the consumer cannot change the shipping address.
|
|
2084
|
+
Default value is false.
|
|
2085
|
+
Please note that this field is ignored when order.additionalInput.typeInformation.purchaseType is set to
|
|
2086
|
+
"digital"
|
|
1989
2087
|
AllowedPaymentActions:
|
|
1990
2088
|
type: string
|
|
1991
2089
|
enum:
|
|
@@ -2254,6 +2352,8 @@ components:
|
|
|
2254
2352
|
type: array
|
|
2255
2353
|
items:
|
|
2256
2354
|
$ref: '#/components/schemas/CancelItem'
|
|
2355
|
+
fundSplit:
|
|
2356
|
+
$ref: '#/components/schemas/FundSplit'
|
|
2257
2357
|
CancelResponse:
|
|
2258
2358
|
type: object
|
|
2259
2359
|
properties:
|
|
@@ -2563,7 +2663,7 @@ components:
|
|
|
2563
2663
|
enum:
|
|
2564
2664
|
- first
|
|
2565
2665
|
- recurring
|
|
2566
|
-
|
|
2666
|
+
CartItemData:
|
|
2567
2667
|
type: object
|
|
2568
2668
|
description: This object contains information of all items in the cart.
|
|
2569
2669
|
If a cart item is provided, the productPrice and quantity is required.
|
|
@@ -2573,6 +2673,14 @@ components:
|
|
|
2573
2673
|
$ref: '#/components/schemas/CartItemInvoiceData'
|
|
2574
2674
|
orderLineDetails:
|
|
2575
2675
|
$ref: '#/components/schemas/OrderLineDetailsInput'
|
|
2676
|
+
CartItemInput:
|
|
2677
|
+
type: object
|
|
2678
|
+
description: This object contains information of all items in the cart.
|
|
2679
|
+
If a cart item is provided, the productPrice and quantity is required.
|
|
2680
|
+
allOf:
|
|
2681
|
+
- $ref: '#/components/schemas/CartItemData'
|
|
2682
|
+
additionalProperties: false
|
|
2683
|
+
properties:
|
|
2576
2684
|
supplierReferences:
|
|
2577
2685
|
$ref: '#/components/schemas/CartItemSupplierReferences'
|
|
2578
2686
|
CartItemInvoiceData:
|
|
@@ -2998,6 +3106,39 @@ components:
|
|
|
2998
3106
|
type: string
|
|
2999
3107
|
format: UUID
|
|
3000
3108
|
example: "4f0c512e-f12c-11ec-8ea0-0242ac120002"
|
|
3109
|
+
CreatePaymentIntent:
|
|
3110
|
+
type: object
|
|
3111
|
+
description: |
|
|
3112
|
+
Object containing payment intent details.
|
|
3113
|
+
additionalProperties: false
|
|
3114
|
+
properties:
|
|
3115
|
+
amountOfMoney:
|
|
3116
|
+
$ref: '#/components/schemas/AmountOfMoney'
|
|
3117
|
+
references:
|
|
3118
|
+
$ref: '#/components/schemas/PaymentReferences'
|
|
3119
|
+
shoppingCart:
|
|
3120
|
+
$ref: '#/components/schemas/ShoppingCartData'
|
|
3121
|
+
CreatePaymentIntentRequest:
|
|
3122
|
+
title: PaymentIntentRequest
|
|
3123
|
+
type: object
|
|
3124
|
+
description: |
|
|
3125
|
+
Object containing details for creating a payment intent.
|
|
3126
|
+
allOf:
|
|
3127
|
+
- $ref: '#/components/schemas/CreatePaymentIntent'
|
|
3128
|
+
additionalProperties: false
|
|
3129
|
+
properties:
|
|
3130
|
+
paymentMethodSpecificInput:
|
|
3131
|
+
$ref: '#/components/schemas/PaymentMethodSpecificInputForIntent'
|
|
3132
|
+
CreatePaymentIntentResponse:
|
|
3133
|
+
title: PaymentIntentResponse
|
|
3134
|
+
type: object
|
|
3135
|
+
description: Object containing details on the created payment intent.
|
|
3136
|
+
additionalProperties: false
|
|
3137
|
+
properties:
|
|
3138
|
+
shoppingCart:
|
|
3139
|
+
$ref: '#/components/schemas/ShoppingCartData'
|
|
3140
|
+
paymentIntentOutput:
|
|
3141
|
+
$ref: '#/components/schemas/PaymentIntentOutput'
|
|
3001
3142
|
CreationDateTime:
|
|
3002
3143
|
type: string
|
|
3003
3144
|
format: date-time
|
|
@@ -3288,6 +3429,14 @@ components:
|
|
|
3288
3429
|
$ref: '#/components/schemas/PaymentProduct3391SpecificOutput'
|
|
3289
3430
|
paymentInstructions:
|
|
3290
3431
|
$ref: '#/components/schemas/PaymentInstructions'
|
|
3432
|
+
FraudNetId:
|
|
3433
|
+
type: string
|
|
3434
|
+
format: UUID
|
|
3435
|
+
description: |-
|
|
3436
|
+
A unique ID determined by the merchant, to link a Paypal transaction to a FraudNet PayPal risk session. Only applicable to
|
|
3437
|
+
customer-initiated transactions, when the FraudNet SDK is used, and to be passed in the API request the same tracking ID value
|
|
3438
|
+
(FraudNet Session Identifier).
|
|
3439
|
+
example: 686e5823-1ffd-42f7-9ba3-42b41b57d8dd
|
|
3291
3440
|
FundDistribution:
|
|
3292
3441
|
type: object
|
|
3293
3442
|
description: Instructions for distributing funds to multiple sellers or partners in a marketplace context.
|
|
@@ -3459,6 +3608,15 @@ components:
|
|
|
3459
3608
|
- nominalInterestRate
|
|
3460
3609
|
- numberOfPayments
|
|
3461
3610
|
- totalAmount
|
|
3611
|
+
JavaScriptSdkFlow:
|
|
3612
|
+
type: boolean
|
|
3613
|
+
description: |-
|
|
3614
|
+
Indicates whether the PayPal JavaScript SDK flow is used.
|
|
3615
|
+
* true = The PayPal JavaScript SDK flow is used.
|
|
3616
|
+
* false = The PayPal JavaScript SDK flow is not used.
|
|
3617
|
+
Default value is false.
|
|
3618
|
+
default: false
|
|
3619
|
+
example: true
|
|
3462
3620
|
LinkInformation:
|
|
3463
3621
|
type: object
|
|
3464
3622
|
description: URL and content type information for an web resource.
|
|
@@ -4017,6 +4175,10 @@ components:
|
|
|
4017
4175
|
$ref: '#/components/schemas/FundSplit'
|
|
4018
4176
|
required:
|
|
4019
4177
|
- paymentReferences
|
|
4178
|
+
PaymentId:
|
|
4179
|
+
description: reference to the paymentProcess.
|
|
4180
|
+
type: string
|
|
4181
|
+
example: "PP2000A6CC1A9R00"
|
|
4020
4182
|
PaymentInformationRefundRequest:
|
|
4021
4183
|
type: object
|
|
4022
4184
|
description: |
|
|
@@ -4175,6 +4337,42 @@ components:
|
|
|
4175
4337
|
type: string
|
|
4176
4338
|
description: Status, usually describing the status of the invoice if paid, overdue, open...
|
|
4177
4339
|
description: Object containing information on payment instructions details (e.g. on the invoice payments)
|
|
4340
|
+
PaymentIntentId:
|
|
4341
|
+
description: reference to the paymentIntent.
|
|
4342
|
+
type: string
|
|
4343
|
+
format: UUID
|
|
4344
|
+
example: "a54749ff-df7c-4686-bf33-fe76d3cf4502"
|
|
4345
|
+
PaymentIntentOutput:
|
|
4346
|
+
type: object
|
|
4347
|
+
description: Object containing details on the created payment intent.
|
|
4348
|
+
allOf:
|
|
4349
|
+
- $ref: '#/components/schemas/PaymentIntentResponseData'
|
|
4350
|
+
additionalProperties: false
|
|
4351
|
+
properties:
|
|
4352
|
+
redirectPaymentMethodSpecificOutput:
|
|
4353
|
+
$ref: '#/components/schemas/RedirectPaymentMethodSpecificOutputForCreateIntent'
|
|
4354
|
+
PaymentIntentResponse:
|
|
4355
|
+
type: object
|
|
4356
|
+
description: Object containing details for payment intent.
|
|
4357
|
+
allOf:
|
|
4358
|
+
- $ref: '#/components/schemas/PaymentIntentResponseData'
|
|
4359
|
+
additionalProperties: false
|
|
4360
|
+
properties:
|
|
4361
|
+
redirectPaymentMethodSpecificOutput:
|
|
4362
|
+
$ref: '#/components/schemas/RedirectPaymentMethodSpecificOutputForIntent'
|
|
4363
|
+
PaymentIntentResponseData:
|
|
4364
|
+
type: object
|
|
4365
|
+
description: Object containing details for payment intent.
|
|
4366
|
+
additionalProperties: false
|
|
4367
|
+
properties:
|
|
4368
|
+
amountOfMoney:
|
|
4369
|
+
$ref: '#/components/schemas/AmountOfMoney'
|
|
4370
|
+
references:
|
|
4371
|
+
$ref: '#/components/schemas/PaymentReferences'
|
|
4372
|
+
paymentIntentId:
|
|
4373
|
+
$ref: '#/components/schemas/PaymentIntentId'
|
|
4374
|
+
paymentId:
|
|
4375
|
+
$ref: '#/components/schemas/PaymentId'
|
|
4178
4376
|
PaymentMethodSpecificInput:
|
|
4179
4377
|
type: object
|
|
4180
4378
|
description: |
|
|
@@ -4197,6 +4395,15 @@ components:
|
|
|
4197
4395
|
$ref: '#/components/schemas/CustomerDevice'
|
|
4198
4396
|
paymentChannel:
|
|
4199
4397
|
$ref: '#/components/schemas/PaymentChannel'
|
|
4398
|
+
PaymentMethodSpecificInputForIntent:
|
|
4399
|
+
title: paymentMethodSpecificInput
|
|
4400
|
+
type: object
|
|
4401
|
+
description: |
|
|
4402
|
+
Input for the payment for a payment intent method.
|
|
4403
|
+
additionalProperties: false
|
|
4404
|
+
properties:
|
|
4405
|
+
redirectPaymentMethodSpecificInput:
|
|
4406
|
+
$ref: '#/components/schemas/RedirectPaymentMethodSpecificInputForIntent'
|
|
4200
4407
|
PaymentOutput:
|
|
4201
4408
|
type: object
|
|
4202
4409
|
description: |
|
|
@@ -4331,6 +4538,16 @@ components:
|
|
|
4331
4538
|
description: Surname of the PayPal account holder
|
|
4332
4539
|
example: Doe
|
|
4333
4540
|
PaymentProduct840SpecificOutput:
|
|
4541
|
+
type: object
|
|
4542
|
+
description: |
|
|
4543
|
+
PayPal (payment product 840) specific details.
|
|
4544
|
+
allOf:
|
|
4545
|
+
- $ref: '#/components/schemas/PaymentProduct840SpecificOutputData'
|
|
4546
|
+
additionalProperties: false
|
|
4547
|
+
properties:
|
|
4548
|
+
shippingAddress:
|
|
4549
|
+
$ref: '#/components/schemas/Address'
|
|
4550
|
+
PaymentProduct840SpecificOutputData:
|
|
4334
4551
|
type: object
|
|
4335
4552
|
description: |
|
|
4336
4553
|
PayPal (payment product 840) specific details.
|
|
@@ -4340,15 +4557,18 @@ components:
|
|
|
4340
4557
|
$ref: '#/components/schemas/Address'
|
|
4341
4558
|
customerAccount:
|
|
4342
4559
|
$ref: '#/components/schemas/PaymentProduct840CustomerAccount'
|
|
4343
|
-
shippingAddress:
|
|
4344
|
-
$ref: '#/components/schemas/Address'
|
|
4345
4560
|
payPalTransactionId:
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4561
|
+
$ref: '#/components/schemas/PayPalTransactionId'
|
|
4562
|
+
PaymentProduct840SpecificOutputForIntent:
|
|
4563
|
+
type: object
|
|
4564
|
+
description: |
|
|
4565
|
+
PayPal (payment product 840) specific details.
|
|
4566
|
+
allOf:
|
|
4567
|
+
- $ref: '#/components/schemas/PaymentProduct840SpecificOutputData'
|
|
4568
|
+
additionalProperties: false
|
|
4569
|
+
properties:
|
|
4570
|
+
shippingAddress:
|
|
4571
|
+
$ref: '#/components/schemas/ShippingAddress'
|
|
4352
4572
|
PaymentProductId:
|
|
4353
4573
|
type: integer
|
|
4354
4574
|
format: int32
|
|
@@ -4468,6 +4688,13 @@ components:
|
|
|
4468
4688
|
type: string
|
|
4469
4689
|
description: Unique payment transaction identifier of the payment gateway.
|
|
4470
4690
|
example: PP1AA7KKLSFB9MBG
|
|
4691
|
+
PayPalTransactionId:
|
|
4692
|
+
type: string
|
|
4693
|
+
maxLength: 20
|
|
4694
|
+
description: |-
|
|
4695
|
+
A 17-character unique identifier of the PayPal transaction. This identifier is used to identify the transaction in the
|
|
4696
|
+
PayPal system and needed for the PayPal Javascript SDK flow.
|
|
4697
|
+
example: 9A1234567890123
|
|
4471
4698
|
PersonalInformation:
|
|
4472
4699
|
type: object
|
|
4473
4700
|
description: Object containing personal information like name, date of birth and gender.
|
|
@@ -4622,14 +4849,7 @@ components:
|
|
|
4622
4849
|
additionalProperties: false
|
|
4623
4850
|
properties:
|
|
4624
4851
|
requiresApproval:
|
|
4625
|
-
|
|
4626
|
-
description: |-
|
|
4627
|
-
* true = the payment requires approval before the funds will be captured using the Approve payment or
|
|
4628
|
-
Capture payment API
|
|
4629
|
-
* false = the payment does not require approval, and the funds will be captured automatically
|
|
4630
|
-
|
|
4631
|
-
If the parameter is not provided in the request, the default value will be true
|
|
4632
|
-
default: true
|
|
4852
|
+
$ref: '#/components/schemas/RequiresApproval'
|
|
4633
4853
|
paymentProcessingToken:
|
|
4634
4854
|
type: string
|
|
4635
4855
|
description: ID of the token to use to create the payment.
|
|
@@ -4657,6 +4877,21 @@ components:
|
|
|
4657
4877
|
$ref: '#/components/schemas/RedirectPaymentProduct900SpecificInput'
|
|
4658
4878
|
redirectionData:
|
|
4659
4879
|
$ref: '#/components/schemas/RedirectionData'
|
|
4880
|
+
RedirectPaymentMethodSpecificInputForIntent:
|
|
4881
|
+
title: redirectPaymentMethodSpecificInput
|
|
4882
|
+
type: object
|
|
4883
|
+
description: |-
|
|
4884
|
+
Object containing the specific input details for payment intents that involve redirects to PayPay to complete
|
|
4885
|
+
additionalProperties: false
|
|
4886
|
+
properties:
|
|
4887
|
+
requiresApproval:
|
|
4888
|
+
$ref: '#/components/schemas/RequiresApproval'
|
|
4889
|
+
paymentProductId:
|
|
4890
|
+
$ref: '#/components/schemas/PaymentProductId'
|
|
4891
|
+
paymentProduct840SpecificInput:
|
|
4892
|
+
$ref: '#/components/schemas/RedirectPaymentProduct840SpecificInputData'
|
|
4893
|
+
redirectionData:
|
|
4894
|
+
$ref: '#/components/schemas/RedirectionData'
|
|
4660
4895
|
RedirectPaymentMethodSpecificOutput:
|
|
4661
4896
|
type: object
|
|
4662
4897
|
description: |
|
|
@@ -4677,36 +4912,54 @@ components:
|
|
|
4677
4912
|
description: Token to identify the card in the reporting.
|
|
4678
4913
|
example: 12a037cc-833d-8b45-8f6f-11c34171f4e1
|
|
4679
4914
|
maxLength: 40
|
|
4915
|
+
RedirectPaymentMethodSpecificOutputForCreateIntent:
|
|
4916
|
+
title: redirectPaymentMethodSpecificOutput
|
|
4917
|
+
type: object
|
|
4918
|
+
description: |
|
|
4919
|
+
Object containing the redirect payment product details for a created payment intent.
|
|
4920
|
+
additionalProperties: false
|
|
4921
|
+
properties:
|
|
4922
|
+
requiresApproval:
|
|
4923
|
+
$ref: '#/components/schemas/RequiresApproval'
|
|
4924
|
+
paymentProductId:
|
|
4925
|
+
$ref: '#/components/schemas/PaymentProductId'
|
|
4926
|
+
paymentProduct840SpecificOutput:
|
|
4927
|
+
$ref: '#/components/schemas/RedirectPaymentProduct840SpecificInputData'
|
|
4928
|
+
redirectionData:
|
|
4929
|
+
$ref: '#/components/schemas/RedirectionData'
|
|
4930
|
+
RedirectPaymentMethodSpecificOutputForIntent:
|
|
4931
|
+
title: redirectPaymentMethodSpecificOutput
|
|
4932
|
+
type: object
|
|
4933
|
+
description: |
|
|
4934
|
+
Object containing the redirect payment product details for payment intent.
|
|
4935
|
+
additionalProperties: false
|
|
4936
|
+
properties:
|
|
4937
|
+
paymentProductId:
|
|
4938
|
+
$ref: '#/components/schemas/PaymentProductId'
|
|
4939
|
+
paymentProduct840SpecificOutput:
|
|
4940
|
+
$ref: '#/components/schemas/PaymentProduct840SpecificOutputForIntent'
|
|
4680
4941
|
RedirectPaymentProduct840SpecificInput:
|
|
4681
4942
|
type: object
|
|
4682
4943
|
description: Object containing specific input required for PayPal payments (Payment product ID 840)
|
|
4944
|
+
allOf:
|
|
4945
|
+
- $ref: '#/components/schemas/RedirectPaymentProduct840SpecificInputData'
|
|
4683
4946
|
properties:
|
|
4684
|
-
addressSelectionAtPayPal:
|
|
4685
|
-
type: boolean
|
|
4686
|
-
description: |-
|
|
4687
|
-
Indicates whether to use PayPal Express Checkout Shortcut.
|
|
4688
|
-
* true = When shortcut is enabled, the consumer can select a shipping address during PayPal checkout.
|
|
4689
|
-
* false = When shortcut is disabled, the consumer cannot change the shipping address.
|
|
4690
|
-
Default value is false.
|
|
4691
|
-
Please note that this field is ignored when order.additionalInput.typeInformation.purchaseType is set to
|
|
4692
|
-
"digital"
|
|
4693
4947
|
fraudNetId:
|
|
4948
|
+
$ref: '#/components/schemas/FraudNetId'
|
|
4949
|
+
paymentId:
|
|
4694
4950
|
type: string
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4951
|
+
description: Unique payment transaction identifier of the payment gateway. Required for PayPal Express to associate the request with the original payment intent.
|
|
4952
|
+
example: '3066019730_1'
|
|
4953
|
+
writeOnly: true
|
|
4954
|
+
RedirectPaymentProduct840SpecificInputData:
|
|
4955
|
+
title: paymentProduct840SpecificInput
|
|
4956
|
+
type: object
|
|
4957
|
+
description: Object containing specific input required for PayPal payments (Payment product ID 840)
|
|
4958
|
+
properties:
|
|
4959
|
+
addressSelectionAtPayPal:
|
|
4960
|
+
$ref: '#/components/schemas/AddressSelectionAtPayPal'
|
|
4701
4961
|
javaScriptSdkFlow:
|
|
4702
|
-
|
|
4703
|
-
description: |-
|
|
4704
|
-
Indicates whether the PayPal JavaScript SDK flow is used.
|
|
4705
|
-
* true = The PayPal JavaScript SDK flow is used.
|
|
4706
|
-
* false = The PayPal JavaScript SDK flow is not used.
|
|
4707
|
-
Default value is false.
|
|
4708
|
-
default: false
|
|
4709
|
-
example: true
|
|
4962
|
+
$ref: '#/components/schemas/JavaScriptSdkFlow'
|
|
4710
4963
|
RedirectPaymentProduct900SpecificInput:
|
|
4711
4964
|
type: object
|
|
4712
4965
|
properties:
|
|
@@ -4880,6 +5133,14 @@ components:
|
|
|
4880
5133
|
$ref: '#/components/schemas/ReturnInformation'
|
|
4881
5134
|
fundSplit:
|
|
4882
5135
|
$ref: '#/components/schemas/FundSplit'
|
|
5136
|
+
RequiresApproval:
|
|
5137
|
+
type: boolean
|
|
5138
|
+
description: |-
|
|
5139
|
+
* true = the payment requires approval before the funds will be captured using the Approve payment or Capture payment API
|
|
5140
|
+
* false = the payment does not require approval, and the funds will be captured automatically
|
|
5141
|
+
|
|
5142
|
+
If the parameter is not provided in the request, the default value will be true
|
|
5143
|
+
default: true
|
|
4883
5144
|
ReturnInformation:
|
|
4884
5145
|
type: object
|
|
4885
5146
|
description: |-
|
|
@@ -5008,6 +5269,27 @@ components:
|
|
|
5008
5269
|
properties:
|
|
5009
5270
|
address:
|
|
5010
5271
|
$ref: '#/components/schemas/AddressPersonal'
|
|
5272
|
+
ShippingAddress:
|
|
5273
|
+
type: object
|
|
5274
|
+
description: |
|
|
5275
|
+
Object containing information regarding shipping / delivery
|
|
5276
|
+
allOf:
|
|
5277
|
+
- $ref: '#/components/schemas/AddressPersonal'
|
|
5278
|
+
additionalProperties: false
|
|
5279
|
+
properties:
|
|
5280
|
+
companyName:
|
|
5281
|
+
type: string
|
|
5282
|
+
description: |
|
|
5283
|
+
Company name if needed
|
|
5284
|
+
ShoppingCartData:
|
|
5285
|
+
type: object
|
|
5286
|
+
description: |
|
|
5287
|
+
Shopping cart data, including items and specific amounts.
|
|
5288
|
+
properties:
|
|
5289
|
+
items:
|
|
5290
|
+
type: array
|
|
5291
|
+
items:
|
|
5292
|
+
$ref: '#/components/schemas/CartItemData'
|
|
5011
5293
|
ShoppingCartInput:
|
|
5012
5294
|
type: object
|
|
5013
5295
|
description: |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
require 'uri'
|
|
3
|
+
require_relative 'base_api_client'
|
|
4
|
+
require_relative '../models/create_payment_intent_response'
|
|
5
|
+
require_relative '../models/payment_intent_output'
|
|
6
|
+
require_relative '../models/payment_intent_response'
|
|
7
|
+
require_relative '../models/payment_product840_specific_output_for_intent'
|
|
8
|
+
require_relative '../models/redirect_payment_method_specific_output_for_create_intent'
|
|
9
|
+
require_relative '../models/redirect_payment_method_specific_output_for_intent'
|
|
10
|
+
require_relative '../models/redirect_payment_product840_specific_input_data'
|
|
11
|
+
require_relative '../models/shopping_cart_data'
|
|
12
|
+
|
|
13
|
+
module PCPServerSDK
|
|
14
|
+
module Endpoints
|
|
15
|
+
class PaymentIntentApiClient < BaseApiClient
|
|
16
|
+
PAYMENT_INTENT_ID_REQUIRED_ERROR = 'Payment Intent ID is required'
|
|
17
|
+
|
|
18
|
+
def create_payment_intent(merchant_id, payload)
|
|
19
|
+
raise TypeError, MERCHANT_ID_REQUIRED_ERROR if merchant_id.nil? || merchant_id.empty?
|
|
20
|
+
raise TypeError, PAYLOAD_REQUIRED_ERROR if payload.nil?
|
|
21
|
+
|
|
22
|
+
response = make_api_call(URI.join(get_config.host, "/v1/#{merchant_id}/payment-intents").to_s,
|
|
23
|
+
method: 'POST', headers: { 'Content-Type' => 'application/json' }, body: JSON.generate(payload))
|
|
24
|
+
deserialize_json(response, PCPServerSDK::Models::CreatePaymentIntentResponse)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def get_payment_intent(merchant_id, payment_intent_id)
|
|
28
|
+
raise TypeError, MERCHANT_ID_REQUIRED_ERROR if merchant_id.nil? || merchant_id.empty?
|
|
29
|
+
raise TypeError, PAYMENT_INTENT_ID_REQUIRED_ERROR if payment_intent_id.nil? || payment_intent_id.empty?
|
|
30
|
+
|
|
31
|
+
response = make_api_call(URI.join(get_config.host, "/v1/#{merchant_id}/payment-intents/#{payment_intent_id}").to_s,
|
|
32
|
+
method: 'GET', headers: {})
|
|
33
|
+
deserialize_json(response, PCPServerSDK::Models::PaymentIntentResponse)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|