-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from pokepay/credit-card-api
Credit card api
- Loading branch information
Showing
21 changed files
with
469 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
|
||
public struct BankAPI { | ||
public struct Account {} | ||
public struct Bill {} | ||
public struct Cashtray {} | ||
public struct Check {} | ||
public struct CpmToken {} | ||
public struct CreditCard {} | ||
public struct PrivateMoney {} | ||
public struct Terminal {} | ||
public struct Transaction {} | ||
public struct User {} | ||
public struct PrivateMoney {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
import APIKit | ||
|
||
public extension BankAPI.CreditCard { | ||
struct CreateCreditCard: BankRequest { | ||
public let token: String | ||
public let isCardholderNameSpecified: Bool? | ||
public let organizationCode: String? | ||
public let userId: String | ||
|
||
public typealias Response = CreditCard | ||
|
||
public init(token: String, isCardholderNameSpecified: Bool? = nil, organizationCode: String? = nil, userId: String) { | ||
self.token = token | ||
self.isCardholderNameSpecified = isCardholderNameSpecified | ||
self.organizationCode = organizationCode | ||
self.userId = userId | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .post | ||
} | ||
|
||
public var path: String { | ||
return "/users/\(userId)/cards" | ||
} | ||
|
||
public var parameters: Any? { | ||
var dict: [String: Any] = [:] | ||
|
||
dict["token"] = token | ||
|
||
if isCardholderNameSpecified != nil { | ||
dict["is_cardholder_name_specified"] = isCardholderNameSpecified | ||
} | ||
|
||
if organizationCode != nil { | ||
dict["organization_code"] = organizationCode | ||
} | ||
|
||
return dict | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
import APIKit | ||
|
||
public extension BankAPI.CreditCard { | ||
struct DeleteCreditCard: BankRequest { | ||
public let cardRegisteredAt: String | ||
public let organizationCode: String? | ||
public let userId: String | ||
|
||
public typealias Response = NoContent | ||
|
||
public init(cardRegisteredAt: String, organizationCode: String? = nil, userId: String) { | ||
self.cardRegisteredAt = cardRegisteredAt | ||
self.organizationCode = organizationCode | ||
self.userId = userId | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .post | ||
} | ||
|
||
public var path: String { | ||
return "/users/\(userId)/cards/delete" | ||
} | ||
|
||
public var parameters: Any? { | ||
var dict: [String: Any] = [:] | ||
|
||
dict["card_registered_at"] = cardRegisteredAt | ||
|
||
if organizationCode != nil { | ||
dict["organization_code"] = organizationCode | ||
} | ||
|
||
return dict | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
import APIKit | ||
|
||
public extension BankAPI.CreditCard { | ||
struct GetCreditCards: BankRequest { | ||
public let userId: String | ||
public let before: String? | ||
public let after: String? | ||
public let perPage: Int? | ||
public let organizationCode: String? | ||
|
||
public typealias Response = PaginatedCreditCards | ||
|
||
public init(userId: String, before: String? = nil, after: String? = nil, perPage: Int? = nil, organizationCode: String? = nil) { | ||
self.userId = userId | ||
self.before = before | ||
self.after = after | ||
self.perPage = perPage | ||
self.organizationCode = organizationCode | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .get | ||
} | ||
|
||
public var path: String { | ||
return "/users/\(userId)/cards" | ||
} | ||
|
||
public var parameters: Any? { | ||
var dict: [String: Any] = [:] | ||
|
||
if before != nil { | ||
dict["before"] = before | ||
} | ||
|
||
if after != nil { | ||
dict["after"] = after | ||
} | ||
|
||
if perPage != nil { | ||
dict["per_page"] = perPage | ||
} | ||
|
||
if organizationCode != nil { | ||
dict["organization_code"] = organizationCode | ||
} | ||
|
||
return dict | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCardMdkToken.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
import APIKit | ||
|
||
public extension BankAPI.CreditCard { | ||
struct TopupWithCreditCardMdkToken: BankRequest { | ||
public let userId: String | ||
public let token: String | ||
public let accountId: String | ||
public let amount: Int | ||
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) { | ||
self.userId = userId | ||
self.token = token | ||
self.accountId = accountId | ||
self.amount = amount | ||
self.organizationCode = organizationCode | ||
self.isCardholderNameSpecified = isCardholderNameSpecified | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .post | ||
} | ||
|
||
public var path: String { | ||
return "/veritrans/card-authorize/topup-with-mdk-token" | ||
} | ||
|
||
public var parameters: Any? { | ||
var dict: [String: Any] = [:] | ||
|
||
dict["user_id"] = userId | ||
|
||
dict["token"] = token | ||
|
||
dict["account_id"] = accountId | ||
|
||
dict["amount"] = amount | ||
|
||
if organizationCode != nil { | ||
dict["organization_code"] = organizationCode | ||
} | ||
|
||
if isCardholderNameSpecified != nil { | ||
dict["is_cardholder_name_specified"] = isCardholderNameSpecified | ||
} | ||
|
||
return dict | ||
} | ||
|
||
public var responseContentType: String { | ||
return "text/html" | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
Sources/Pokepay/BankAPI/CreditCard/TopupWithCreditCardMembership.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// DO NOT EDIT: File is generated by code generator. | ||
import APIKit | ||
|
||
public extension BankAPI.CreditCard { | ||
struct TopupWithCreditCardMembership: BankRequest { | ||
public let userId: String | ||
public let cardRegisteredAt: String | ||
public let accountId: String | ||
public let amount: Int | ||
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) { | ||
self.userId = userId | ||
self.cardRegisteredAt = cardRegisteredAt | ||
self.accountId = accountId | ||
self.amount = amount | ||
self.deleteCardIfAuthFail = deleteCardIfAuthFail | ||
self.organizationCode = organizationCode | ||
} | ||
|
||
public var method: HTTPMethod { | ||
return .post | ||
} | ||
|
||
public var path: String { | ||
return "/veritrans/card-authorize/topup-with-membership" | ||
} | ||
|
||
public var parameters: Any? { | ||
var dict: [String: Any] = [:] | ||
|
||
dict["user_id"] = userId | ||
|
||
dict["card_registered_at"] = cardRegisteredAt | ||
|
||
dict["account_id"] = accountId | ||
|
||
dict["amount"] = amount | ||
|
||
if deleteCardIfAuthFail != nil { | ||
dict["delete_card_if_auth_fail"] = deleteCardIfAuthFail | ||
} | ||
|
||
if organizationCode != nil { | ||
dict["organization_code"] = organizationCode | ||
} | ||
|
||
return dict | ||
} | ||
|
||
public var responseContentType: String { | ||
return "text/html" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Foundation | ||
import APIKit | ||
|
||
final class HTMLDataParser: DataParser { | ||
var contentType: String? { | ||
return "text/html" | ||
} | ||
|
||
func parse(data: Data) throws -> Any { | ||
return data | ||
} | ||
} |
Oops, something went wrong.