pcp-server-ruby-sdk 1.13.0 → 1.14.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 +6 -0
- data/README.md +1 -1
- data/api-definition.yaml +384 -13
- data/lib/PCP-server-Ruby-SDK/endpoints/pay_by_link_api_client.rb +33 -0
- data/lib/PCP-server-Ruby-SDK/models/authentication_token.rb +6 -183
- data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_request.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/create_pay_by_link_response.rb +13 -0
- data/lib/PCP-server-Ruby-SDK/models/create_payment_intent.rb +1 -1
- data/lib/PCP-server-Ruby-SDK/models/pay_link_status_value.rb +20 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_information_response.rb +4 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_link_order.rb +10 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_link_specific_input.rb +19 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_customer_account_for_intent.rb +12 -0
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output.rb +5 -6
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_for_intent.rb +5 -6
- data/lib/PCP-server-Ruby-SDK/models/payment_references_for_payment_intent.rb +11 -0
- data/lib/PCP-server-Ruby-SDK/queries/get_checkouts_query.rb +5 -1
- data/lib/PCP-server-Ruby-SDK/version.rb +1 -1
- data/lib/PCP-server-Ruby-SDK.rb +8 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/spec/endpoints/pay_by_link_api_client_spec.rb +38 -0
- data/spec/endpoints/payment_information_api_client_spec.rb +9 -2
- data/spec/endpoints/payment_intent_api_client_spec.rb +3 -1
- data/spec/models/pay_by_link_models_spec.rb +50 -0
- data/spec/models/payment_intent_models_spec.rb +26 -0
- data/spec/queries/get_checkouts_query_spec.rb +15 -0
- metadata +20 -9
- data/lib/PCP-server-Ruby-SDK/models/payment_product840_specific_output_data.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bf3eb55ab8030c91fa72d6078f04aa11da5bd47d9634e70358fbc6aaff117bf4
|
|
4
|
+
data.tar.gz: 7d922527626c491229b3a9dad3173847956e2915211dbd91584b58cb51db1638
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f40123297fd445eefe6a33a30e1786babfe33ba8d56a1bc671a2b81c5389770de41d3ea40aba18a029925b048a813f7e188b9fb33fc68e1c725063fbff566f89
|
|
7
|
+
data.tar.gz: 362be602dc0927b645e16fd2e14cfdc82ad65bc0bf44344ed303a528d8e13ae61662385a6f2b93caaee9933b6fe326443d82c5e9bdf778481132b736e6ec3fd0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
# [1.14.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v1.13.0...v1.14.0) (2026-09-21)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* feat: update API version to 1.65.0 ([5bcf38718a57a8ab82e0ccd0ddb783cd4a9b2b34](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/commit/5bcf38718a57a8ab82e0ccd0ddb783cd4a9b2b34))
|
|
6
|
+
|
|
1
7
|
# [1.13.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-ruby/compare/v1.12.0...v1.13.0) (2026-07-23)
|
|
2
8
|
|
|
3
9
|
### 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.65.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.65.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.
|
|
@@ -27,6 +27,48 @@ tags:
|
|
|
27
27
|
description: Resource for operations on Payment Intent.
|
|
28
28
|
|
|
29
29
|
paths:
|
|
30
|
+
/v1/{merchantId}/authentication-tokens:
|
|
31
|
+
post:
|
|
32
|
+
summary: Generate a authentication JWT token
|
|
33
|
+
operationId: generateAuthToken
|
|
34
|
+
tags:
|
|
35
|
+
- Authentication
|
|
36
|
+
parameters:
|
|
37
|
+
- name: merchantId
|
|
38
|
+
in: path
|
|
39
|
+
description: The Merchant Id
|
|
40
|
+
required: true
|
|
41
|
+
schema:
|
|
42
|
+
type: string
|
|
43
|
+
- in: header
|
|
44
|
+
name: X-Request-ID
|
|
45
|
+
required: false
|
|
46
|
+
description: Identifier for this request as provided by the client. Will be used
|
|
47
|
+
in all log statements
|
|
48
|
+
schema:
|
|
49
|
+
type: string
|
|
50
|
+
format: uuid
|
|
51
|
+
responses:
|
|
52
|
+
'201':
|
|
53
|
+
description: Successfully generated authentication token
|
|
54
|
+
content:
|
|
55
|
+
application/json:
|
|
56
|
+
schema:
|
|
57
|
+
$ref: '#/components/schemas/AuthenticationToken'
|
|
58
|
+
'400':
|
|
59
|
+
x-nullable: true
|
|
60
|
+
description: Exception when creating DirectAPIKey with unknown or invalid parameters.
|
|
61
|
+
content:
|
|
62
|
+
application/json:
|
|
63
|
+
schema:
|
|
64
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
65
|
+
'500':
|
|
66
|
+
x-nullable: true
|
|
67
|
+
description: Server error when creating authentication token.
|
|
68
|
+
content:
|
|
69
|
+
application/json:
|
|
70
|
+
schema:
|
|
71
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
30
72
|
'/v1/{merchantId}/commerce-cases':
|
|
31
73
|
post:
|
|
32
74
|
summary: Create a Commerce Case
|
|
@@ -178,7 +220,7 @@ paths:
|
|
|
178
220
|
$ref: '#/components/schemas/ErrorResponse'
|
|
179
221
|
'/v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/order':
|
|
180
222
|
post:
|
|
181
|
-
summary: Creates an Order that will
|
|
223
|
+
summary: Creates an Order that will automatically execute a Payment
|
|
182
224
|
description: |
|
|
183
225
|
This endpoint can be used to create an Order that automatically executes a payment for the respective Checkout.
|
|
184
226
|
The Order request requires items within the ShoppingCart and can be made for a partial or the entire
|
|
@@ -622,6 +664,9 @@ paths:
|
|
|
622
664
|
- $ref: '#/components/parameters/companyInformation'
|
|
623
665
|
- $ref: '#/components/parameters/terminalId'
|
|
624
666
|
- $ref: '#/components/parameters/reportingToken'
|
|
667
|
+
- $ref: '#/components/parameters/cardAuthorizationId'
|
|
668
|
+
- $ref: '#/components/parameters/receiptNumber'
|
|
669
|
+
- $ref: '#/components/parameters/traceNumber'
|
|
625
670
|
responses:
|
|
626
671
|
'200':
|
|
627
672
|
x-nullable: true
|
|
@@ -638,6 +683,57 @@ paths:
|
|
|
638
683
|
application/json:
|
|
639
684
|
schema:
|
|
640
685
|
$ref: '#/components/schemas/ErrorResponse'
|
|
686
|
+
'/v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}/pay-by-link':
|
|
687
|
+
post:
|
|
688
|
+
summary: "Create a pay-link"
|
|
689
|
+
description: |-
|
|
690
|
+
This endpoint can be used to create a pay-link using which customer can make payment for the check out.
|
|
691
|
+
tags:
|
|
692
|
+
- PaybyLink
|
|
693
|
+
operationId: createPayByLink
|
|
694
|
+
parameters:
|
|
695
|
+
- $ref: '#/components/parameters/merchantIdPath'
|
|
696
|
+
- $ref: '#/components/parameters/commerceCaseIdPath'
|
|
697
|
+
- $ref: '#/components/parameters/checkoutIdPath'
|
|
698
|
+
requestBody:
|
|
699
|
+
required: true
|
|
700
|
+
content:
|
|
701
|
+
application/json:
|
|
702
|
+
schema:
|
|
703
|
+
$ref: '#/components/schemas/CreatePayByLinkRequest'
|
|
704
|
+
responses:
|
|
705
|
+
'201':
|
|
706
|
+
description: |-
|
|
707
|
+
The response contains the details of the created pay-link.
|
|
708
|
+
content:
|
|
709
|
+
application/json:
|
|
710
|
+
schema:
|
|
711
|
+
$ref: '#/components/schemas/CreatePayByLinkResponse'
|
|
712
|
+
'404':
|
|
713
|
+
description: |-
|
|
714
|
+
No matching data found for the given input parameters.
|
|
715
|
+
content:
|
|
716
|
+
application/json:
|
|
717
|
+
schema:
|
|
718
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
719
|
+
'500':
|
|
720
|
+
description: Internal server exception
|
|
721
|
+
content:
|
|
722
|
+
application/json:
|
|
723
|
+
schema:
|
|
724
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
725
|
+
'503':
|
|
726
|
+
description: Service unavailable.
|
|
727
|
+
content:
|
|
728
|
+
application/json:
|
|
729
|
+
schema:
|
|
730
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
731
|
+
'400':
|
|
732
|
+
description: "Data validation errors"
|
|
733
|
+
content:
|
|
734
|
+
application/json:
|
|
735
|
+
schema:
|
|
736
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
641
737
|
'/v1/{merchantId}/commerce-cases/{commerceCaseId}/checkouts/{checkoutId}':
|
|
642
738
|
get:
|
|
643
739
|
summary: Get Checkout Details
|
|
@@ -1482,7 +1578,7 @@ paths:
|
|
|
1482
1578
|
This endpoint can be used to create a payment intent for PayPal payment method.
|
|
1483
1579
|
tags:
|
|
1484
1580
|
- PaymentIntent
|
|
1485
|
-
operationId:
|
|
1581
|
+
operationId: createPaymentIntent
|
|
1486
1582
|
parameters:
|
|
1487
1583
|
- $ref: '#/components/parameters/merchantIdPath'
|
|
1488
1584
|
requestBody:
|
|
@@ -1556,6 +1652,15 @@ paths:
|
|
|
1556
1652
|
|
|
1557
1653
|
components:
|
|
1558
1654
|
parameters:
|
|
1655
|
+
cardAuthorizationId:
|
|
1656
|
+
in: query
|
|
1657
|
+
name: cardAuthorizationId
|
|
1658
|
+
description: |-
|
|
1659
|
+
Filter your results by the authorization ID assigned to the card payment.
|
|
1660
|
+
schema:
|
|
1661
|
+
type: string
|
|
1662
|
+
maxLength: 8
|
|
1663
|
+
example: 260042
|
|
1559
1664
|
checkoutIdPath:
|
|
1560
1665
|
in: path
|
|
1561
1666
|
name: checkoutId
|
|
@@ -1853,6 +1958,15 @@ components:
|
|
|
1853
1958
|
type: string
|
|
1854
1959
|
x-trim-at: 20
|
|
1855
1960
|
example: '+1234567890'
|
|
1961
|
+
receiptNumber:
|
|
1962
|
+
in: query
|
|
1963
|
+
name: receiptNumber
|
|
1964
|
+
description: |-
|
|
1965
|
+
Filter your results by the receipt number set by the terminal.
|
|
1966
|
+
schema:
|
|
1967
|
+
type: string
|
|
1968
|
+
maxLength: 40
|
|
1969
|
+
example: 0321
|
|
1856
1970
|
reportingToken:
|
|
1857
1971
|
in: query
|
|
1858
1972
|
name: reportingToken
|
|
@@ -1984,6 +2098,15 @@ components:
|
|
|
1984
2098
|
maximum: 999999999999
|
|
1985
2099
|
minimum: 0
|
|
1986
2100
|
example: 1000
|
|
2101
|
+
traceNumber:
|
|
2102
|
+
in: query
|
|
2103
|
+
name: traceNumber
|
|
2104
|
+
description: |-
|
|
2105
|
+
Filter your results by the trace number set by the terminal.
|
|
2106
|
+
schema:
|
|
2107
|
+
type: string
|
|
2108
|
+
maxLength: 40
|
|
2109
|
+
example: 012345
|
|
1987
2110
|
schemas:
|
|
1988
2111
|
Address:
|
|
1989
2112
|
type: object
|
|
@@ -2221,6 +2344,7 @@ components:
|
|
|
2221
2344
|
* SALE - The payment creation results in an authorization that is already captured at the moment of approval.
|
|
2222
2345
|
|
|
2223
2346
|
If the parameter is not provided in the request, the default value will be PRE_AUTHORIZATION
|
|
2347
|
+
default: PRE_AUTHORIZATION
|
|
2224
2348
|
BankAccountInformation:
|
|
2225
2349
|
type: object
|
|
2226
2350
|
description: Object containing information about the end customer's bank account.
|
|
@@ -3115,9 +3239,11 @@ components:
|
|
|
3115
3239
|
amountOfMoney:
|
|
3116
3240
|
$ref: '#/components/schemas/AmountOfMoney'
|
|
3117
3241
|
references:
|
|
3118
|
-
$ref: '#/components/schemas/
|
|
3242
|
+
$ref: '#/components/schemas/PaymentReferencesForPaymentIntent'
|
|
3119
3243
|
shoppingCart:
|
|
3120
3244
|
$ref: '#/components/schemas/ShoppingCartData'
|
|
3245
|
+
required:
|
|
3246
|
+
- references
|
|
3121
3247
|
CreatePaymentIntentRequest:
|
|
3122
3248
|
title: PaymentIntentRequest
|
|
3123
3249
|
type: object
|
|
@@ -4285,6 +4411,18 @@ components:
|
|
|
4285
4411
|
(e.g. card present payments, cash payments or payments processed by other payment providers).
|
|
4286
4412
|
maxLength: 40
|
|
4287
4413
|
example: 6a891660b8cf16edaeb26f87d86f0b2f
|
|
4414
|
+
traceNumber:
|
|
4415
|
+
type: string
|
|
4416
|
+
description: Tracenumber that is incremented by the terminal by 1 for every transaction request.
|
|
4417
|
+
It is printed on the customer receipt. Usually it has an upper limit and restarts by 0 or 1 if the upper limit is reached.
|
|
4418
|
+
maxLength: 40
|
|
4419
|
+
example: "012345"
|
|
4420
|
+
receiptNumber:
|
|
4421
|
+
type: string
|
|
4422
|
+
description: Receiptnumber, that is incremented by 1 by the terminal for every successful financial transaction.
|
|
4423
|
+
It is printed on the customer receipt. Usually it has an upper limit and restarts by 0 or 1 if the upper limit is reached.
|
|
4424
|
+
maxLength: 40
|
|
4425
|
+
example: "0321"
|
|
4288
4426
|
creationDateTime:
|
|
4289
4427
|
type: string
|
|
4290
4428
|
format: date-time
|
|
@@ -4537,17 +4675,29 @@ components:
|
|
|
4537
4675
|
type: string
|
|
4538
4676
|
description: Surname of the PayPal account holder
|
|
4539
4677
|
example: Doe
|
|
4540
|
-
|
|
4678
|
+
PaymentProduct840CustomerAccountForIntent:
|
|
4541
4679
|
type: object
|
|
4542
4680
|
description: |
|
|
4543
|
-
|
|
4544
|
-
allOf:
|
|
4545
|
-
- $ref: '#/components/schemas/PaymentProduct840SpecificOutputData'
|
|
4681
|
+
Object containing the details of the PayPal account.
|
|
4546
4682
|
additionalProperties: false
|
|
4547
4683
|
properties:
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4684
|
+
companyName:
|
|
4685
|
+
type: string
|
|
4686
|
+
description: Name of the company in case the PayPal account is owned by a business
|
|
4687
|
+
example: Customer Company Name
|
|
4688
|
+
firstName:
|
|
4689
|
+
type: string
|
|
4690
|
+
description: First name of the PayPal account holder
|
|
4691
|
+
example: John
|
|
4692
|
+
surname:
|
|
4693
|
+
type: string
|
|
4694
|
+
description: Surname of the PayPal account holder
|
|
4695
|
+
example: Doe
|
|
4696
|
+
emailAddress:
|
|
4697
|
+
type: string
|
|
4698
|
+
description: Email address of the customer
|
|
4699
|
+
maxLength: 70
|
|
4700
|
+
PaymentProduct840SpecificOutput:
|
|
4551
4701
|
type: object
|
|
4552
4702
|
description: |
|
|
4553
4703
|
PayPal (payment product 840) specific details.
|
|
@@ -4559,14 +4709,20 @@ components:
|
|
|
4559
4709
|
$ref: '#/components/schemas/PaymentProduct840CustomerAccount'
|
|
4560
4710
|
payPalTransactionId:
|
|
4561
4711
|
$ref: '#/components/schemas/PayPalTransactionId'
|
|
4712
|
+
shippingAddress:
|
|
4713
|
+
$ref: '#/components/schemas/Address'
|
|
4562
4714
|
PaymentProduct840SpecificOutputForIntent:
|
|
4563
4715
|
type: object
|
|
4564
4716
|
description: |
|
|
4565
4717
|
PayPal (payment product 840) specific details.
|
|
4566
|
-
allOf:
|
|
4567
|
-
- $ref: '#/components/schemas/PaymentProduct840SpecificOutputData'
|
|
4568
4718
|
additionalProperties: false
|
|
4569
4719
|
properties:
|
|
4720
|
+
billingAddress:
|
|
4721
|
+
$ref: '#/components/schemas/Address'
|
|
4722
|
+
customerAccount:
|
|
4723
|
+
$ref: '#/components/schemas/PaymentProduct840CustomerAccountForIntent'
|
|
4724
|
+
payPalTransactionId:
|
|
4725
|
+
$ref: '#/components/schemas/PayPalTransactionId'
|
|
4570
4726
|
shippingAddress:
|
|
4571
4727
|
$ref: '#/components/schemas/ShippingAddress'
|
|
4572
4728
|
PaymentProductId:
|
|
@@ -4590,6 +4746,15 @@ components:
|
|
|
4590
4746
|
If provided for captures or refunds, it must be unique per Checkout.
|
|
4591
4747
|
maxLength: 20
|
|
4592
4748
|
example: your-order-6372
|
|
4749
|
+
PaymentReferencesForPaymentIntent:
|
|
4750
|
+
description: |-
|
|
4751
|
+
Object that holds all reference properties that are linked to this transaction.
|
|
4752
|
+
Extends the standard PaymentReferences by making merchantReference mandatory when creating a payment intent.
|
|
4753
|
+
allOf:
|
|
4754
|
+
- $ref: '#/components/schemas/PaymentReferences'
|
|
4755
|
+
- type: object
|
|
4756
|
+
required:
|
|
4757
|
+
- merchantReference
|
|
4593
4758
|
PaymentReferencesForRefund:
|
|
4594
4759
|
type: object
|
|
4595
4760
|
description: |-
|
|
@@ -5490,3 +5655,209 @@ components:
|
|
|
5490
5655
|
- first
|
|
5491
5656
|
- subsequent
|
|
5492
5657
|
x-enum-to-string: false
|
|
5658
|
+
CreatePayByLinkRequest:
|
|
5659
|
+
type: object
|
|
5660
|
+
description: Request object for pay-link generation.
|
|
5661
|
+
properties:
|
|
5662
|
+
paymentLinkSpecificInput:
|
|
5663
|
+
$ref: '#/components/schemas/PaymentLinkSpecificInput'
|
|
5664
|
+
orderType:
|
|
5665
|
+
$ref: '#/components/schemas/OrderType'
|
|
5666
|
+
items:
|
|
5667
|
+
type: array
|
|
5668
|
+
items:
|
|
5669
|
+
$ref: '#/components/schemas/OrderItem'
|
|
5670
|
+
orderReferences:
|
|
5671
|
+
$ref: '#/components/schemas/References'
|
|
5672
|
+
required:
|
|
5673
|
+
- paymentLinkSpecificInput
|
|
5674
|
+
- orderType
|
|
5675
|
+
- orderReferences
|
|
5676
|
+
PaymentLinkSpecificInput:
|
|
5677
|
+
type: object
|
|
5678
|
+
description: Object containing the specific input details for generating Pay-link
|
|
5679
|
+
properties:
|
|
5680
|
+
expirationDate:
|
|
5681
|
+
type: string
|
|
5682
|
+
format: date-time
|
|
5683
|
+
description: |-
|
|
5684
|
+
If provided it overwrites 24 h default validity.
|
|
5685
|
+
Date and time in RFC3339 format after which Items (Checkouts or Commerce-Cases, depending on the context) should be included in the request. Accepted formats are:
|
|
5686
|
+
YYYY-MM-DD'T'HH:mm:ss'Z'
|
|
5687
|
+
YYYY-MM-DD'T'HH:mm:ss+XX:XX
|
|
5688
|
+
YYYY-MM-DD'T'HH:mm:ss-XX:XX
|
|
5689
|
+
YYYY-MM-DD'T'HH:mm'Z'
|
|
5690
|
+
YYYY-MM-DD'T'HH:mm+XX:XX
|
|
5691
|
+
YYYY-MM-DD'T'HH:mm-XX:XX
|
|
5692
|
+
All other formats may be ignored by the system.
|
|
5693
|
+
some examples:
|
|
5694
|
+
YYYY-MM-DDThh:mm:ssZ:
|
|
5695
|
+
value: 2022-11-10T13:34:23Z
|
|
5696
|
+
YYYY-MM-DDThh:mm:ss+XX:XX:
|
|
5697
|
+
value: 2022-11-10T14:34:23+01:00
|
|
5698
|
+
authorizationMode:
|
|
5699
|
+
$ref: '#/components/schemas/AuthorizationMode'
|
|
5700
|
+
paymentMethods:
|
|
5701
|
+
type: array
|
|
5702
|
+
items:
|
|
5703
|
+
$ref: '#/components/schemas/PaymentMethodId'
|
|
5704
|
+
description: List of supported Payment product identifiers
|
|
5705
|
+
example: [ 1,2,3,390 ]
|
|
5706
|
+
bnplId:
|
|
5707
|
+
type: string
|
|
5708
|
+
description: Dedicated ID to be known when the page is generated to display the BNPL payment methods in order to create a dedicated identification token.
|
|
5709
|
+
example: 18323
|
|
5710
|
+
returnUrl:
|
|
5711
|
+
type: string
|
|
5712
|
+
format: uri
|
|
5713
|
+
pattern: '^(https?|ftp)://[^\s/$.?#].[^\s]*$'
|
|
5714
|
+
description: |-
|
|
5715
|
+
The URL that the customer is redirect to after the payment flow has finished. You can add any number of key
|
|
5716
|
+
value pairs in the query string that, for instance help you to identify the customer when they return to
|
|
5717
|
+
your site. Please note that we will also append some additional key value pairs that will also help you with
|
|
5718
|
+
this identification process.
|
|
5719
|
+
Note: The provided URL should be absolute and contain the protocol to use, e.g. http:// or https://. For use
|
|
5720
|
+
on mobile devices a custom protocol can be used in the form of protocol://. This protocol must be registered
|
|
5721
|
+
on the device first.
|
|
5722
|
+
URLs without a protocol will be rejected.
|
|
5723
|
+
maxLength: 2048
|
|
5724
|
+
example: "https://shop.url/orderfinishedetc"
|
|
5725
|
+
logoUrl:
|
|
5726
|
+
type: string
|
|
5727
|
+
format: uri
|
|
5728
|
+
pattern: '^(https?|ftp)://[^\s/$.?#].[^\s]*$'
|
|
5729
|
+
description: To be used If the Merchant wants the customer to see his Logo ( special size need to be defined )
|
|
5730
|
+
maxLength: 2048
|
|
5731
|
+
example: "https://shop.url/orderfinishedetc"
|
|
5732
|
+
autoRedirection:
|
|
5733
|
+
type: boolean
|
|
5734
|
+
example: true
|
|
5735
|
+
description: |-
|
|
5736
|
+
with the cases:
|
|
5737
|
+
If is false and ReturnURl is not present, then no Button is displayed for shopper to come back
|
|
5738
|
+
If is false but ReturnUrl is present then, a button will be displayed with a custom message if user wants to go back to merchant
|
|
5739
|
+
If is True, no button will be displayed, and when payment is completed, user is returned back to a landing page on the merchant side using the returnUrl|
|
|
5740
|
+
termsUrl:
|
|
5741
|
+
type: string
|
|
5742
|
+
format: uri
|
|
5743
|
+
pattern: '^(https?|ftp)://[^\s/$.?#].[^\s]*$'
|
|
5744
|
+
description: |-
|
|
5745
|
+
Url to show the customer terms & conditions content
|
|
5746
|
+
maxLength: 2048
|
|
5747
|
+
example: "https://shop.url/tersmandconditions"
|
|
5748
|
+
retryNumber:
|
|
5749
|
+
type: integer
|
|
5750
|
+
format: int64
|
|
5751
|
+
description: Number of times to retry the back end apis, if not specified by default 3 retries
|
|
5752
|
+
example: 4
|
|
5753
|
+
minimum: 1
|
|
5754
|
+
maximum: 20
|
|
5755
|
+
merchantName:
|
|
5756
|
+
$ref: '#/components/schemas/MerchantName'
|
|
5757
|
+
merchantOrigin:
|
|
5758
|
+
$ref: '#/components/schemas/MerchantOrigin'
|
|
5759
|
+
required:
|
|
5760
|
+
- authorizationMode
|
|
5761
|
+
- paymentMethods
|
|
5762
|
+
PaymentMethodId:
|
|
5763
|
+
type: string
|
|
5764
|
+
description: Payment method identifier used by the payment engine.
|
|
5765
|
+
CreatePayByLinkResponse:
|
|
5766
|
+
type: object
|
|
5767
|
+
description: Object containing details about created Pay-link.
|
|
5768
|
+
additionalProperties: false
|
|
5769
|
+
properties:
|
|
5770
|
+
expirationDate:
|
|
5771
|
+
type: string
|
|
5772
|
+
format: date-time
|
|
5773
|
+
description: |-
|
|
5774
|
+
If provided it overwrites 24 h default validity.
|
|
5775
|
+
Date and time in RFC3339 format after which Items (Checkouts or Commerce-Cases, depending on the context) should be included in the request. Accepted formats are:
|
|
5776
|
+
YYYY-MM-DD'T'HH:mm:ss'Z'
|
|
5777
|
+
YYYY-MM-DD'T'HH:mm:ss+XX:XX
|
|
5778
|
+
YYYY-MM-DD'T'HH:mm:ss-XX:XX
|
|
5779
|
+
YYYY-MM-DD'T'HH:mm'Z'
|
|
5780
|
+
YYYY-MM-DD'T'HH:mm+XX:XX
|
|
5781
|
+
YYYY-MM-DD'T'HH:mm-XX:XX
|
|
5782
|
+
All other formats may be ignored by the system.
|
|
5783
|
+
some examples:
|
|
5784
|
+
YYYY-MM-DDThh:mm:ssZ:
|
|
5785
|
+
value: 2022-11-10T13:34:23Z
|
|
5786
|
+
YYYY-MM-DDThh:mm:ss+XX:XX:
|
|
5787
|
+
value: 2022-11-10T14:34:23+01:00
|
|
5788
|
+
paymentLinkOrder:
|
|
5789
|
+
$ref: "#/components/schemas/PaymentLinkOrder"
|
|
5790
|
+
status:
|
|
5791
|
+
$ref: '#/components/schemas/PayLinkStatusValue'
|
|
5792
|
+
redirectionUrl:
|
|
5793
|
+
type: string
|
|
5794
|
+
example: "https://commerceplatformURL/25296588-4ddc-4632-9818-532840d49780"
|
|
5795
|
+
paymentLinkId:
|
|
5796
|
+
type: string
|
|
5797
|
+
format: UUID
|
|
5798
|
+
description: Unique identifier for the pay-link
|
|
5799
|
+
PaymentLinkOrder:
|
|
5800
|
+
type: object
|
|
5801
|
+
properties:
|
|
5802
|
+
merchantReference:
|
|
5803
|
+
type: string
|
|
5804
|
+
example: "Order-20250119112400"
|
|
5805
|
+
amount:
|
|
5806
|
+
type: object
|
|
5807
|
+
properties:
|
|
5808
|
+
amount:
|
|
5809
|
+
type: integer
|
|
5810
|
+
format: int64
|
|
5811
|
+
example: 30200
|
|
5812
|
+
description: Total amount of money to be paid
|
|
5813
|
+
currencyCode:
|
|
5814
|
+
type: string
|
|
5815
|
+
description: Currency code (e.g., EUR)
|
|
5816
|
+
PayLinkStatusValue:
|
|
5817
|
+
type: string
|
|
5818
|
+
description: enum for pay-link status
|
|
5819
|
+
enum:
|
|
5820
|
+
- ACTIVE
|
|
5821
|
+
- PAID
|
|
5822
|
+
- EXPIRED
|
|
5823
|
+
- REDIRECTED
|
|
5824
|
+
MerchantName:
|
|
5825
|
+
type: string
|
|
5826
|
+
description: >-
|
|
5827
|
+
The canonical name of the merchant that initiates the checkout,
|
|
5828
|
+
per your records. This name needs to be suitable for display.
|
|
5829
|
+
Don't localize the name.
|
|
5830
|
+
example: "TestMerchant"
|
|
5831
|
+
MerchantOrigin:
|
|
5832
|
+
type: string
|
|
5833
|
+
description: >-
|
|
5834
|
+
The fully qualified domain of the merchant who made the request.
|
|
5835
|
+
Make this string the hostname of the merchant's website where the
|
|
5836
|
+
checkout initiation occurs. For international (non-ASCII) domains,
|
|
5837
|
+
use Punycode. For example, if the merchant domain is google.rf,
|
|
5838
|
+
provide an origin value of xn-c1aay4a.xn-p1ai. The string can
|
|
5839
|
+
include an optional port number if it doesn't use a standard HTTP
|
|
5840
|
+
or HTTPS port value.
|
|
5841
|
+
example: "merchant.example.com"
|
|
5842
|
+
AuthenticationToken:
|
|
5843
|
+
type: object
|
|
5844
|
+
properties:
|
|
5845
|
+
token:
|
|
5846
|
+
type: string
|
|
5847
|
+
description: The JWT authentication token
|
|
5848
|
+
example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
|
|
5849
|
+
id:
|
|
5850
|
+
type: string
|
|
5851
|
+
format: uuid
|
|
5852
|
+
description: The unique identifier of the JWT authentication token
|
|
5853
|
+
example: "b311ea35-57c9-4118-8712-9a5bd253eb37"
|
|
5854
|
+
creationDate:
|
|
5855
|
+
type: string
|
|
5856
|
+
format: date-time
|
|
5857
|
+
description: The creation date of the JWT authentication token. Format YYYY-MM-DD'T'HH:mm:ss'Z'
|
|
5858
|
+
example: "2023-10-01T00:00:00.000Z"
|
|
5859
|
+
expirationDate:
|
|
5860
|
+
type: string
|
|
5861
|
+
format: date-time
|
|
5862
|
+
description: The expiration date of the JWT authentication token. Format YYYY-MM-DD'T'HH:mm:ss'Z'
|
|
5863
|
+
example: "2024-01-01T00:00:00.000Z"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
require 'uri'
|
|
3
|
+
require_relative 'base_api_client'
|
|
4
|
+
require_relative '../models/create_pay_by_link_response'
|
|
5
|
+
|
|
6
|
+
module PCPServerSDK
|
|
7
|
+
module Endpoints
|
|
8
|
+
class PayByLinkApiClient < BaseApiClient
|
|
9
|
+
# Create a pay-by-link for a checkout.
|
|
10
|
+
# @param merchant_id [String] The merchant identifier
|
|
11
|
+
# @param commerce_case_id [String] The commerce case identifier
|
|
12
|
+
# @param checkout_id [String] The checkout identifier
|
|
13
|
+
# @param payload [PCPServerSDK::Models::CreatePayByLinkRequest] The pay-by-link request
|
|
14
|
+
# @return [PCPServerSDK::Models::CreatePayByLinkResponse] The created pay-by-link
|
|
15
|
+
def create_pay_by_link_request(merchant_id, commerce_case_id, checkout_id, payload)
|
|
16
|
+
raise TypeError, MERCHANT_ID_REQUIRED_ERROR if merchant_id.nil? || merchant_id.empty?
|
|
17
|
+
raise TypeError, COMMERCE_CASE_ID_REQUIRED_ERROR if commerce_case_id.nil? || commerce_case_id.empty?
|
|
18
|
+
raise TypeError, CHECKOUT_ID_REQUIRED_ERROR if checkout_id.nil? || checkout_id.empty?
|
|
19
|
+
raise TypeError, PAYLOAD_REQUIRED_ERROR if payload.nil?
|
|
20
|
+
|
|
21
|
+
url = URI.join(get_config.host, "/v1/#{merchant_id}/commerce-cases/#{commerce_case_id}/checkouts/#{checkout_id}/pay-by-link")
|
|
22
|
+
request_init = {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: { 'Content-Type' => 'application/json' },
|
|
25
|
+
body: JSON.generate(payload)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
response = make_api_call(url.to_s, request_init)
|
|
29
|
+
deserialize_json(response, PCPServerSDK::Models::CreatePayByLinkResponse)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|