Skip to content

Commit

Permalink
Merge branch 'develop' into 'main'
Browse files Browse the repository at this point in the history
v1.2.5

See merge request mangopay/dev/checkout-ios-sdk!100
  • Loading branch information
jidefela-mgp committed Oct 30, 2024
2 parents 2462965 + 0ff558a commit fc06d12
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 491 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,9 @@

* Migrated & updated NethoneSDk from xcframework to SPM package.


##1.2.5 (2024-10-23)

### Improvements

* Fix issue of adding SDK via SPM
4 changes: 0 additions & 4 deletions Examples/MangopayDemo/MangopayDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
6F008965F04D9E086FBBA1E2 /* Pods_MangopayDemo_MangopayDemoUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7FF5AC5BE8A89C4F84206F2 /* Pods_MangopayDemo_MangopayDemoUITests.framework */; };
9813A3672A8254CD0036F556 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9813A3662A8254CD0036F556 /* AppDelegate.swift */; };
9813A3692A8254CD0036F556 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9813A3682A8254CD0036F556 /* SceneDelegate.swift */; };
9813A36B2A8254CD0036F556 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9813A36A2A8254CD0036F556 /* ViewController.swift */; };
9813A36E2A8254CD0036F556 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9813A36C2A8254CD0036F556 /* Main.storyboard */; };
9813A3732A8254D00036F556 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9813A3712A8254D00036F556 /* LaunchScreen.storyboard */; };
9813A37E2A8254D00036F556 /* MangopayDemoTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9813A37D2A8254D00036F556 /* MangopayDemoTests.swift */; };
Expand Down Expand Up @@ -65,7 +64,6 @@
9813A3632A8254CD0036F556 /* MangopayDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MangopayDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
9813A3662A8254CD0036F556 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9813A3682A8254CD0036F556 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
9813A36A2A8254CD0036F556 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
9813A36D2A8254CD0036F556 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
9813A3722A8254D00036F556 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9813A3742A8254D00036F556 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -173,7 +171,6 @@
98E5CFB72A9C70C5000DF08B /* MangopayDemo.entitlements */,
9813A3662A8254CD0036F556 /* AppDelegate.swift */,
9813A3682A8254CD0036F556 /* SceneDelegate.swift */,
9813A36A2A8254CD0036F556 /* ViewController.swift */,
9813A3982A8261320036F556 /* ConfigurationController.swift */,
9813A3A02A8261320036F556 /* CongratsController.swift */,
9813A3A12A8261330036F556 /* CongratsController.xib */,
Expand Down Expand Up @@ -486,7 +483,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9813A36B2A8254CD0036F556 /* ViewController.swift in Sources */,
9813A3A92A8261330036F556 /* CongratsView.swift in Sources */,
9813A3A32A8261330036F556 /* ConfigurationController.swift in Sources */,
9813A3AD2A8261330036F556 /* Segue+Additions.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "b86f0a7203a1094329debea3650a5be073d1acd015e6e55bd40b5668c80d01da",
"pins" : [
{
"identity" : "iqkeyboardmanager",
Expand All @@ -14,8 +15,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Mangopay/mangopay-ios-vault-sdk",
"state" : {
"branch" : "main",
"revision" : "ce8a8a8b71286377afcbe8d076c8074b9f21a33f"
"revision" : "ce8a8a8b71286377afcbe8d076c8074b9f21a33f",
"version" : "1.0.9"
}
},
{
Expand All @@ -32,8 +33,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/paypal/paypal-ios/",
"state" : {
"branch" : "main",
"revision" : "c504258ea110c112ac6a3b39cd79926b2ff5fefa"
"revision" : "99ed704bd640c480dacd8be01f023c977d244132",
"version" : "1.4.0"
}
},
{
Expand All @@ -46,5 +47,5 @@
}
}
],
"version" : 2
"version" : 3
}
7 changes: 6 additions & 1 deletion Examples/MangopayDemo/MangopayDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
IQKeyboardManager.shared.enable = true
MangopayCheckoutSDK.initialize(clientId: "12345", profillingMerchantId: "428242", checkoutRerefence: UUID().uuidString, environment: .t3)
MangopayCheckoutSDK.initialize(
clientId: "12345",
profilingMerchantId: "428242",
checkoutReference: UUID().uuidString,
environment: .t3
)
return true
}

Expand Down
143 changes: 5 additions & 138 deletions Examples/MangopayDemo/MangopayDemo/ConfigurationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ public struct Configuration {
var sdkMode: SDKProvier
var env: MGPEnvironment
var cardFlowType: _3DSTransactionType?
// var apiKey: String
var clientId: String
// var authorId: String?
// var userId: String
// var walletId: String?
var amount: Double
var currency: Currency
var baseurlStr: String
Expand All @@ -71,23 +67,15 @@ public struct Configuration {
sdkMode: SDKProvier,
env: MGPEnvironment,
cardFlowType: _3DSTransactionType?,
// apiKey: String,
clientId: String,
// authorId: String? = nil,
// userId: String,
// walletId: String?,
amount: Double,
currency: Currency,
baseurlStr: String
) {
self.sdkMode = sdkMode
self.env = env
self.cardFlowType = cardFlowType
// self.apiKey = apiKey
self.clientId = clientId
// self.authorId = authorId
// self.userId = userId
// self.walletId = walletId
self.amount = amount
self.currency = currency
self.baseurlStr = baseurlStr
Expand All @@ -107,12 +95,7 @@ public struct DataCapsule {
class ConfigurationController: UIViewController {

lazy var forms: [Validatable] = [
// apiKeyField,
// clientField,
// authorField,
// creditedUserField,
// creditedWalletField,
amountField,
amountField
]

@IBOutlet weak var activityLoader: UIActivityIndicatorView!
Expand All @@ -139,61 +122,6 @@ class ConfigurationController: UIViewController {
textfieldDelegate: self
)

// lazy var apiKeyField = MangoPayTextfield(
// placeholderText: "API Key",
// returnKeyType: .next,
// validationRule: [
// .fieldRequired,
// .textTooShort
// ],
// style: PaymentFormStyle(),
// textfieldDelegate: self
// )

// lazy var clientField = MangoPayTextfield(
// placeholderText: "Client ID",
// returnKeyType: .next,
// validationRule: [
// .fieldRequired,
// .textTooShort
// ],
// style: PaymentFormStyle(),
// textfieldDelegate: self
// )

// lazy var authorField = MangoPayTextfield(
// placeholderText: "Author ID",
// returnKeyType: .next,
// validationRule: [
// .fieldRequired,
// .textTooShort
// ],
// style: PaymentFormStyle(),
// textfieldDelegate: self
// )

// lazy var creditedUserField = MangoPayTextfield(
// placeholderText: "Credited User ID",
// returnKeyType: .next,
// validationRule: [
// .fieldRequired,
// .textTooShort
// ],
// style: PaymentFormStyle(),
// textfieldDelegate: self
// )

// lazy var creditedWalletField = MangoPayTextfield(
// placeholderText: "Credited Wallet ID",
// returnKeyType: .next,
// validationRule: [
// .fieldRequired,
// .textTooShort
// ],
// style: PaymentFormStyle(),
// textfieldDelegate: self
// )

lazy var amountField = MangoPayTextfield(
placeholderText: "Amount - Long Format",
keyboardType: .decimalPad,
Expand All @@ -218,14 +146,8 @@ class ConfigurationController: UIViewController {
distribution: .fill,
padding: UIEdgeInsets(top: 8, left: 0, bottom: 32, right: 0),
views: [
// providerTextfield,
envTextfield,
// apiKeyField,
// clientField,
cardFlowField,
// authorField,
// creditedUserField,
// creditedWalletField,
amountField,
currencyField,
paymentButton
Expand Down Expand Up @@ -318,18 +240,13 @@ class ConfigurationController: UIViewController {
}


guard
// let apiKeyStr = apiKeyField.text,
// let clientIDStr = clientField.text,
// let userIdStr = creditedUserField.text,
let amountStr = amountField.text
else { return nil }
guard let amountStr = amountField.text else { return nil }

let __env = MGPEnvironment(rawValue: env)!
MangopayCheckoutSDK.initialize(
clientId: clientId,
profillingMerchantId: "428242",
checkoutRerefence: UUID().uuidString,
profilingMerchantId: "428242",
checkoutReference: UUID().uuidString,
environment: __env
)

Expand All @@ -344,11 +261,7 @@ class ConfigurationController: UIViewController {
sdkMode: .MangoPay,
env: __env,
cardFlowType: cardFlowType,
// apiKey: apiKeyStr,
clientId: clientId,
// authorId: authorField.text,
// userId: userIdStr,
// walletId: creditedWalletField.text,
amount: Double(amountStr)!,
currency: Currency(rawValue: cur)!,
baseurlStr: baseurl
Expand Down Expand Up @@ -384,34 +297,7 @@ class ConfigurationController: UIViewController {

func setDummyData(env: MGPEnvironment?) {
currencyField.text = "EUR"

guard let _env = env else { return }
switch _env {
case .sandbox:
// apiKeyField.text = "6281f06d0ba54934a9747d9b7c9e8bb2"
// clientField.text = "checkoutsquatest"
// creditedUserField.text = "157868268"
// creditedWalletField.text = "159834019"
// authorField.text = "157868268"
amountField.text = "1"
case .production:
// apiKeyField.text = "FPuqRtn4A6LhH7JGJ9QUDSfc3M0aTsbiQfScW8boGyfaAD57h3"
// clientField.text = "arthurinc"
// creditedUserField.text = "4234427192"
// creditedWalletField.text = "4234431137"
// authorField.text = "4234427192"
amountField.text = "1"
case .t3:
// apiKeyField.text = "8b35136d29a4430983c835f81caf7c05"
// clientField.text = "valitoreurprodtest2"
//
// creditedUserField.text = "user_m_01HP6Y728NHC46PTAT186AM17V"
// creditedWalletField.text = "wlt_m_01HP6Y7WB48TVZCQ2HQ7BH8KK9"
//
// authorField.text = "6664602"
amountField.text = "1"

}
amountField.text = "1"
}

func getDataFromPlist() -> [String: Any] {
Expand All @@ -428,25 +314,6 @@ extension ConfigurationController: FormValidatable {

extension ConfigurationController: UITextFieldDelegate {

// func textFieldShouldReturn(_ textField: UITextField) -> Bool {
// switch textField {
// case apiKeyField.textfield:
// clientField.setResponsder()
// case clientField.textfield:
// authorField.setResponsder()
// case authorField.textfield:
// creditedUserField.setResponsder()
// case creditedUserField.textfield:
// creditedWalletField.setResponsder()
// case creditedWalletField.textfield:
// currencyField.setResponsder()
// case currencyField.textfield:
// self.view.endEditing(true)
// default: break
// }
// return true
// }

func textFieldDidEndEditing(_ textField: UITextField) {
switch textField {
case envTextfield.textfield:
Expand Down
39 changes: 1 addition & 38 deletions Examples/MangopayDemo/MangopayDemo/DemoPaymentForm.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,44 +110,7 @@ class DemoPaymentForm: UIViewController {


func peformAuthorize(with tokenisedCard: CardRegistration) {
// showLoader(true)
//
// let client = PaymentCoreClient(
// clientKey: "checkoutsquatest",
// apiKey: "7fOfvt3ozv6vkAp1Pahq56hRRXYqJqNXQ4D58v5QCwTocCVWWC",
// environment: .sandbox
// )
//
// Task {
// let authPay = AuthorizePayIn(
// tag: tokenisedCard.tag ?? "Random tag",
// authorID: "158091557",
// creditedUserID: "158091557",
// debitedFunds: DebitedFunds(currency: "EUR", amount: 20),
// fees: DebitedFunds(currency: "EUR", amount: 2),
// creditedWalletID: "159834019",
// cardID: tokenisedCard.cardID ?? "" ,
// secureModeReturnURL: "https://docs.mangopay.com/please-ignore",
// statementDescriptor: "MangoPay",
// browserInfo: BrowserInfo(),
// ipAddress: "1c10:17fe:65db:25b7:1784:ce36:43ce:c610",
// shipping: Ing(firstName: "Elikem", lastName: "Savie", address: Address(addressLine1: "Accra", addressLine2: "Ghana", city: "Accra", region: "Accra", postalCode: "00000", country: "FR")
// )
//
// )
// do {
// let payIn = try await client.authorizePaymentPayIn(payment: authPay)
// print("✅ success", payIn)
// self.createdPayIn = payIn
// showLoader(false)
// self.showAlert(with: payIn.id ?? "", title: "Successfully Authorized Card 🎉")
//
// } catch {
// print("❌ error", error)
// showLoader(false)
// self.showAlert(with: "", title: "❌ Authorized Card Failed")
// }
// }

}

func peformGetPayIn() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,7 @@ extension ProductListController: MGPApplePayHandlerDelegate {
func applePayContext(didCompleteWith status: MGPApplePay.PaymentStatus, error: Error?) {
switch status {
case .success(let token):
// Loader
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.6, execute: {
// self.showSuccessDialog(title: "🤣 MangoPayApplePay.token", result: token)
ResultView.show(title: "MangoPayApplePay.token", result: token)
// })
ResultView.show(title: "MangoPayApplePay.token", result: token)
case .error:
print("❌ MangoPayApplePay.error")
case .userCancellation: break
Expand Down
Loading

0 comments on commit fc06d12

Please sign in to comment.