Created
August 18, 2017 03:13
-
-
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
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 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