Code Monkey home page Code Monkey logo

Comments (2)

bartpowers avatar bartpowers commented on June 20, 2024

Please see my PR for a simple addition that makes this possible
#22053

from fastlane.

bartpowers avatar bartpowers commented on June 20, 2024

You can do this manually by doing the following...

type = Spaceship::Portal::Certificate::CERTIFICATE_TYPE_IDS.key(Spaceship::Portal::Certificate::ApplePay)
certificate = Spaceship::Portal.client.create_certificate!(type, csr, merchant_id)
require 'spaceship'
require 'openssl'

csr_path = '/PATH/TO/stripe.certSigningRequest'
csr_content = File.read(csr_path)
csr = OpenSSL::X509::Request.new(csr_content)

# Login to Apple Developer account
Spaceship::Portal.login('your_apple_id', 'your_password')

# Select the team if you're part of multiple teams
team_id = 'your_team_id'  # Replace with your actual team ID
Spaceship::Portal.client.team_id = team_id

`fastlane produce merchant -o merchant.com.example.production -r "Example Merchant Production"`

`fastlane produce associate_merchant -a com.krausefx.app merchant.com.example.production`

# Verify that the merchant ID exists
merchant_id = Spaceship.merchant.find("merchant.com.example.production")
if merchant_id?
  puts "Merchant not found"
  exit
else
  puts "Merchant ID found: #{app.app_id}"
end

# Attempt to create the Apple Pay certificate
begin
  type = Spaceship::Portal::Certificate::CERTIFICATE_TYPE_IDS.key(Spaceship::Portal::Certificate::ApplePay)
  certificate = Spaceship::Portal.client.create_certificate!(type, csr, merchant_id)
  puts "Certificate created: #{certificate.id}"

rescue Spaceship::UnexpectedResponse => e
  puts "Failed to create certificate: #{e.message}"
end

cert_content = Spaceship::Portal.client.download_certificate(certificate['certificateId'], certificate['certificateTypeDisplayId'])
  cert_file_path = '/PATH/TO//Downloads/apple_pay_certificate.cer'   File.write(cert_file_path, cert_content)   
puts "Certificate saved to #{cert_file_path}"

from fastlane.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.