Spaces:
Sleeping
Sleeping
Commit
·
c1900c3
1
Parent(s):
b3cff50
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,8 @@ def fetch_shareasale_data(action_verb, affiliate_id, api_token, api_secret_key,
|
|
14 |
'affiliateId': affiliate_id,
|
15 |
'token': api_token,
|
16 |
'version': api_version,
|
17 |
-
'action': action_verb
|
|
|
18 |
})
|
19 |
|
20 |
sig = f"{api_token}:{my_timestamp}:{action_verb}:{api_secret_key}"
|
@@ -60,5 +61,11 @@ if st.sidebar.button("Fetch Data"):
|
|
60 |
# Parse the CSV data into a DataFrame
|
61 |
df = parse_csv_to_df(ledger_data)
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
# Display the DataFrame as a table
|
64 |
-
st.write(
|
|
|
14 |
'affiliateId': affiliate_id,
|
15 |
'token': api_token,
|
16 |
'version': api_version,
|
17 |
+
'action': action_verb,
|
18 |
+
'merchantId': '' # Adding merchantId as a query parameter (fill in the value if needed)
|
19 |
})
|
20 |
|
21 |
sig = f"{api_token}:{my_timestamp}:{action_verb}:{api_secret_key}"
|
|
|
61 |
# Parse the CSV data into a DataFrame
|
62 |
df = parse_csv_to_df(ledger_data)
|
63 |
|
64 |
+
# Filter rows where action is "Transaction Created"
|
65 |
+
df_filtered = df.loc[df['action'] == 'Transaction Created']
|
66 |
+
|
67 |
+
# Remove 'ledgerid' and 'transid' columns
|
68 |
+
df_filtered = df_filtered.drop(columns=['ledgerid', 'transid'])
|
69 |
+
|
70 |
# Display the DataFrame as a table
|
71 |
+
st.write(df_filtered)
|