Last active
June 19, 2018 21:06
-
-
Save danielbowden/7a439c10f050bbeeb50856dbdcd19f3e to your computer and use it in GitHub Desktop.
Custom Fastlane action - Uses my PR in fastlane produce to associate an app with merchants for use with Apple Pay. Apple Pay will be enabled for this app.
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
require 'produce' | |
require 'produce/merchant' | |
module Fastlane | |
module Actions | |
class AssociateMerchantsAction < Action | |
def self.run(params) | |
Produce.config = params | |
Produce::Merchant.new.associate(nil, params[:merchant_identifiers]) | |
end | |
##################################################### | |
# @!group Documentation | |
##################################################### | |
def self.description | |
"Associate with a merchant for use with Apple Pay. Apple Pay will be enabled for this app." | |
end | |
def self.available_options | |
options = FastlaneCore::CommanderGenerator.new.generate(Produce::Options.available_options) | |
extra_options = [ | |
FastlaneCore::ConfigItem.new(key: :merchant_identifiers, | |
env_name: "FL_CREATE_MERCHANT_IDENTIFIERS", | |
description: "Array of merchant identifiers to associate with this app", | |
type: Array | |
) | |
] | |
options + extra_options | |
end | |
def self.output | |
[] | |
end | |
def self.example_code | |
[ | |
"associate_merchants( | |
app_identifier: 'com.company.app', | |
merchant_identifiers: ['merchant.com.company.app.sandbox', 'merchant.com.company.app.production'] | |
)", | |
"associate_merchants( | |
app_identifier: 'com.company.app', | |
merchant_identifiers: ['merchant.com.company.app.sandbox'] | |
)" | |
] | |
end | |
def self.authors | |
["danielbowden"] | |
end | |
def self.is_supported?(platform) | |
[:ios, :mac].include?(platform) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
was this ever merged?