-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: Include swiftlint * feat: Plugin init + Setup Configurations (#1) Initialise plugin with required structure. Create structure to deal with Apple Pay. Despite being ready to deal with any kind of dictionary, provide an accelerator to read the configuration from the main bundle. Add Nimble and Quick through Cocoapods to use BDD for unit testing. * feat: Check Wallet and Payment Availability (#2) Add verification for wallet and payment availability. Payment verification is enhanced by also checking it against the configured payment networks and supported capabilities. * feat: Set Details and Trigger Payment (#3) Configure the missing payment details and, by mixing it with the configuration info, trigger the payment request. * refactor: Add DocC documentation and minor fixes. (#4) Add DocC documentation. Add empty value check and mandatory fields when fetching configuration properties. * fix: Payment Setup Verification Failed on Invalid Configuration (#5) Fix error when verifying payment setup on ReadyToPay method. If some payment network or merchant capabilities are missing, return the associated error. * fix: Errors and Contact Management (#6) Clean errors and its codes and messages accordingly. New OSPMTContact struct that allows the management of the correct shipping and billing information to use on a payment request. This is required due to a limitation on OutSystems related with nullable lists. Change the OSPMTConfigurationDelegate to OSPMTConfigurationModel, in order to comply with the new OutSystems structure. Clean code (privatise local methods and make OSPMTPayment's delegate property weak, in order to avoid possible retain cycles). * fix: Check if GivenName and FamilyName are empty (#7) * chore: Add Unreleased Section * Chore: Add Podspec (#9) * refactor: Simply Generic Method * chore: Add public podspec Add public podspec. This implies also updating the readme.md file to something more descriptive and user-friendly.
- Loading branch information
1 parent
85bc27b
commit e1d22e9
Showing
16 changed files
with
135 additions
and
88 deletions.
There are no files selected for viewing
File renamed without changes.
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'OSPaymentsPluginLib' | ||
s.version = '1.1.0' | ||
s.summary = 'The `OSPaymentsPluginLib-iOS` is a library build using `Swift` that lets you set a payment experience using Apple Pay.' | ||
s.description = <<-DESC | ||
The `OSPaymentsPluginLib-iOS` is a library build using `Swift` that lets you set a payment experience using Apple Pay. It allows to set the payment's details, such as the merchant’s information, payment amount and currency, as well as shipping and billing address. This information can then used to process a payment within an app. | ||
The `OSPMTActionDelegate` protocol, along with the class that implements it - `OSPMTPayments` - allows this interaction, providing the following operations: | ||
- Setup Payment Configuration | ||
- Check if Device is Ready for Payment | ||
- Set Details and Trigger Payment | ||
DESC | ||
s.homepage = 'https://github.com/OutSystems/OSPaymentsLib-iOS' | ||
s.license = { :type => 'MIT', :file => 'LICENSE' } | ||
s.author = { 'Mobile Ecosystem Team' => '[email protected]' } | ||
s.source = { :git => 'https://github.com/OutSystems/OSPaymentsLib-iOS.git', :tag => s.version.to_s } | ||
|
||
s.ios.deployment_target = '13.0' | ||
s.swift_versions = '5.0' | ||
|
||
s.source_files = 'OSPaymentsLib/**/*.swift' | ||
end |
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,10 +1,81 @@ | ||
# OSPaymentsLib | ||
# OSPaymentsPluginLib-iOS | ||
|
||
Welcome to **OSPaymentsLib**. | ||
The `OSPaymentsPluginLib-iOS` is a library build using `Swift` that lets you set a payment experience using Apple Pay. It allows to set the payment's details, such as the merchant’s information, payment amount and currency, as well as shipping and billing address. This information can then used to process a payment within an app. | ||
|
||
Commands to create the xcframework: | ||
The `OSPMTActionDelegate` protocol, along with the class that implements it - `OSPMTPayments` - allows this interaction, providing the following operations: | ||
- Setup Payment Configuration | ||
- Check if Device is Ready for Payment | ||
- Set Details and Trigger Payment | ||
|
||
"sh build.sh" (will create the xcframewotk file in the output folder "build") | ||
Each is detailed on following sections. | ||
|
||
Copy and paste the file in the plugin. | ||
path: "PLUGIN_ROOT_FOLDER" src/ios/frameworks/ | ||
## Index | ||
|
||
- [Motivation](#motivation) | ||
- [Usage](#usage) | ||
- [Methods](#methods) | ||
- [Setup Payment Configuration](#setup-payment-configuration) | ||
- [Check if Device is Ready for Payment](#check-if-device-is-ready-for-payment) | ||
- [Set Details and Trigger Payment](#set-details-and-trigger-payment) | ||
|
||
## Motivation | ||
|
||
This library is to be used by the [Payments Plugin](https://github.com/OutSystems/cordova-outsystems-payments). The repository contains a `podspec` file that is published and available on the `CocoaPods`' repository, and should be imported on the Cordova bridge as a `pod`. | ||
|
||
## Usage | ||
|
||
1. Include the `OSPaymentsPluginLib` pod in the Cordova Bridge. o accomplish this, the following needs to be inserted into the `plugin.xml` file. The `spec` field should be changed to the version the developer desires to use. | ||
|
||
```xml | ||
<platform> | ||
... | ||
<podspec> | ||
<config> | ||
<source url="https://cdn.cocoapods.org/"/> | ||
</config> | ||
<pods use-frameworks="true"> | ||
... | ||
<pod name="OSPaymentsPluginLib" spec="{VERSION TO USE}" /> | ||
... | ||
</pods> | ||
</podspec> | ||
... | ||
</platform> | ||
``` | ||
|
||
2. Go to [Apple Developer Portal](https://developer.apple.com/) and configure the Provisioning Profile with the `Apple Pay Payment Processing` and `In-App Purchase` capabilities enabled. | ||
|
||
## Methods | ||
|
||
The library provides the following methods to interact with: | ||
|
||
### Setup Payment Configuration | ||
|
||
```swift | ||
func setupConfiguration() | ||
``` | ||
|
||
Sets up the payment configuration. | ||
|
||
The method's success is returned through a `OSPMTCallbackDelegate` call. Success operations returns an object of the structure type `OSPMTConfigurationModel`, encoded in a UTF-8 string. An `OSPMTError` error is returned in case of error. | ||
|
||
### Check if Device is Ready for Payment | ||
|
||
```swift | ||
func checkWalletSetup() | ||
``` | ||
|
||
Verifies the device is ready to process a payment, considering the configuration provided before. | ||
|
||
The method's success is returned through a `OSPMTCallbackDelegate` call. Success operations returns an empty string or a `OSPMTError` error otherwise. | ||
|
||
### Set Details and Trigger Payment | ||
|
||
```swift | ||
func set(_ details: String) | ||
``` | ||
|
||
Sets payment details and triggers the request proccess. The method contains the following parameter: | ||
- `details`: Payment details model serialized into a text field. This model can be checked in the `OSPMTDetailsModel` structure. | ||
|
||
The method's success is returned through a `OSPMTCallbackDelegate` call. Success operations returns an object of the structure type `OSPMTScopeModel`, encoded in a UTF-8 string. An `OSPMTError` error is returned in case of error. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.