Tap-Payments / gosellSDK-Flutter

Flutter plugin for goSellSDK
MIT License
11 stars 24 forks source link

always return sdk_result:Failed #14

Open sanu-krishnan opened 3 years ago

sanu-krishnan commented 3 years ago

I have tried the example code with our tap credentials and bundle identifiers. But always getting following response


flutter: result in dart : {trx_mode: CHARGE, sdk_result: FAILED}
flutter: >>>> FAILED

setupSDKSession is as follows

Future<void> setupSDKSession() async {
    try {
      GoSellSdkFlutter.sessionConfigurations(
          trxMode: TransactionMode.PURCHASE,
          transactionCurrency: "kwd",
          amount: '100',
          customer: Customer(
              customerId:
                  "", // customer id is important to retrieve cards saved for this customer
              email: "test@test.com",
              isdNumber: "965",
              number: "00000000",
              firstName: "test",
              middleName: "test",
              lastName: "test",
              metaData: null),
          paymentItems: <PaymentItem>[
            PaymentItem(
                name: "item1",
                amountPerUnit: 1,
                quantity: Quantity(value: 1),
                discount: {
                  "type": "F",
                  "value": 10,
                  "maximum_fee": 10,
                  "minimum_fee": 1
                },
                description: "Item 1 Apple",
                taxes: [
                  Tax(
                      amount: Amount(
                          type: "F", value: 10, minimumFee: 1, maximumFee: 10),
                      name: "tax1",
                      description: "tax describtion")
                ],
                totalAmount: 100),
          ],
          // List of taxes
          taxes: [
            Tax(
                amount:
                    Amount(type: "F", value: 10, minimumFee: 1, maximumFee: 10),
                name: "tax1",
                description: "tax describtion"),
            Tax(
                amount:
                    Amount(type: "F", value: 10, minimumFee: 1, maximumFee: 10),
                name: "tax1",
                description: "tax describtion")
          ],
          // List of shippnig
          shippings: [
            Shipping(
                name: "shipping 1",
                amount: 100,
                description: "shiping description 1"),
            Shipping(
                name: "shipping 2",
                amount: 150,
                description: "shiping description 2")
          ],
          // Post URL
          postURL: "https://tap.company",
          // Payment description
          paymentDescription: "paymentDescription",
          // Payment Metadata
          paymentMetaData: {
            "a": "a meta",
            "b": "b meta",
          },
          // Payment Reference
          paymentReference: Reference(
              acquirer: "acquirer",
              gateway: "gateway",
              payment: "payment",
              track: "track",
              transaction: "trans_910101",
              order: "order_262625"),
          // payment Descriptor
          paymentStatementDescriptor: "paymentStatementDescriptor",
          // Save Card Switch
          isUserAllowedToSaveCard: true,
          // Enable/Disable 3DSecure
          isRequires3DSecure: false,
          // Receipt SMS/Email
          receipt: Receipt(true, false),
          // Authorize Action [Capture - Void]
          authorizeAction: AuthorizeAction(
              type: AuthorizeActionType.CAPTURE, timeInHours: 10),
          // Destinations
          destinations: null,
          // merchant id
          merchantID: "",
          // Allowed cards
          allowedCadTypes: CardType.CREDIT,
          applePayMerchantID: "applePayMerchantID",
          allowsToSaveSameCardMoreThanOnce: false,
          // pass the card holder name to the SDK
          cardHolderName: "Card Holder NAME",
          // disable changing the card holder name by the user
          allowsToEditCardHolderName: false,
          // select payments you need to show [Default is all, and you can choose between WEB-CARD-APPLEPAY ]
          paymentType: PaymentType.ALL,
          // Transaction mode
          sdkMode: SDKMode.Sandbox);
    } on PlatformException {
      // platformVersion = 'Failed to get platform version.';
    }

    if (!mounted) return;

    setState(() {
      tapSDKResult = {};
    });
  }
abodamin commented 3 years ago

same goes to me, I'm using the Flutter plugin and your example code and getting FAILED and all other data are null

into-expert commented 1 year ago

Hello @abodamin and @sanu-krishnan I'm facing the same problem and I'm not able to solve it. Do you remember if you found any workaround for this issue?

Thank you