2017-09-05 29 views
0

我想將條紋支付網關集成到xamarin.android中,但我得到了應用程序關閉問題。這裏是我嘗試過的示例代碼。應用程序在xamarin中集成條紋查看支付網關時崩潰android

示例代碼:

[assembly: ExportRenderer(typeof(PaymentView), typeof(CardInputActivity)] 
namespace SampleProject.Droid.PaymentController 

public class CardInputActivity(Bundle bundle) : Activity 
{ 
    base.OnCreate(bundle); 

    SetContentView(Resource.Layout.CardInput); 

    Helper.StripeView = FindViewById<StripeView>(Resource.Id.stripeLayoutOne); 
} 

CardInput.axml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:padding="20dp"> 
<Stripe.StripeView 
    android:id="@+id/stripeView" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginBottom="10dp" /> 
</LinearLayout> 

這是我試過的代碼。在上面'CardInPutActivity'是android中的渲染器類,'CardInputView'是資源文件夾中的佈局文件,'PaymentView'是可移植類包含視圖。

回答

0

不幸的是我不確定答案是什麼。看來Xamarin Stripe組件現在已經有好幾年了,並且可能不再工作了。這個組件是由Xamarin自己構建的[1],因此聯繫他們尋求幫助可能是您最好的選擇。

除此之外,我會嘗試一步一步通過您的應用程序與調試器和/或添加一些System.out.println()語句,看看事情正在下降。

[1] https://components.xamarin.com/view/stripe