Skip to content

Instantly share code, notes, and snippets.

@danielbowden
Last active June 19, 2018 21:06
Show Gist options
  • Select an option

  • Save danielbowden/7a439c10f050bbeeb50856dbdcd19f3e to your computer and use it in GitHub Desktop.

Select an option

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.
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
@gholias

gholias commented Jun 19, 2018

Copy link
Copy Markdown

was this ever merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment