PayPalAndroidTest.PayPalManager.BuySomething C# (CSharp) Method

BuySomething() public method

public BuySomething ( ) : void
return void
		public void BuySomething() {
			/* 
         * PAYMENT_INTENT_SALE will cause the payment to complete immediately.
         * Change PAYMENT_INTENT_SALE to 
         *   - PAYMENT_INTENT_AUTHORIZE to only authorize payment and capture funds later.
         *   - PAYMENT_INTENT_ORDER to create a payment for authorization and capture
         *     later via calls from your server.
         * 
         * Also, to include additional payment details and an item list, see getStuffToBuy() below.
         */
			PayPalPayment thingToBuy = getThingToBuy (PayPalPayment.PaymentIntentSale);

			/*
         * See getStuffToBuy(..) for examples of some available payment options.
         */

			Intent intent = new Intent (Context, typeof(PaymentActivity));

			// send the same configuration for restart resiliency
			intent.PutExtra (PayPalService.ExtraPaypalConfiguration, config);

			intent.PutExtra (PaymentActivity.ExtraPayment, thingToBuy);

			(Context as Activity).StartActivityForResult (intent, REQUEST_CODE_PAYMENT);
		}

Usage Example

 void Button_Click(object sender, System.EventArgs e)
 {
     MainManager.BuySomething();
 }