mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
Add Anypay token (#518)
* Add AnyPay token for interacting with the AnyPay API for Cake Pay payments * Add missing commas Co-authored-by: mkyq <53115730+mkyq@users.noreply.github.com>
This commit is contained in:
parent
6e01bbb1a5
commit
30bac3cb6c
2 changed files with 9 additions and 2 deletions
|
@ -5,11 +5,13 @@ import 'package:http/http.dart';
|
|||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cake_wallet/anypay/any_pay_payment.dart';
|
||||
import 'package:cake_wallet/anypay/any_pay_trasnaction.dart';
|
||||
import 'package:cake_wallet/.secrets.g.dart' as secrets;
|
||||
|
||||
class AnyPayApi {
|
||||
static const contentTypePaymentRequest = 'application/payment-request';
|
||||
static const contentTypePayment = 'application/payment';
|
||||
static const xPayproVersion = '2';
|
||||
static const anypayToken = secrets.anypayToken;
|
||||
|
||||
static String chainByScheme(String scheme) {
|
||||
switch (scheme.toLowerCase()) {
|
||||
|
@ -44,7 +46,9 @@ class AnyPayApi {
|
|||
final headers = <String, String>{
|
||||
'Content-Type': contentTypePaymentRequest,
|
||||
'X-Paypro-Version': xPayproVersion,
|
||||
'Accept': '*/*',};
|
||||
'Accept': '*/*',
|
||||
'x-wallet': 'cake',
|
||||
'x-wallet-token': anypayToken,};
|
||||
final body = <String, dynamic>{
|
||||
'chain': chainByScheme(scheme),
|
||||
'currency': currencyByScheme(scheme).title};
|
||||
|
@ -66,7 +70,9 @@ class AnyPayApi {
|
|||
final headers = <String, String>{
|
||||
'Content-Type': contentTypePayment,
|
||||
'X-Paypro-Version': xPayproVersion,
|
||||
'Accept': '*/*',};
|
||||
'Accept': '*/*',
|
||||
'x-wallet': 'cake',
|
||||
'x-wallet-token': anypayToken,};
|
||||
final body = <String, dynamic>{
|
||||
'chain': chain,
|
||||
'currency': currency,
|
||||
|
|
|
@ -26,6 +26,7 @@ class SecretKey {
|
|||
SecretKey('sideShiftAffiliateId', () => ''),
|
||||
SecretKey('sideShiftApiKey', () => ''),
|
||||
SecretKey('simpleSwapApiKey', () => ''),
|
||||
SecretKey('anypayToken', () => ''),
|
||||
SecretKey('onramperApiKey', () => ''),
|
||||
];
|
||||
|
||||
|
|
Loading…
Reference in a new issue