Skip to content

Commit

Permalink
Merge pull request #84 from pokepay/feature/add-request-id-to-topup
Browse files Browse the repository at this point in the history
Add `request_id` to topup endpoints
  • Loading branch information
DanRidh authored Oct 16, 2024
2 parents 1fdca26 + 02c3ea6 commit e3fc256
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ public extension BankAPI.CreditCard {
public let token: String
public let accountId: String
public let amount: Int
public let requestId: String?
public let organizationCode: String?
public let isCardholderNameSpecified: Bool?

public typealias Response = String

public init(userId: String, token: String, accountId: String, amount: Int, organizationCode: String? = nil, isCardholderNameSpecified: Bool? = nil) {
public init(userId: String, token: String, accountId: String, amount: Int, requestId: String? = nil, organizationCode: String? = nil, isCardholderNameSpecified: Bool? = nil) {
self.userId = userId
self.token = token
self.accountId = accountId
self.amount = amount
self.requestId = requestId
self.organizationCode = organizationCode
self.isCardholderNameSpecified = isCardholderNameSpecified
}
Expand All @@ -40,6 +42,10 @@ public extension BankAPI.CreditCard {

dict["amount"] = amount

if requestId != nil {
dict["request_id"] = requestId
}

if organizationCode != nil {
dict["organization_code"] = organizationCode
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ public extension BankAPI.CreditCard {
public let cardRegisteredAt: String
public let accountId: String
public let amount: Int
public let requestId: String?
public let deleteCardIfAuthFail: Bool?
public let organizationCode: String?

public typealias Response = String

public init(userId: String, cardRegisteredAt: String, accountId: String, amount: Int, deleteCardIfAuthFail: Bool? = nil, organizationCode: String? = nil) {
public init(userId: String, cardRegisteredAt: String, accountId: String, amount: Int, requestId: String? = nil, deleteCardIfAuthFail: Bool? = nil, organizationCode: String? = nil) {
self.userId = userId
self.cardRegisteredAt = cardRegisteredAt
self.accountId = accountId
self.amount = amount
self.requestId = requestId
self.deleteCardIfAuthFail = deleteCardIfAuthFail
self.organizationCode = organizationCode
}
Expand All @@ -40,6 +42,10 @@ public extension BankAPI.CreditCard {

dict["amount"] = amount

if requestId != nil {
dict["request_id"] = requestId
}

if deleteCardIfAuthFail != nil {
dict["delete_card_if_auth_fail"] = deleteCardIfAuthFail
}
Expand Down

0 comments on commit e3fc256

Please sign in to comment.