-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rsa, sber, external payment methods
- Loading branch information
yan
committed
Oct 10, 2024
1 parent
af0737f
commit 7a59788
Showing
13 changed files
with
320 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,12 @@ class MyApp extends StatelessWidget { | |
title: 'Flutter Demo', | ||
debugShowCheckedModeBanner: false, | ||
theme: ThemeData( | ||
colorScheme: | ||
ColorScheme.fromSeed(seedColor: Colors.deepPurple), | ||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), | ||
useMaterial3: true, | ||
), | ||
home: const MyHomePage(title: 'PaySelection-Flutter-SDK'), | ||
home: const MyHomePage( | ||
title: 'PaySelection-Flutter-SDK', | ||
), | ||
); | ||
} | ||
} | ||
|
@@ -39,62 +40,82 @@ class _MyHomePageState extends State<MyHomePage> { | |
void initState() { | ||
super.initState(); | ||
|
||
_pay().proceedResult((responseData) { | ||
showDialog( | ||
context: context, | ||
builder: (builder) => ThreeDS( | ||
url: responseData.redirectUrl ?? '', | ||
)).then((value) => ScaffoldMessenger.of(context) | ||
.showSnackBar(SnackBar( | ||
content: Text(value == true | ||
? 'Success transaction' | ||
: 'Fail transaction')))); | ||
|
||
//for check transaction status use config.transactionStatus | ||
|
||
// config.transactionStatus(TransactionStatusRequest( | ||
// transactionId: responseData.transactionId ?? "", | ||
// transactionSecretKey: | ||
// responseData.transactionSecretKey ?? "")); | ||
|
||
|
||
}, | ||
(errorCode) => ScaffoldMessenger.of(context) | ||
.showSnackBar(SnackBar(content: Text(errorCode)))); | ||
_pay().proceedResult( | ||
(responseData) { | ||
ScaffoldMessenger.of(context).showSnackBar( | ||
SnackBar( | ||
content: Text( | ||
'Success transaction', | ||
), | ||
), | ||
); | ||
// showDialog( | ||
// context: context, | ||
// builder: (builder) => ThreeDS( | ||
// url: responseData.redirectUrl ?? '', | ||
// )).then( | ||
// (value) => ScaffoldMessenger.of(context).showSnackBar( | ||
// SnackBar( | ||
// content: Text( | ||
// value == true ? 'Success transaction' : 'Fail transaction'), | ||
// ), | ||
// ), | ||
// ); | ||
|
||
// for check transaction status use config.transactionStatus | ||
// | ||
// config.transactionStatus(TransactionStatusRequest( | ||
// transactionId: responseData.transactionId ?? "", | ||
// transactionSecretKey: | ||
// responseData.transactionSecretKey ?? "")); | ||
}, | ||
(errorCode) => ScaffoldMessenger.of(context).showSnackBar( | ||
SnackBar( | ||
content: Text(errorCode), | ||
), | ||
), | ||
); | ||
} | ||
|
||
Future<BaseResponse<PublicPayResponse>> _pay() async { | ||
config = PaySelectionSDK(PaySelectionConfig.credential( | ||
config = PaySelectionSDK( | ||
PaySelectionConfig.credential( | ||
publicKey: | ||
'04bd07d3547bd1f90ddbd985feaaec59420cabd082ff5215f34fd1c89c5d8562e8f5e97a5df87d7c99bc6f16a946319f61f9eb3ef7cf355d62469edb96c8bea09e', | ||
'04bd07d3547bd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y1NxYTdwRytTM2JOYkZvUVJlU1dvK2pzV0JNOU1NemJvckNqYWE1UzRNCnNCV0UyN2FRSElVMU5sTGNqK0laUldzQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo=', | ||
xSiteId: '21044', | ||
isDebug: true) | ||
isDebug: true, | ||
), | ||
); | ||
|
||
var request = PublicPayRequest( | ||
orderId: "SAM_SDK_3", | ||
description: "test payment", | ||
paymentMethod: PaymentMethod.cryptogram, | ||
paymentMethod: PaymentMethod.externalForm, | ||
amount: '10', | ||
currency: 'RUB', | ||
cardDetails: CardDetails( | ||
cardHolderName: "TEST CARD", | ||
cardNumber: "5260111696757102", //success card | ||
// cardNumber: '2408684917843810', //fail card | ||
cvc: "123", | ||
expMonth: "12", | ||
expYear: "24"), | ||
// cardDetails: CardDetails( | ||
// cardHolderName: "TEST CARD", | ||
// cardNumber: "5260111696757102", | ||
// //success card | ||
// // cardNumber: '2408684917843810', //fail card | ||
// cvc: "123", | ||
// expMonth: "12", | ||
// expYear: "24", | ||
// ), | ||
customerInfo: CustomerInfo( | ||
email: "[email protected]", | ||
phone: "+19991231212", | ||
language: "en", | ||
address: "string", | ||
town: "string", | ||
zip: "string", | ||
country: "USA", | ||
isSendReceipt: false, | ||
receiptEmail: '[email protected]', | ||
ip: '8.8.8.8'), | ||
email: "[email protected]", | ||
phone: "+19991231212", | ||
language: "en", | ||
address: "string", | ||
town: "string", | ||
zip: "string", | ||
country: "USA", | ||
isSendReceipt: false, | ||
receiptEmail: '[email protected]', | ||
ip: '8.8.8.8', | ||
), | ||
rebillFlag: false, | ||
); | ||
|
||
|
Oops, something went wrong.