Skip to content

Commit b645146

Browse files
committed
Merge branch '327-update-payment-api-to-2024-3' into 'master'
Resolve "Update Payment API to 2024-3" Closes #327 See merge request pace/mobile/android/pace-cloud-sdk!354
2 parents 6374dc2 + 6b92cdb commit b645146

File tree

12 files changed

+178
-5
lines changed

12 files changed

+178
-5
lines changed

library/src/main/java/cloud/pace/sdk/api/pay/PayAPI.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ package cloud.pace.sdk.api.pay
1010
import cloud.pace.sdk.api.API
1111

1212
/** Welcome to the PACE Payment API documentation.
13-
This API is responsible for managing payment methods for users as well as authorizing payments on behalf of PACE services.
13+
The PACE Payment API is responsible for managing payment methods for users as well as authorizing payments on behalf of PACE services.
1414
*/
1515
object PayAPI {
1616

17-
const val VERSION = "2024-2"
17+
const val VERSION = "2024-3"
1818
internal val baseUrl = "${API.baseUrl}/pay/$VERSION/"
1919

2020
class FleetPaymentMethodsAPI

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/PaymentMethodBody.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ class PaymentMethodBody {
4343
/* Implicit (`true`) payment methods are read-only and cannot be deleted, e.g., ApplePay */
4444
var implicit: Boolean? = null
4545

46+
/* Indicates if the payment method is eligible for discounts. */
47+
var isEligibleForDiscounts: Boolean? = null
48+
4649
/* one of sepa, creditcard, paypal, paydirekt, dkv, applepay, ... */
4750
var kind: String? = null
4851

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/PaymentMethodKindModel.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ class PaymentMethodKind : Resource() {
2222
/* Indicates whether the payment method is a fuel card. Fuelcard `no` means no. */
2323
var fuelcard: Boolean? = null
2424

25-
/* Indicates whether the payment method can be onboarded/modified. Implict `true` means no. Otherwise yes.
26-
Most payment method kinds are no implicit, i.e., `implicit=false`.
25+
/* Indicates whether the payment method has been onboarded implicitely, e.g., an on-device payment method such as Apple Pay or Google Pay.
2726
This field is optional and if not present should be assumed to indicate `implicit=false`.
2827
*/
2928
var implicit: Boolean? = null
3029

30+
/* Indicates whether the payment method can be onboarded/modified. Managed `true` means no. Otherwise yes.
31+
Most payment method kinds are not managed, i.e., `managed=false`.
32+
*/
33+
var managed: Boolean? = null
34+
3135
/* localized name */
3236
var name: String? = null
3337

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/PaymentMethodModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ class PaymentMethod : Resource() {
3434
/* Implicit (`true`) payment methods are read-only and cannot be deleted, e.g., ApplePay */
3535
var implicit: Boolean? = null
3636

37+
/* Indicates if the payment method is eligible for discounts. */
38+
var isEligibleForDiscounts: Boolean? = null
39+
3740
/* one of sepa, creditcard, paypal, paydirekt, dkv, applepay, ... */
3841
var kind: String? = null
3942

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/PaymentTokenCreateBody.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ class PaymentTokenCreateBody {
3535

3636
/* Set this flag to `true` if you accept the authorized amount to be lower than the requested amount. */
3737
var allowPartialAmount: Boolean? = null
38+
39+
/* The billing e-mail address */
40+
var billingEmail: String? = null
3841
var discountTokens: List<String>? = null
3942

4043
/* The code and method for two factor authentication, if required by the payment method */

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/PaymentTokenCreateModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ class PaymentTokenCreate : Resource() {
2222

2323
/* Set this flag to `true` if you accept the authorized amount to be lower than the requested amount. */
2424
var allowPartialAmount: Boolean? = null
25+
26+
/* The billing e-mail address */
27+
var billingEmail: String? = null
2528
var discountTokens: List<String>? = null
2629

2730
/* The code and method for two factor authentication, if required by the payment method */

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/TransactionCreateBody.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ class TransactionCreateBody {
7070
/* The given productFlow (e.g. preAuth, postPay) */
7171
var productFlow: String? = null
7272

73+
/* Additional information that will be rendered on the receipt */
74+
var receiptInformation: List<String>? = null
75+
7376
/* Set to true if the payment is for an unattended process */
7477
var unattended: Boolean? = null
7578

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/TransactionCreateModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class TransactionCreate : Resource() {
5757
/* The given productFlow (e.g. preAuth, postPay) */
5858
var productFlow: String? = null
5959

60+
/* Additional information that will be rendered on the receipt */
61+
var receiptInformation: List<String>? = null
62+
6063
/* Set to true if the payment is for an unattended process */
6164
var unattended: Boolean? = null
6265

library/src/main/java/cloud/pace/sdk/api/pay/generated/model/TransactionModel.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ class Transaction : Resource() {
8686

8787
/* PACE resource name */
8888
var purposePRN: String? = null
89+
90+
/* Additional information that will be rendered on the receipt */
91+
var receiptInformation: List<String>? = null
8992
var references: List<String>? = null
9093

9194
/* Date of the last update (UTC) (https://tools.ietf.org/html/rfc3339#section-5.6).
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* PLEASE DO NOT EDIT!
3+
*
4+
* Generated by SwagGen with Kotlin template.
5+
* https://github.com/pace/SwagGen
6+
*/
7+
8+
package cloud.pace.sdk.api.pay.generated.request.paymentMethodKinds
9+
10+
import cloud.pace.sdk.api.pay.PayAPI
11+
import cloud.pace.sdk.api.pay.generated.model.PaymentMethodKinds
12+
import cloud.pace.sdk.api.request.BaseRequest
13+
import retrofit2.Call
14+
import retrofit2.http.GET
15+
import retrofit2.http.Header
16+
import retrofit2.http.HeaderMap
17+
import retrofit2.http.Path
18+
import retrofit2.http.Query
19+
20+
object GetPaymentMethodKindsByClientIDAPI {
21+
22+
interface GetPaymentMethodKindsByClientIDService {
23+
/* Get all payment method kinds for a specific client */
24+
/* Returns all payment method kinds that are supported by this service. Use the Accept-Language header for localization. */
25+
@GET("payment-method-kinds/{clientId}")
26+
fun getPaymentMethodKindsByClientID(
27+
@HeaderMap headers: Map<String, String>,
28+
/* ID of the client */
29+
@Path("clientId") clientId: String,
30+
/* Language preference of localized response properties. The full standard of RFC 7231 (https://tools.ietf.org/html/rfc7231#section-5.3.5) is supported. */
31+
@Header("Accept-Language") acceptLanguage: String? = null,
32+
/* Flag to allow more data to the payment method kinds. */
33+
@Query("additionalData") additionalData: Boolean? = null,
34+
/* Filter allowed payment methods kinds by poi. */
35+
@Query("poiID") poiID: String? = null
36+
): Call<PaymentMethodKinds>
37+
}
38+
39+
open class Request : BaseRequest() {
40+
41+
fun getPaymentMethodKindsByClientID(
42+
clientId: String,
43+
acceptLanguage: String? = null,
44+
additionalData: Boolean? = null,
45+
poiID: String? = null,
46+
readTimeout: Long? = null,
47+
additionalHeaders: Map<String, String>? = null,
48+
additionalParameters: Map<String, String>? = null
49+
): Call<PaymentMethodKinds> {
50+
val headers = headers(false, "application/vnd.api+json", "application/vnd.api+json", additionalHeaders)
51+
52+
return retrofit(PayAPI.baseUrl, additionalParameters, readTimeout)
53+
.create(GetPaymentMethodKindsByClientIDService::class.java)
54+
.getPaymentMethodKindsByClientID(
55+
headers,
56+
clientId,
57+
acceptLanguage,
58+
additionalData,
59+
poiID
60+
)
61+
}
62+
}
63+
64+
fun PayAPI.PaymentMethodKindsAPI.getPaymentMethodKindsByClientID(
65+
clientId: String,
66+
acceptLanguage: String? = null,
67+
additionalData: Boolean? = null,
68+
poiID: String? = null,
69+
readTimeout: Long? = null,
70+
additionalHeaders: Map<String, String>? = null,
71+
additionalParameters: Map<String, String>? = null
72+
) = Request().getPaymentMethodKindsByClientID(
73+
clientId,
74+
acceptLanguage,
75+
additionalData,
76+
poiID,
77+
readTimeout,
78+
additionalHeaders,
79+
additionalParameters
80+
)
81+
}

0 commit comments

Comments
 (0)