اذهب إلى المحتوى
  • 0

توقف عملية الدفع الى paypal

Marwan800

السؤال

السلام عليكم ورحمة الله وبركاته

تحيه طيبه للجميع

قمت بستعمال الاضافة التالية:

https://pub.dev/packages/flutter_braintree

اتبعت كل الخطوات الموضحه في الشرح والتطبيق شغال الان ويتم عرض اربع ازرار . 

ايضا قمت بعمل حساب في :

Sign up for the sandbox

وبعد انشاء الحساب قمت باخذ tokenizationKey من الحساب 

وتم اضافته في الاضافة flutter_braintree حسب الشرح في الخانة المطلوبة 

الان بعد تشغيل الكود اقوم بضغط على زر  LAUNCH NATIVE DROP-IN

ويتم من خلالها طلب طريقة الدفع قمت بادخال بطاقة لتجربة من وثيقة flutter_braintree كالتالي:

 cardNumber: '4111111111111111',
  expirationMonth: '12',
  expirationYear: '2021',

بعد تسجيل بيانات البطاقة يظهر لدي showDialog التالي:

6013f8e727651_2021-01-29151959.thumb.png.1531c4a92b44692db8319eaddbd4ad05.png

 

 

D/****MAGNES DEBUGGING MESSAGE****(14717): DeviceInfoRequest returned PayPal-Debug-Id: 0063c04d20777
I/AppCompatViewInflater(14717): app:theme is now deprecated. Please move to using android:theme instead.
I/AssistStructure(14717): Flattened final assist data: 4584 bytes, containing 1 windows, 21 views
W/IInputConnectionWrapper(14717): getTextBeforeCursor on inactive InputConnection
I/AssistStructure(14717): Flattened final assist data: 7248 bytes, containing 2 windows, 35 views
W/IInputConnectionWrapper(14717): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(14717): getTextAfterCursor on inactive InputConnection
W/ViewRootImpl[AddCardActivity](14717): Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_1, scanCode=2, metaState=0, flags=0x28, repeatCount=0, eventTime=211456777, downTime=211456777, deviceId=0, source=0x101, displayId=-1 }
W/IInputConnectionWrapper(14717): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(14717): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(14717): getTextAfterCursor on inactive InputConnection
I/chatty  (14717): uid=10175(com.example.flutter_appbbb) identical 4 lines
W/ViewRootImpl[AddCardActivity](14717): Cancelling event due to no window focus: KeyEvent { action=ACTION_UP, keyCode=KEYCODE_1, scanCode=2, metaState=0, flags=0x28, repeatCount=0, eventTime=211456777, downTime=211456777, deviceId=0, source=0x101, displayId=-1 }
W/InputEventReceiver(14717): Attempted to finish an input event but the input event receiver has already been disposed.
D/****MAGNES DEBUGGING MESSAGE****(14717): DeviceInfoRequest returned PayPal-Debug-Id: d653db1f48862

 

ثم لا يحدث شي لا اعلم ما هو سبب المشكلة ولكن العملية تتوقف هنا ولا يوجد رصيد تم اضافته في حساب paypal 

هل في احد يعرف سبب حدوث هذا المشكلة ؟

 

الكود كامل:

import 'package:flutter/material.dart';
import 'package:flutter_braintree/flutter_braintree.dart';

void main() => runApp(
  MaterialApp(
    home: MyApp(),
  ),
);

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  static final String tokenizationKey = '************';

  void showNonce(BraintreePaymentMethodNonce nonce) {
    showDialog(
      context: context,
      builder: (_) => AlertDialog(
        title: Text('Payment method nonce:'),
        content: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            Text('Nonce: ${nonce.nonce}'),
            SizedBox(height: 16),
            Text('Type label: ${nonce.typeLabel}'),
            SizedBox(height: 16),
            Text('Description: ${nonce.description}'),
          ],
        ),
      ),
    );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Braintree example app'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            RaisedButton(
              onPressed: () async {
                var request = BraintreeDropInRequest(
                  tokenizationKey: tokenizationKey,
                  collectDeviceData: true,
                  googlePaymentRequest: BraintreeGooglePaymentRequest(
                    totalPrice: '0.01',
                    currencyCode: 'USD',
                    billingAddressRequired: false,
                  ),
                  paypalRequest: BraintreePayPalRequest(
                    amount: '0.01',
                    displayName: 'Example company',
                  ),
                  cardEnabled: true,
                );
                BraintreeDropInResult result =
                await BraintreeDropIn.start(request);
                if (result != null) {
                  showNonce(result.paymentMethodNonce);
                }
              },
              child: Text('LAUNCH NATIVE DROP-IN'),
            ),
            RaisedButton(
              onPressed: () async {
                final request = BraintreeCreditCardRequest(
                  cardNumber: '4111111111111111',
                  expirationMonth: '12',
                  expirationYear: '2021',
                );
                BraintreePaymentMethodNonce result =
                await Braintree.tokenizeCreditCard(
                  tokenizationKey,
                  request,
                );
                if (result != null) {
                  showNonce(result);
                }
              },
              child: Text('TOKENIZE CREDIT CARD'),
            ),
            RaisedButton(
              onPressed: () async {
                final request = BraintreePayPalRequest(
                  billingAgreementDescription:
                  'I hereby agree that flutter_braintree is great.',
                  displayName: 'Your Company',
                );
                BraintreePaymentMethodNonce result =
                await Braintree.requestPaypalNonce(
                  tokenizationKey,
                  request,
                );
                if (result != null) {
                  showNonce(result);
                }
              },
              child: Text('PAYPAL VAULT FLOW'),
            ),
            RaisedButton(
              onPressed: () async {
                final request = BraintreePayPalRequest(amount: '0.01');
                BraintreePaymentMethodNonce result =
                await Braintree.requestPaypalNonce(
                  tokenizationKey,
                  request,
                );
                if (result != null) {
                  showNonce(result);
                }
              },
              child: Text('PAYPAL CHECKOUT FLOW'),
            ),
          ],
        ),
      ),
    );
  }
}

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

Recommended Posts

  • 0

مرحبا مروان،

هل قمت بربط التطبيق مع الخدمة بشكل صحيح في الجزء التالي:

<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

حيث يوجد قيود في حقل applicationId: يقول:

Important: Your app's URL scheme must begin with your app's package ID
and end with .braintree. 
For example, if the Package ID is com.your-company.your-app,
then your URL scheme should be com.your-company.your-app.braintree. ${applicationId}
is automatically applied with your app's package when using Gradle.
Note: The scheme you define must use all lowercase letters.
If your package contains underscores, the underscores should be removed when specifying
the scheme in your Android Manifest.

أظن أنه عليك تعديل هذه الجزئية لإتمام عملية التحقق من أن التطبيق يتبع لنفس الحساب.

(يجب أن تحوي على حروف صغيرة فقط و بدون شرطة سفلية)

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 6 دقائق مضت قال Wael Aljamal:

مرحبا مروان،

هل قمت بربط التطبيق مع الخدمة بشكل صحيح في الجزء التالي:


<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

حيث يوجد قيود في حقل applicationId: يقول:


Important: Your app's URL scheme must begin with your app's package ID
and end with .braintree. 
For example, if the Package ID is com.your-company.your-app,
then your URL scheme should be com.your-company.your-app.braintree. ${applicationId}
is automatically applied with your app's package when using Gradle.
Note: The scheme you define must use all lowercase letters.
If your package contains underscores, the underscores should be removed when specifying
the scheme in your Android Manifest.

أظن أنه عليك تعديل هذه الجزئية لإتمام عملية التحقق من أن التطبيق يتبع لنفس الحساب.

(يجب أن تحوي على حروف صغيرة فقط و بدون شرطة سفلية)

 

اهلا اخي

قمت بوضعها بشكل التالي:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.flutter_appbbb">
    <!-- io.flutter.app.FlutterApplication is an android.app.Application that
         calls FlutterMain.startInitialization(this); in its onCreate method.
         In most cases you can leave this as-is, but you if you want to provide
         additional functionality it is fine to subclass or reimplement
         FlutterApplication and put your custom class here. -->
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutter_appbbb"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
            android:launchMode="singleTask">
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="com.example.flutter_appbbb.braintree" />
            </intent-filter>
        </activity>
        <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true"/>

        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

 

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 50 دقائق مضت قال Marwan800:

اهلا اخي

مرحبا مجددا،

تأتي قيمة applicationId من build.gradle في moudle في قسم الأندرويد ابحث عن الجزئية التالية وعدل الاسم حسبها:

أرجو الانتباه للتوافق

انظر للجزء 
applicationId "com.example.myapp"


android {
    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    ...
}

وبهذه الحالة سوق يتم قراءة معرف التطبيق applicationId من Gradle ثم إسنادها إلى androidMainfest

أي اترك العبارة التالية مثلما هي:

<data android:scheme="${applicationId}.braintree" />

في الجزء

<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

شكرا لك

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 2 ساعات قال Wael Aljamal:

مرحبا مجددا،

تأتي قيمة applicationId من build.gradle في moudle في قسم الأندرويد ابحث عن الجزئية التالية وعدل الاسم حسبها:

أرجو الانتباه للتوافق


انظر للجزء 
applicationId "com.example.myapp"


android {
    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    ...
}

وبهذه الحالة سوق يتم قراءة معرف التطبيق applicationId من Gradle ثم إسنادها إلى androidMainfest

أي اترك العبارة التالية مثلما هي:


<data android:scheme="${applicationId}.braintree" />

في الجزء

<activity android:name="com.braintreepayments.api.BraintreeBrowserSwitchActivity"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="${applicationId}.braintree" />
    </intent-filter>
</activity>

شكرا لك

على ما يبدو ان الامر لن ينجح ابدا اخي اسمحلي تعبتك لدي

استفسار فقط لو سمحت الا توجد طريقة للقيام بذلك بشكل مختلف؟ اقصد الدفع بواسطة الفيزا من خلال فلاتر الى paypal؟

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 32 دقائق مضت قال Marwan800:

استفسار فقط لو سمحت الا توجد طريقة للقيام بذلك بشكل مختلف؟ اقصد الدفع بواسطة الفيزا من خلال فلاتر الى paypal؟

تابع حل المشكلة لتعرف السبب،

على كل حال يمكنك تجريب flutter_pay يوجد جدول في الأسفل يوضح التقنيات التي تعمل معها و تتوفر visa لكلا نظامي android + ios

وجدت أيضا: stripe_sdk و stripe_payment

razorpay - flutter_credit_card

بالتوفيق

رابط هذا التعليق
شارك على الشبكات الإجتماعية

  • 0
بتاريخ 1 دقيقة مضت قال Wael Aljamal:

تابع حل المشكلة لتعرف السبب،

على كل حال يمكنك تجريب flutter_pay يوجد جدول في الأسفل يوضح التقنيات التي تعمل معها و تتوفر visa لكلا نظامي android + ios

وجدت أيضا: stripe_sdk و stripe_payment

بالتوفيق

الغريب في الامر ان من طور الباكج قام برفع نسخة على github قمت بتجربتها وهيا تحتوي على نفس المشكلة

رابط هذا التعليق
شارك على الشبكات الإجتماعية

انضم إلى النقاش

يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.

زائر
أجب على هذا السؤال...

×   لقد أضفت محتوى بخط أو تنسيق مختلف.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   جرى استعادة المحتوى السابق..   امسح المحرر

×   You cannot paste images directly. Upload or insert images from URL.

  • إعلانات

  • تابعنا على



×
×
  • أضف...