Esempio n. 1
0
        public Paystack(decimal model, PaymentForm id)
        {
            InitializeComponent();
            // Init(model, id);
            vm = new ContributionItemVM(id);
            PopupNavigation.PopAsync();
            //Info = info;
            // var amount = info.TransactionCharge;


            var app = Application.Current as App;

            JArray  jarray            = new JArray();
            dynamic customFieldsArray = new JArray();

            dynamic displayname = new JObject();

            displayname.display_name  = "Mobile Number";
            displayname.variable_name = "mobile_number";
            displayname.@value        = "+2348012345678";
            customFieldsArray.Add(displayname);

            dynamic jobtitlefield = new JObject();

            jobtitlefield.display_name  = "Job Title";
            jobtitlefield.variable_name = "job_title";
            customFieldsArray.Add(jobtitlefield);
            dynamic custom = new JObject();

            custom.custom_fields = customFieldsArray;

            dynamic product = new JObject();

            product.key = "pk_live_5066a61cbd1694ec8276b1205f9ebcd885c34701";
            // product.key = "pk_test_9a8895ede03716b9a0474fea6da11ec5bc1c7033";
            product.email    = Preferences.Get("userName", string.Empty) == "" ? "*****@*****.**" : Preferences.Get("userName", string.Empty);
            product.currency = "NGN";
            product.amount   = model * 100;
            // product.email = product.email.trim();
            //  product.subaccount = "";
            product.bearer   = "account";
            product.@ref     = id.orderId;//Info.PaymentReference;
            product.metadata = custom;
            try
            {
                hybridWebView.Data = product.ToString();


                hybridWebView.RegisterCloseAction(() => CloseMethod());

                hybridWebView.RegisterCallBackAction(data => ResponsePayment());
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 2
0
 public AddPaymentMethodPage(PaymentForm model)
 {
     InitializeComponent();
     BindingContext = vm = new ContributionItemVM(model);
 }