Skip to content

Instantly share code, notes, and snippets.

@danielbowden
Created August 18, 2017 03:13
Show Gist options
  • Save danielbowden/49ee4cbd06d969fca5894ed89a21f17d to your computer and use it in GitHub Desktop.
Save danielbowden/49ee4cbd06d969fca5894ed89a21f17d to your computer and use it in GitHub Desktop.
Custom Fastlane action - Uses my PR in fastlane produce to create a new Apple Pay Merchant or ensure that a specific Merchant exists
require 'produce'
require 'produce/merchant'
module Fastlane
module Actions
class CreateMerchantAction < Action
def self.run(params)
Produce.config = params
Produce::Merchant.new.create(params, nil)
end
#####################################################
# @!group Documentation
#####################################################
def self.description
"Creates a new Apple Pay Merchant. Ensure that a specific Merchant exists"
end
def self.available_options
options = FastlaneCore::CommanderGenerator.new.generate(Produce::Options.available_options)
extra_options = [
FastlaneCore::ConfigItem.new(key: :merchant_name,
env_name: "FL_CREATE_MERCHANT_NAME",
description: "Name for the merchant that is created"
),
FastlaneCore::ConfigItem.new(key: :merchant_identifier,
env_name: "FL_CREATE_MERCHANT_IDENTIFIER",
description: "Merchant identifier for the merchant"
)
]
options + extra_options
end
def self.output
[]
end
def self.example_code
[
"create_merchant(
merchant_name:'New Merchant',
merchant_identifier:'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