PCI DSS is a security standard that applies to all organizations processing payment cards: merchants, processing centers, financial institutions and service providers, as well as other organizations that store, process or transmit cardholder data and / or critical authentication data .
The PA-DSS standard applies to application providers and other application developers who store, process, or transmit cardholder data and / or critical authentication data.
Category 3. Payment applications that work on any household handheld devices (for example, smartphones, tablets, PDAs), whose functionality is limited not only by accepting payments.
PCI DSS may not be distributed directly to payment application providers if they do not store, process or transfer cardholder data, or do not have access to cardholder data for their customers.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp"> <ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/btn_amount" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/lbl_amount" /> <EditText android:id="@+id/edit_amount" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:maxLength="7" android:inputType="number" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:text="@string/lbl_ccy" /> <Spinner android:id="@+id/spinner_ccy" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:text="@string/lbl_email" /> <EditText android:id="@+id/edit_email" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:inputType="textEmailAddress" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" android:text="@string/lbl_description" /> <EditText android:id="@+id/edit_description" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="7dp" /> <com.cloudipsp.android.CardInputView android:id="@+id/card_input" android:layout_width="match_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/text_card_type" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:visibility="gone" /> <Button android:id="@+id/btn_pay" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:gravity="center" android:text="@string/btn_pay" /> </LinearLayout> </ScrollView> <com.cloudipsp.android.CloudipspWebView android:id="@+id/web_view" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="gone"/> </RelativeLayout>
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); findViewById(R.id.btn_amount).setOnClickListener(this); editAmount = (EditText) findViewById(R.id.edit_amount); spinnerCcy = (Spinner) findViewById(R.id.spinner_ccy); editEmail = (EditText) findViewById(R.id.edit_email); editDescription = (EditText) findViewById(R.id.edit_description); cardInput = (CardInputView) findViewById(R.id.card_input); cardInput.setHelpedNeeded(BuildConfig.DEBUG); findViewById(R.id.btn_pay).setOnClickListener(this); webView = (CloudipspWebView) findViewById(R.id.web_view); cloudipsp = new Cloudipsp(MERCHANT_ID, webView); spinnerCcy.setAdapter(new ArrayAdapter<Currency>(this, android.R.layout.simple_spinner_item, Currency.values())); }
@Override public void onCardInputErrorClear(CardInputView view, EditText editText) { } @Override public void onCardInputErrorCatched(CardInputView view, EditText editText, String error) { editText.getText(); }
if (card != null) { final Currency currency = (Currency) spinnerCcy.getSelectedItem(); final Order order = new Order(amount, currency, "vb_" + System.currentTimeMillis(), description, email); cloudipsp.pay(card, order, new Cloudipsp.PayCallback() { @Override public void onPaidProcessed(Receipt receipt) { Toast.makeText(MainActivity.this, "Paid " + receipt.status.name() + "\nPaymentId:" + receipt.paymentId+"\n Signature:"+receipt.signature, Toast.LENGTH_LONG).show(); } @Override public void onPaidFailure(Cloudipsp.Exception e) { if (e instanceof Cloudipsp.Exception.Failure) { Cloudipsp.Exception.Failure f = (Cloudipsp.Exception.Failure) e; Toast.makeText(MainActivity.this, "Failure\nErrorCode: " + f.errorCode + "\nMessage: " + f.getMessage() + "\nRequestId: " + f.requestId, Toast.LENGTH_LONG).show(); } else if (e instanceof Cloudipsp.Exception.NetworkSecurity) { Toast.makeText(MainActivity.this, "Network security error: " + e.getMessage(), Toast.LENGTH_LONG).show(); } else if (e instanceof Cloudipsp.Exception.ServerInternalError) { Toast.makeText(MainActivity.this, "Internal server error: " + e.getMessage(), Toast.LENGTH_LONG).show(); } else if (e instanceof Cloudipsp.Exception.NetworkAccess) { Toast.makeText(MainActivity.this, "Network error", Toast.LENGTH_LONG).show(); } else { Toast.makeText(MainActivity.this, "Payment Failed", Toast.LENGTH_LONG).show(); } e.printStackTrace(); } }); }
Source: https://habr.com/ru/post/304650/
All Articles