Skip to content

Commit

Permalink
Remove all beta indicators (#913)
Browse files Browse the repository at this point in the history
  • Loading branch information
nadaismail-stripe authored Nov 27, 2022
1 parent 6ccc1ff commit 2af045f
Show file tree
Hide file tree
Showing 40 changed files with 124 additions and 132 deletions.
12 changes: 6 additions & 6 deletions lib/stripe-force/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ module Constants
SF_PRODUCT_CONSUMPTION_SCHEDULE = 'ProductConsumptionSchedule'
SF_CONSUMPTION_RATE = 'ConsumptionRate'
SF_CONTRACT = 'Contract'
SF_STRIPE_COUPON = 'Stripe_Coupon_Beta__c'
SF_STRIPE_COUPON_SERIALIZED = 'Stripe_Coupon_Beta_Serialized__c'
SF_STRIPE_COUPON_QUOTE_ASSOCIATION = 'Stripe_Coupon_Beta_Quote_Association__c'
SF_STRIPE_COUPON_QUOTE_LINE_ASSOCIATION = 'Stripe_Coupon_Beta_Quote_Line_Associatio__c'
SF_STRIPE_COUPON_ORDER_ASSOCIATION = 'Stripe_Coupon_Beta_Order_Association__c'
SF_STRIPE_COUPON_ORDER_ITEM_ASSOCIATION = 'Stripe_Coupon_Beta_Order_Item_Associatio__c'
SF_STRIPE_COUPON = 'Stripe_Coupon__c'
SF_STRIPE_COUPON_SERIALIZED = 'Stripe_Coupon_Serialized__c'
SF_STRIPE_COUPON_QUOTE_ASSOCIATION = 'Stripe_Coupon_Quote_Association__c'
SF_STRIPE_COUPON_QUOTE_LINE_ASSOCIATION = 'Stripe_Coupon_Quote_Line_Association__c'
SF_STRIPE_COUPON_ORDER_ASSOCIATION = 'Stripe_Coupon_Order_Association__c'
SF_STRIPE_COUPON_ORDER_ITEM_ASSOCIATION = 'Stripe_Coupon_Order_Item_Association__c'

SF_ID = 'Id'
SF_LAST_MODIFIED_DATE = 'LastModifiedDate'
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe-force/translate/coupon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def translate_coupon(sf_coupon)
def create_coupon_from_sf_coupon(sf_coupon)
# check if the original sf coupon has been translated prior and exists in Stripe
# this original coupon is the coupon that the order / order item coupon was copied from
original_sf_coupon = sf.find(prefixed_stripe_field(SF_STRIPE_COUPON), sf_coupon[prefixed_stripe_field("Original_Stripe_Coupon_Beta_Id__c").to_s])
original_sf_coupon = sf.find(prefixed_stripe_field(SF_STRIPE_COUPON), sf_coupon[prefixed_stripe_field("Original_Stripe_Coupon_Id__c")])
existing_stripe_coupon = retrieve_from_stripe(Stripe::Coupon, original_sf_coupon)
if existing_stripe_coupon
existing_stripe_coupon = T.cast(existing_stripe_coupon, Stripe::Coupon)
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_salesforce_stripe_coupons_associated_to_sf_object(sf_client:, sf_object:
# there could be multiple coupons associated with a single order line
coupons = associations.map do |association|
association = sf_client.find(association_obj_type, association.Id)
coupon = sf_client.query("Select Id from #{prefixed_stripe_field(SF_STRIPE_COUPON_SERIALIZED)} where Id = '#{association.Stripe_Coupon__c}'")
coupon = sf_client.query("Select Id from #{prefixed_stripe_field(SF_STRIPE_COUPON_SERIALIZED)} where Id = '#{association[prefixed_stripe_field('Stripe_Coupon__c')]}'")

# return the coupon object
sf_client.find(prefixed_stripe_field(SF_STRIPE_COUPON_SERIALIZED), coupon.first.Id)
Expand Down
5 changes: 0 additions & 5 deletions lib/stripe-force/translate/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ def self.metadata_key(user, key)
key = key.serialize
end

# stripe api limits keys to be a string under 40 characters
if key.starts_with?('stripe_coupon_beta')
key = 'stripe_coupon'
end

"#{user.metadata_prefix}#{key}"
end

Expand Down
3 changes: 1 addition & 2 deletions sfdx/force-app/main/default/classes/setupAssistant.cls
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public with sharing class setupAssistant {
'Account' => utilities.getListOfFieldsByObject('Account'),
'Product2' => utilities.getListOfFieldsByObject('Product2'),
'PricebookEntry' => utilities.getListOfFieldsByObject('PricebookEntry'),
'Stripe_Coupon_Beta__c' => utilities.getListOfFieldsByObject('Stripe_Coupon_Beta__c')
'Stripe_Coupon__c' => utilities.getListOfFieldsByObject('Stripe_Coupon__c')
};
rd.put('fieldListByObjectMap', fieldListByObjectMap);
} else {
Expand Down Expand Up @@ -699,7 +699,6 @@ public with sharing class setupAssistant {
'Order',
'OrderItem',
'PricebookEntry'
// 'Stripe_Coupon_Beta__c'
};

if ((Boolean)utilities.isCpqEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion sfdx/force-app/main/default/classes/utilities.cls
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public with sharing class utilities {
'ContractLineItem',
'OpportunityLineItem',
'ProductItem',
'Stripe_Coupon_Beta__c'
'Stripe_Coupon__c'
};
if(listOfImportantObjectsApiNames.contains(stringReferncedObjecect)) {
objectFieldMap = addFieldsToObjectFieldMap(objectFieldMap, objectApiFieldMap, objectFieldName, isFieldCustom, typeOfField, isObjectCustom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class DataMappingStep extends LightningElement {
description: 'Price order items define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of a single product.'
},
"coupon": {
objectName: "Stripe_Coupon_Beta__c",
objectName: "Stripe_Coupon__c",
friendlyName: 'Stripe Coupon',
description: 'Coupons contain information about a percent-off or amount-off discount you might want to apply to a subscription or subscription item.'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>ControlledByParent</externalSharingModel>
<label>Stripe Coupon Beta Order Associatio</label>
<label>Stripe Coupon Order Association</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Stripe Coupon Beta Order Associatio Name</label>Quot
<label>Stripe Coupon Order Association</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupon Beta Order</pluralLabel>
<pluralLabel>Stripe Coupon Order</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ControlledByParent</sharingModel>
<validationRules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<externalId>false</externalId>
<label>Order</label>
<referenceTo>Order</referenceTo>
<relationshipLabel>Stripe Coupon Beta Order Connection</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Order_Connection</relationshipName>
<relationshipLabel>Stripe Coupon Order Connection</relationshipLabel>
<relationshipName>Stripe_Coupon_Order_Connection</relationshipName>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
<type>Lookup</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<fullName>Stripe_Coupon__c</fullName>
<externalId>false</externalId>
<label>Stripe Coupon</label>
<referenceTo>Stripe_Coupon_Beta_Serialized__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Order Item Link</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Order_Item_Link</relationshipName>
<referenceTo>Stripe_Coupon_Serialized__c</referenceTo>
<relationshipLabel>Stripe Coupon Serialized Order Link</relationshipLabel>
<relationshipName>Stripe_Coupon_Serialized_Order_Link</relationshipName>
<relationshipOrder>0</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>ControlledByParent</externalSharingModel>
<label>Stripe Coupon Beta Order Item Associatio</label>
<label>Stripe Coupon Order Item Association</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Stripe Coupon Beta Order Item Associatio Name</label>Quot
<label>Stripe Coupon Order Item Association</label>Quot
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupon Beta Order Items</pluralLabel>
<pluralLabel>Stripe Coupon Order Item Associations</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ControlledByParent</sharingModel>
<validationRules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<externalId>false</externalId>
<label>Order Item</label>
<referenceTo>OrderItem</referenceTo>
<relationshipLabel>Stripe Coupon Beta Order Item Connection</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Order_Item_Connection</relationshipName>
<relationshipLabel>Order Item Stripe Coupon Link</relationshipLabel>
<relationshipName>Order_Item_Stripe_Coupons_Link</relationshipName>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
<type>Lookup</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<fullName>Stripe_Coupon__c</fullName>
<externalId>false</externalId>
<label>Stripe Coupon</label>
<referenceTo>Stripe_Coupon_Beta_Serialized__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Serialized Order Link</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Serialized_Order_Link</relationshipName>
<referenceTo>Stripe_Coupon_Serialized__c</referenceTo>
<relationshipLabel>Stripe Coupon Order Item Link</relationshipLabel>
<relationshipName>Stripe_Coupon_Order_Item_Link</relationshipName>
<relationshipOrder>0</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>ControlledByParent</externalSharingModel>
<label>Stripe Coupon Beta Quote Association</label>
<label>Stripe Coupon Quote Association</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Stripe Coupon Beta Quote Association Name</label>
<label>Stripe Coupon Quote Association</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupon Beta Quotes</pluralLabel>
<pluralLabel>Stripe Coupon Quote Associations</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ControlledByParent</sharingModel>
<visibility>Public</visibility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<externalId>false</externalId>
<label>Quote</label>
<referenceTo>SBQQ__Quote__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Quote</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Quote</relationshipName>
<relationshipLabel>Stripe Coupon Quote</relationshipLabel>
<relationshipName>Stripe_Coupon_Quote</relationshipName>
<relationshipOrder>1</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<fullName>Stripe_Coupon__c</fullName>
<externalId>false</externalId>
<label>Stripe Coupon</label>
<referenceTo>Stripe_Coupon_Beta__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Quote</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Quote</relationshipName>
<referenceTo>Stripe_Coupon__c</referenceTo>
<relationshipLabel>Stripe Coupon Quote</relationshipLabel>
<relationshipName>Stripe_Coupon_Quote</relationshipName>
<relationshipOrder>0</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>ControlledByParent</externalSharingModel>
<label>Stripe Coupon Beta Quote Line Associatio</label>
<label>Stripe Coupon Quote Line Association</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Stripe Coupon Beta Quote Line Associatio Name</label>
<label>Stripe Coupon Quote Line Association</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupon Beta Quote Lines</pluralLabel>
<pluralLabel>Stripe Coupon Quote Line Associations</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ControlledByParent</sharingModel>
<visibility>Public</visibility>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<externalId>false</externalId>
<label>Quote Line</label>
<referenceTo>SBQQ__QuoteLine__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Quote Line</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Quote_Line</relationshipName>
<relationshipLabel>Stripe Coupon Quote Line</relationshipLabel>
<relationshipName>Stripe_Coupon_Quote_Line</relationshipName>
<relationshipOrder>1</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<fullName>Stripe_Coupon__c</fullName>
<externalId>false</externalId>
<label>Stripe Coupon</label>
<referenceTo>Stripe_Coupon_Beta__c</referenceTo>
<relationshipLabel>Stripe Coupon Beta Quote Lines</relationshipLabel>
<relationshipName>Stripe_Coupon_Beta_Quote_Lines</relationshipName>
<referenceTo>Stripe_Coupon__c</referenceTo>
<relationshipLabel>Stripe Coupon Quote Lines</relationshipLabel>
<relationshipName>Stripe_Coupon_Quote_Lines</relationshipName>
<relationshipOrder>0</relationshipOrder>
<reparentableMasterDetail>false</reparentableMasterDetail>
<trackTrending>false</trackTrending>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>Private</externalSharingModel>
<label>Stripe Coupon Beta Serialized</label>
<label>Stripe Coupon Serialized</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Coupon Number</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupons Beta Serialized</pluralLabel>
<pluralLabel>Stripe Coupons Serialized</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ReadWrite</sharingModel>
<visibility>Public</visibility>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomField xmlns="http://soap.sforce.com/2006/04/metadata">
<fullName>Original_Stripe_Coupon_Beta_Id__c</fullName>
<fullName>Original_Stripe_Coupon_Id__c</fullName>
<description>The unique identifier for the initial coupon this coupon was duplicated from.</description>
<externalId>false</externalId>
<label>Original Stripe Coupon ID</label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@
<enableSharing>true</enableSharing>
<enableStreamingApi>true</enableStreamingApi>
<externalSharingModel>Private</externalSharingModel>
<label>Stripe Coupon Beta</label>
<label>Stripe Coupon</label>
<nameField>
<displayFormat>{0000}</displayFormat>
<label>Coupon Number</label>
<type>AutoNumber</type>
</nameField>
<pluralLabel>Stripe Coupons Beta</pluralLabel>
<pluralLabel>Stripe Coupons</pluralLabel>
<searchLayouts></searchLayouts>
<sharingModel>ReadWrite</sharingModel>
<validationRules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,72 +307,72 @@
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Amount_Off__c</field>
<field>Stripe_Coupon__c.Amount_Off__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Duration_In_Months__c</field>
<field>Stripe_Coupon__c.Duration_In_Months__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Max_Redemptions__c</field>
<field>Stripe_Coupon__c.Max_Redemptions__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Name__c</field>
<field>Stripe_Coupon__c.Name__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Percent_Off__c</field>
<field>Stripe_Coupon__c.Percent_Off__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Stripe_Dashboard_Link__c</field>
<field>Stripe_Coupon__c.Stripe_Dashboard_Link__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta__c.Stripe_ID__c</field>
<field>Stripe_Coupon__c.Stripe_ID__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Serialized__c.Amount_Off__c</field>
<field>Stripe_Coupon_Serialized__c.Amount_Off__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Serialized__c.Duration_In_Months__c</field>
<field>Stripe_Coupon_Serialized__c.Duration_In_Months__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Serialized__c.Max_Redemptions__c</field>
<field>Stripe_Coupon_Serialized__c.Max_Redemptions__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Serialized__c.Name__c</field>
<field>Stripe_Coupon_Serialized__c.Name__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Serialized__c.Percent_Off__c</field>
<field>Stripe_Coupon_Serialized__c.Percent_Off__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Order_Item_Associatio__c.Order_Item__c</field>
<field>Stripe_Coupon_Order_Item_Association__c.Order_Item__c</field>
<readable>true</readable>
</fieldPermissions>
<fieldPermissions>
<editable>true</editable>
<field>Stripe_Coupon_Beta_Order_Association__c.Order__c</field>
<field>Stripe_Coupon_Order_Association__c.Order__c</field>
<readable>true</readable>
</fieldPermissions>
<hasActivationRequired>false</hasActivationRequired>
Expand Down Expand Up @@ -410,21 +410,13 @@
<allowEdit>true</allowEdit>
<allowRead>true</allowRead>
<modifyAllRecords>true</modifyAllRecords>
<object>Stripe_Coupon_Beta__c</object>
<object>Stripe_Coupon__c</object>
<viewAllRecords>true</viewAllRecords>
</objectPermissions>
<objectPermissions>
<allowCreate>true</allowCreate>
<allowRead>true</allowRead>
<object>Stripe_Coupon_Beta_Serialized__c</object>
<viewAllRecords>true</viewAllRecords>
</objectPermissions>
<objectPermissions>
<allowCreate>true</allowCreate>
<allowDelete>true</allowDelete>
<allowEdit>true</allowEdit>
<allowRead>true</allowRead>
<object>Stripe_Coupon_Beta_Order_Item_Associatio__c</object>
<object>Stripe_Coupon_Serialized__c</object>
<viewAllRecords>true</viewAllRecords>
</objectPermissions>
<pageAccesses>
Expand Down
Loading

0 comments on commit 2af045f

Please sign in to comment.