Skip to content

Commit

Permalink
fix: moneygram stellar config (#1540)
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Bubochkin <[email protected]>
  • Loading branch information
justinenerio and ookami-kb authored Aug 3, 2024
1 parent 81f68b3 commit 30a91a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ import 'moneygram_interceptor.dart';

part 'moneygram_client.g.dart';

@RestApi(baseUrl: moneygramBaseUrl)
@RestApi()
@injectable
abstract class MoneygramApiClient {
@factoryMethod
factory MoneygramApiClient(MoneygramInterceptor interceptor) =>
_MoneygramApiClient(Dio()..interceptors.add(interceptor));
_MoneygramApiClient(
Dio()..interceptors.add(interceptor),
baseUrl: moneygramBaseUrl,
);

@POST('/sep24/transactions/withdraw/interactive')
Future<MgWithdrawResponseDto> generateWithdrawUrl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '../../../../../ui/loader.dart';
import '../../../../../ui/snackbar.dart';
import '../../../../../ui/theme.dart';
import '../../../../../ui/web_view_screen.dart';
import '../../../../../utils/errors.dart';
import '../../../../conversion_rates/widgets/extensions.dart';
import '../../../../currency/models/amount.dart';
import '../../../../currency/models/currency.dart';
Expand Down Expand Up @@ -215,7 +216,9 @@ window.addEventListener("message", (event) => {
final url = '${response.url}&callback=postmessage';

return (id: response.id, url: url, token: token);
} on Exception {
} on Exception catch (error) {
reportError(error);

return null;
}
});
Expand All @@ -233,10 +236,9 @@ window.addEventListener("message", (event) => {
type: type,
);

final payAmount = fees.moneygramFee + amount;

final feeLabel = switch (type) {
RampType.onRamp => 'You will pay ${payAmount.format(locale)}',
RampType.onRamp =>
'You will pay ${(fees.moneygramFee + amount).format(locale)}',
RampType.offRamp => null,
};

Expand Down

0 comments on commit 30a91a5

Please sign in to comment.