Skip to content

Commit

Permalink
Keshavc fix rubocop and change demo product name (#1185)
Browse files Browse the repository at this point in the history
* Fixing rubocop errors

* Fixing up some names
  • Loading branch information
keshavc-stripe authored Aug 15, 2023
1 parent d581bc1 commit a9eda96
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions lib/stripe-force/translate/utilities/demo_util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ def create_mock_salesforce_customer

sig { params(additional_fields: Hash).returns(String) }
def create_salesforce_account(additional_fields: {})
account_id = sf.create!(SF_ACCOUNT, {
_ = sf.create!(SF_ACCOUNT, {
Name: sf_randomized_name(SF_ACCOUNT),
}.merge(additional_fields))
end

def create_salesforce_contact(contact_email: sf_randomized_id, static_id: true)
contact_id = sf.create!(SF_CONTACT, {
_ = sf.create!(SF_CONTACT, {
LastName: 'Bianco',
Email: static_id ? create_static_email(email: contact_email) : create_random_email,
})
Expand Down Expand Up @@ -128,7 +128,7 @@ def create_salesforce_price(sf_product_id: nil, price: nil, currency_iso_code: n
})
end

sf_pricebook_entry_id = sf.create!(SF_PRICEBOOK_ENTRY, {
_ = sf.create!(SF_PRICEBOOK_ENTRY, {
"Pricebook2Id" => default_pricebook_id,
"Product2Id" => sf_product_id,
"IsActive" => true,
Expand All @@ -150,9 +150,9 @@ def default_pricebook_id

def create_salesforce_product(static_id: true, additional_fields: {})
sf.create!(SF_PRODUCT, {
"Name" => sf_randomized_name(SF_PRODUCT),
"Name" => "SaaS Subscription",
'IsActive' => true,
"Description" => "A great description",
"Description" => "Demo subscription to show bidirectional syncing",
'ProductCode' => static_id ? sf_static_id : sf_randomized_id,
}.merge(additional_fields))
end
Expand Down Expand Up @@ -396,7 +396,7 @@ def create_salesforce_quote(sf_pricebook_id: nil, sf_account_id:, currency_iso_c
contact_id = create_salesforce_contact(contact_email: contact_email)

# you can create a quote without *any* fields, which seems completely silly
quote_id = sf.create!(CPQ_QUOTE, {
_ = sf.create!(CPQ_QUOTE, {
CPQ_QUOTE_PRIMARY => true,
CPQ_QUOTE_OPPORTUNITY => opportunity_id,
CPQ_QUOTE_PRIMARY_CONTACT => contact_id,
Expand All @@ -410,7 +410,6 @@ def create_salesforce_order(sf_product_id: nil, sf_account_id: nil, sf_pricebook
sf_product_id, _ = salesforce_recurring_product_with_price(currency_iso_code: currency_iso_code)
end

sf_pricebook_id ||= default_pricebook_id
sf_account_id ||= create_salesforce_account

quote_id = create_salesforce_quote(sf_account_id: sf_account_id, currency_iso_code: currency_iso_code, contact_email: contact_email, additional_quote_fields: additional_quote_fields)
Expand Down Expand Up @@ -480,7 +479,7 @@ def sf_get(sf_id)
gsub("'\"", '')

sf_type = StripeForce::Utilities::SalesforceUtil.salesforce_type_from_id(@user, sf_id)
sf_object = @user.sf_client.find(sf_type, sf_id)
_ = @user.sf_client.find(sf_type, sf_id)
end
end
end

0 comments on commit a9eda96

Please sign in to comment.