Skip to content

Commit

Permalink
chore: change misleading transak wording
Browse files Browse the repository at this point in the history
  • Loading branch information
YermekG committed Jan 19, 2025
1 parent 140ca30 commit f802677
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 36 deletions.
12 changes: 7 additions & 5 deletions Source/Immutable/Immutable.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
{
"Core",
"JsonUtilities",
#if UE_5_1_OR_LATER
"WebBrowser",
"WebBrowserWidget",
#endif
}
);

Expand All @@ -43,7 +39,13 @@ public Immutable(ReadOnlyTargetRules Target) : base(Target)
);

#if UE_5_1_OR_LATER
PublicDependencyModuleNames.Add("WebBrowserWidget");
PublicDependencyModuleNames.AddRange(
new string[]
{
"WebBrowser",
"WebBrowserWidget"
}
);
#else
PrivateDependencyModuleNames.Add("BluExtension");
if (Target.Platform == UnrealTargetPlatform.Win64)
Expand Down
9 changes: 8 additions & 1 deletion Source/ImmutableMarketplace/ImmutableMarketplace.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ public ImmutableMarketplace(ReadOnlyTargetRules Target) : base(Target)
}
);

#if! UE_5_1_OR_LATER
#if UE_5_1_OR_LATER
PublicDependencyModuleNames.AddRange(
new string[]
{
"WebBrowser",
}
);
#else
PrivateDependencyModuleNames.Add("BluExtension");
if (Target.Platform == UnrealTargetPlatform.Win64)
{
Expand Down
55 changes: 29 additions & 26 deletions Source/ImmutableMarketplace/Private/OnRampWebBrowserWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
#include "SWebBrowser.h"

#include "Immutable/Misc/ImtblLogging.h"
#else
#include "UserInterface/BluWebBrowser.h"
#endif

#define LOCTEXT_NAMESPACE "OnRampWebBrowser"
#define LOCTEXT_NAMESPACE "OnRampWidget"

DEFINE_LOG_CATEGORY(LogImmutableOnRampWidget);


bool UOnRampWidget::IsReady() const
{
Expand Down Expand Up @@ -54,7 +55,7 @@ TSharedRef<SWidget> UOnRampWidget::RebuildWidget()
.VAlign(VAlign_Center)
[
SNew(STextBlock)
.Text(LOCTEXT("Transak Web Browser", "Transak Web Browser"))
.Text(LOCTEXT("OnRamp Web Browser", "OnRamp Web Browser"))
];
}
else
Expand All @@ -81,26 +82,28 @@ FString UOnRampWidget::ComputePath(const FString& WalletAddress, const FString&
{
auto Settings = GetDefault<UImmutableMarketplaceSettings>();

UOnRampWidgetConfig* TransakConfig = Settings->DefaultOnRampWidgetConfig.GetDefaultObject();
UOnRampWidgetConfig* OnRampWidgetConfig = Settings->DefaultOnRampWidgetConfig.GetDefaultObject();

if (!TransakConfig)
if (!OnRampWidgetConfig)
{
UE_LOG(LogImmutableOnRampWidget, Error, TEXT("On ramp widget config is not assigned!"));

return TEXT("");
}

FString Path = TransakConfig->GetURL();
FString Path = OnRampWidgetConfig->GetURL();
TArray<FString> QueryParams;

QueryParams.Add(FString(TEXT("apiKey=")) + FPlatformHttp::UrlEncode(TransakConfig->GetAPIKey()));
QueryParams.Add(FString(TEXT("apiKey=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetAPIKey()));
QueryParams.Add(FString(TEXT("email=")) + FPlatformHttp::UrlEncode(Email));
QueryParams.Add(FString(TEXT("walletAddress=")) + FPlatformHttp::UrlEncode(WalletAddress));
QueryParams.Add(FString(TEXT("themeColor=")) + FPlatformHttp::UrlEncode(TransakConfig->GetThemeColor().ToString()));
QueryParams.Add(FString(TEXT("isAutoFillUserData=")) + FPlatformHttp::UrlEncode(TransakConfig->IsAutoFillUserData() ? TEXT("true") : TEXT("false")));
QueryParams.Add(FString(TEXT("disableWalletAddressForm=")) + FPlatformHttp::UrlEncode(TransakConfig->DisableWalletAddressForm() ? TEXT("true") : TEXT("false")));
QueryParams.Add(FString(TEXT("themeColor=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetThemeColor().ToString()));
QueryParams.Add(FString(TEXT("isAutoFillUserData=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->IsAutoFillUserData() ? TEXT("true") : TEXT("false")));
QueryParams.Add(FString(TEXT("disableWalletAddressForm=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->DisableWalletAddressForm() ? TEXT("true") : TEXT("false")));

if (!TransakConfig->GetNetwork().IsEmpty())
if (!OnRampWidgetConfig->GetNetwork().IsEmpty())
{
QueryParams.Add(FString(TEXT("network=")) + FPlatformHttp::UrlEncode(TransakConfig->GetNetwork()));
QueryParams.Add(FString(TEXT("network=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetNetwork()));
}

if (!ProductsAvailed.IsEmpty())
Expand All @@ -113,34 +116,34 @@ FString UOnRampWidget::ComputePath(const FString& WalletAddress, const FString&
QueryParams.Add(FString(TEXT("exchangeScreenTitle=")) + FPlatformHttp::UrlEncode(ScreenTitle));
}

if (!TransakConfig->GetDefaultCryptoCurrency().IsEmpty())
if (!OnRampWidgetConfig->GetDefaultCryptoCurrency().IsEmpty())
{
QueryParams.Add(FString(TEXT("defaultCryptoCurrency=")) + FPlatformHttp::UrlEncode(TransakConfig->GetDefaultCryptoCurrency()));
QueryParams.Add(FString(TEXT("defaultCryptoCurrency=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetDefaultCryptoCurrency()));
}

if (!TransakConfig->GetDefaultFiatAmount().IsEmpty())
if (!OnRampWidgetConfig->GetDefaultFiatAmount().IsEmpty())
{
QueryParams.Add(FString(TEXT("defaultFiatAmount=")) + FPlatformHttp::UrlEncode(TransakConfig->GetDefaultFiatAmount()));
QueryParams.Add(FString(TEXT("defaultFiatAmount=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetDefaultFiatAmount()));
}

if (!TransakConfig->GetDefaultFiatCurrency().IsEmpty())
if (!OnRampWidgetConfig->GetDefaultFiatCurrency().IsEmpty())
{
QueryParams.Add(FString(TEXT("defaultFiatCurrency=")) + FPlatformHttp::UrlEncode(TransakConfig->GetDefaultFiatCurrency()));
QueryParams.Add(FString(TEXT("defaultFiatCurrency=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetDefaultFiatCurrency()));
}

if (!TransakConfig->GetDefaultPaymentMethod().IsEmpty())
if (!OnRampWidgetConfig->GetDefaultPaymentMethod().IsEmpty())
{
QueryParams.Add(FString(TEXT("defaultPaymentMethod=")) + FPlatformHttp::UrlEncode(TransakConfig->GetDefaultPaymentMethod()));
QueryParams.Add(FString(TEXT("defaultPaymentMethod=")) + FPlatformHttp::UrlEncode(OnRampWidgetConfig->GetDefaultPaymentMethod()));
}

if (TransakConfig->GetCryptoCurrencyList().Num() > 0)
if (OnRampWidgetConfig->GetCryptoCurrencyList().Num() > 0)
{
QueryParams.Add(FString(TEXT("cryptoCurrencyList=")) + FPlatformHttp::UrlEncode(FString::Join(TransakConfig->GetCryptoCurrencyList(), TEXT(","))));
QueryParams.Add(FString(TEXT("cryptoCurrencyList=")) + FPlatformHttp::UrlEncode(FString::Join(OnRampWidgetConfig->GetCryptoCurrencyList(), TEXT(","))));
}

if (TransakConfig->GetDisablePaymentMethods().Num() > 0)
if (OnRampWidgetConfig->GetDisablePaymentMethods().Num() > 0)
{
QueryParams.Add(FString(TEXT("disablePaymentMethods=")) + FPlatformHttp::UrlEncode(FString::Join(TransakConfig->GetDisablePaymentMethods(), TEXT(","))));
QueryParams.Add(FString(TEXT("disablePaymentMethods=")) + FPlatformHttp::UrlEncode(FString::Join(OnRampWidgetConfig->GetDisablePaymentMethods(), TEXT(","))));
}

Path += TEXT("?");
Expand All @@ -161,7 +164,7 @@ void UOnRampWidget::HandleOnUrlChanged(const FText& Text)
#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
void UOnRampWidget::HandleOnConsoleMessage(const FString& Message, const FString& Source, int32 Line, EWebBrowserConsoleLogSeverity Severity)
{
IMTBL_LOG("Transak Web Browser console message: %s, Source: %s, Line: %d", *Message, *Source, Line);
UE_LOG(LogImmutableOnRampWidget, Log, TEXT("Web Browser console message: %s, Source: %s, Line: %d"), *Message, *Source, Line);
}

bool UOnRampWidget::HandleOnBeforePopup(FString URL, FString Frame)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ class IMMUTABLEMARKETPLACE_API UImmutableMarketplaceSettings : public UDeveloper
/// The default on ramp widget configuration class.
/// This property holds a reference to a subclass of UTransakConfig,
/// which is used to load on ramp widget in web browser.
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = "Transak")
UPROPERTY(Config, EditAnywhere, BlueprintReadOnly)
TSubclassOf<UOnRampWidgetConfig> DefaultOnRampWidgetConfig;
};
7 changes: 5 additions & 2 deletions Source/ImmutableMarketplace/Public/OnRampWebBrowserWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "OnRampWebBrowserWidget.generated.h"


DECLARE_LOG_CATEGORY_EXTERN(LogImmutableOnRampWidget, Log, All);

#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
enum class EWebBrowserConsoleLogSeverity;

Expand All @@ -14,7 +17,7 @@ class SBluWebBrowser;


/**
* A custom web browser widget for Transak transactions.
* A custom web browser widget for Immutable On Ramp funds transactions.
*/
UCLASS()
class IMMUTABLEMARKETPLACE_API UOnRampWidget : public UWidget
Expand All @@ -34,7 +37,7 @@ class IMMUTABLEMARKETPLACE_API UOnRampWidget : public UWidget
bool IsReady() const;

/**
* Loads Transak widget with provided user data.
* Loads on ramp widget with provided user data.
*
* @param WalletAddress The wallet address to load.
* @param Email The email associated with the user.
Expand Down
2 changes: 1 addition & 1 deletion Source/ImmutableMarketplace/Public/OnRampWidgetConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class IMMUTABLEMARKETPLACE_API UOnRampWidgetConfig : public UObject
* If the network selected is not supported by a product type (BUY/SELL) then the default widget will
* all supported networks will be shown.
*/
UPROPERTY(EditDefaultsOnly, Category = "Transak")
UPROPERTY(EditDefaultsOnly, Category = "Blockchain")
FString Network;

/**
Expand Down

0 comments on commit f802677

Please sign in to comment.