Tonder Full SDK

Tonder Full SDK helps to integrate the services Tonder offers in your own flutter application

Installation

  • Run
flutter pub get full_sdk
  • Add to android.build.gradle:
    maven {
        url 'https://maven.pkg.github.com/skyflowapi/skyflow-android-sdk'
        credentials {
            username = 'username'
            password = 'password'
        }
    }
  • Add to android.gradle.properties:
android.useAndroidX=true

Example:

    if (_fullPlugin != null) _fullPlugin!.removeCheckout();

    const apiKey = "00d17d61e9240c6e0611fbdb1558e636ed6389db";
    const returnUrl = "http://localhost:8100/tabs/tab2";

    _fullPlugin = InlineCheckout(
      platforms: null,
      apiKeyTonder: apiKey,
      returnUrl: returnUrl,
      successUrl: returnUrl,
      renderPaymentButton: false,
    );

    Map<String, dynamic> customerData = {
      "customer": {
        "firstName": "Pedro",
        "lastName": "Perez",
        "country": "Finlandia",
        "street": "The street",
        "city": "The city",
        "state": "The state",
        "postCode": "22222",
        "email": "mail@gmail.com",
        "phone": "53453453453"
      },
      "cart": {
        "total": 250,
        "items": [
          {
            "description": "Test product description",
            "quantity": 1,
            "price_unit": 250,
            "discount": 25,
            "taxes": 12,
            "product_reference": 12,
            "name": "Test product",
            "amount_total": 250
          }
        ]
      }
    };

    _fullPlugin!.setPaymentData(customerData);
    _fullPlugin!.setCartTotal(0);
    _fullPlugin!.setCustomerEmail("mail@gmail.com");
    
    await _fullPlugin!.injectCheckout();

    Map<String, dynamic>? response = await _fullPlugin!.verify3dsTransaction();

    if (response != null) {
      if (response["status"] == "Success") {
        ...
      } else if (response["status"] == "Failed") {
        ...
      } 
    }

    setState(() {});


    Scaffold(
        body: SizedBox(
          height: 1200,
          child: _fullPlugin?.cardTemplate ?? Text("Loading card template"),
        ),
    ),