Skip to content

Commit

Permalink
RMET-2078 && RMET-2095 ::: iOS ::: Using Stripe to Process End-2-End …
Browse files Browse the repository at this point in the history
…Payments (#19)

* chore: replace OSPaymentsLib

Remove all the OSPaymentsLib files and replace them by the new OSPaymentsPluginLib pod.

* feat: Update iOS Library

Update iOS library so that it includes Stripe.
Add payment gateway configurations to Hook.
  • Loading branch information
OS-ricardomoreirasilva committed Apr 10, 2024
1 parent 82518b0 commit f3f5fdb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The changes documented here do not include those from the original repository.

## [Unreleased]

### 2022-12-02
- Chore: [iOS] Remove all the `OSPaymentsLib` files and replace them by the new `OSPaymentsPluginLib` pod.
- Feat: [iOS] Update hook so that it checks if Stripe's is configured as the Payment Service Provider and update `plist` file accordingly (https://outsystemsrd.atlassian.net/browse/RMET-2078).

## [Version 1.0.1]

### 2022-11-08
Expand Down
22 changes: 11 additions & 11 deletions hooks/ios/iOSCopyPreferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ module.exports = function (context) {
const ServiceEnum = Object.freeze({"ApplePay":"1", "GooglePay":"2"})
let projectRoot = context.opts.cordova.project ? context.opts.cordova.project.root : context.opts.projectRoot;

let merchant_id = "";
let merchant_name = "";
let merchant_country_code = "";
let payment_allowed_networks = [];
let payment_supported_capabilities = [];
let payment_supported_card_countries = [];
let shipping_supported_contacts = [];
let billing_supported_contacts = [];
let payment_gateway = "";
let payment_request_url = "";
let stripe_publishable_key = "";
var merchant_id = "";
var merchant_name = "";
var merchant_country_code = "";
var payment_allowed_networks = [];
var payment_supported_capabilities = [];
var payment_supported_card_countries = [];
var shipping_supported_contacts = [];
var billing_supported_contacts = [];
var payment_gateway = "";
var payment_request_url = "";
var stripe_publishable_key = "";

let appNamePath = path.join(projectRoot, 'config.xml');
let appNameParser = new ConfigParser(appNamePath);
Expand Down
2 changes: 2 additions & 0 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
</config>
<pods use-frameworks="true">
<pod name="OSCommonPluginLib" spec="1.0.0" />
<!--pod name="OSPaymentsPluginLib" spec="1.1.0" /-->
<pod name="OSPaymentsPluginLib" git="https://github.com/OutSystems/OSPaymentsLib-iOS.git" branch="development" />
</pods>
</podspec>

Expand Down
7 changes: 3 additions & 4 deletions src/ios/OSPayments.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import OSCommonPluginLib
import OSPaymentsLib
import OSPaymentsPluginLib

@objc(OSPayments)
class OSPayments: CDVPlugin {
Expand Down Expand Up @@ -28,9 +28,8 @@ class OSPayments: CDVPlugin {
func setDetails(command: CDVInvokedUrlCommand) {
self.callbackId = command.callbackId

guard let detailsText = command.argument(at: 0) as? String else { return }
let accessToken = command.argument(at: 1) as? String
self.plugin?.set(detailsText, and: accessToken)
guard let detailsText = command.arguments.first as? String else { return }
self.plugin?.set(detailsText)
}
}

Expand Down

0 comments on commit f3f5fdb

Please sign in to comment.