آموزش های این وب سایت به صورت رایگان در دسترس است. اطلاعات بیشتر
بروز خطا
   [message]
اشتراک در سوال
رای ها
[dataList]

سورس پرداخت درون برنامه غیر قابل هک تورو خدا کمک

دانیال  10 سال پیش  10 سال پیش
+2 0

سلام هرکس سورس کامل پروزه پرداخت درون برنامه غیر قابل هک داره بده ممنون میشم 

0 0
باید تحت سرور کار کنید. که واسه معتبر بودن تراکنش ها هم روشش خود کافه بازار توضیح داده (10 سال پیش)
0 0
من بدون سرور میخام (10 سال پیش)
0 0
بدون سرور هم می توانید امنیت برنامه تون رو تامین کنید: لینک (10 سال پیش)
0 0
اینو دیدم ولی یه جای کد ارور داره که نمیتونم حلش کنم اگه به صورت سورسی که بشه تو اکلیپس ایمپورتش کرد داشته باشی ممنون میشم (10 سال پیش)
0 0
کسی نداره (10 سال پیش)
0 0
سورس کدتون رو بزارید اینطوری بهتره. (10 سال پیش)
0 0
من روش بدون سرور رو امتحان کردم و بازم گفتن که میشه هک کرد. بهترین کار استفاده از سرور هست. خیلی ساده تر از چیزیه که تصور میکنید و دیگه خیالتون راحته :) (10 سال پیش)
0 0
Rabbit جان خوب چه طوریه؟ (10 سال پیش)
0 0
دوستان کسی اموزش کامل استفاده از سرور در پرداخت درون برنامه ای را داره؟ ممنون می شم لینک بزاره. (10 سال پیش)
0 0
سلام دوستان من یه سالی هست که از بچه های این سایت خیلی چیزا یادگرفتم و به تازگی هم به جمع شما دوستان اضافه شدم از Rabbit عزیز هم به نمایندگی از دوستان درخواست میکنم لطفا روش درون پرداختی اموزش بدن (10 سال پیش)
 برای این سوال 1 پاسخ وجود دارد.
پاسخ به سوال 
دانیال  10 سال پیش
+1 0

import android.app.*;
import android.content.*;
import android.os.*;
import android.view.*;
import android.view.View.*;
import android.widget.*;
import com.android.vending.billing.*;
import com.util.*;
import com.util.IabHelper.*;
import java.util.*;


import com.android.vending.billing.IInAppBillingService.*;
public class pro extends Activity {


    protected static final int BUY_REQUEST_CODE = 12345;

    private IabHelper buyHelper;

    private Button butBuy;
	public boolean premium;

//	Getting the Price for the In-App SKU
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.pro);
		


        butBuy = (Button) findViewById(R.id.button_buy);


	

//		[...]

		// Initially, disable the "buy me" button
		butBuy.setEnabled(false);

		
		buyHelper = new IabHelper(this,Billing. PUBLIC_KEY);
		buyHelper.startSetup(new OnIabSetupFinishedListener() {
				@Override
				public void onIabSetupFinished(IabResult result) {
					if(result.isSuccess()) {
						// Fill a list of SKUs that we want the price infos for
						// (SKU = "stockable unit" = buyable things)
						ArrayList<String> moreSkus = new ArrayList<String>();
						moreSkus.add(Billing.SKU_NAME_PREMIUM);

						// We initialize the price field with a "retrieving price" message while we wait 
						// for the price
						final TextView tvPrice = (TextView) findViewById(R.id.price);
						tvPrice.setText("درحال دریافت قیمت");

						// Start the query for the details for the SKUs. This runs asynchronously, so
						// it may be that the price appears a bit later after the rest of the Activity is shown.
						buyHelper.queryInventoryAsync(true, moreSkus, new QueryInventoryFinishedListener() {
								@Override
								public void onQueryInventoryFinished(IabResult result, Inventory inv) {
									if(result.isSuccess()) {
										
								
										// If we successfully got the price, show it in the text field
										SkuDetails details = inv.getSkuDetails(Billing.SKU_NAME_PREMIUM);
										String price = details.getPrice();

										tvPrice.setText(price);

										// On successful init and price getting, enable the "buy me" button
										butBuy.setEnabled(true);
									} else {
										// Error getting the price... show a sorry text in the price field now
										tvPrice.setText("قیمت دریافت نشد");
										//
										butBuy.setEnabled(true);
										//
									}
								}
						
								
							});
					}
				}
			});

//		[...]
//Buying an In-App Item
//		[...]

		butBuy.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					

					
					
					// Disable the button after the click to prevent double clicks
					butBuy.setEnabled(false);

					// Start the purchase flow
					buyHelper.launchPurchaseFlow(pro.this,
						Billing.SKU_NAME_PREMIUM, BUY_REQUEST_CODE,
						new OnIabPurchaseFinishedListener() {
							@Override
							public void onIabPurchaseFinished(IabResult result, Purchase info) {
								if (result.isSuccess()) {
									// Successful - the item has been payed for
									

									
									// We set a vale in the shared preferences to mark this app as
									SharedPreferences shared = getSharedPreferences("Prefs", MODE_PRIVATE);
									SharedPreferences.Editor editor = shared.edit();
									editor.putBoolean(Billing.KEY_PREMIUM_VERSION, true);
									editor.apply();

								
									//
									// The flag "CLEAR_TASK" is important, so the user is not sent
									// back to this buy activity when he presses the back button.
									//
									Toast.makeText(getBaseContext(), "با تشکر از خرید شما",Toast.LENGTH_SHORT).show();
									Intent intentz = new Intent(
                                        pro.this,
                                        MainActivity.class);
									intentz.setFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
													| Intent.FLAG_ACTIVITY_NEW_TASK);

								
									startActivity(intentz);
								}
						
							}
						});
				}
			});
	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		// Delegate the answer from the purchase request to the buying helper - necessary
		// to let it handle the answers from the backend
		buyHelper.handleActivityResult(requestCode, resultCode, data);
	}

//Don’t forget to cleanup after 
//ourselves when the BuyActivity ends:

	@Override
	protected void onDestroy() {
		super.onDestroy();
		buyHelper.dispose();
	}
    
}
			

 

0 0
من این کد رو وارد اکلیپس کردم ولی نیاز یه کلاس Billing دارد ممنون میشم راهنمایی کنید (10 سال پیش)
0 0
کلاس billing خدمت شما دوست عزیز public class Billing { public static final String SKU_active="sms"; public static final String PUBLIC_KEY = "MIHNMA0GCSqGSIb3DQEBAQUAA4G7ADCBtwKBrwDs5LBp8Gf9KVbSKbs8dVmrz4dKUnPiO45IfYPzZ4mC4JIKOxxMBi+vcyPU6D14ykMFquJH29uI/m6r9+GNcHheIldhtLb1o7c5aEI+sceDkR8e9gOsCJjPp4Uyg2MWMBkB8jVwbdUCzw/ZZQBbrOb6sNekGtZaSgU8xeG3YUb+2/iu3OWbs7mJ2C+1Q9LX1VSTrb1atOFVv7kt1GSDEfd35xZtIyxcb2/UorOxLRMCAwEAAQ=="; } (10 سال پیش)

پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .