Skip to content

Commit

Permalink
Update Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ioan-ghisoi-cko committed Nov 15, 2018
1 parent 5bbabf9 commit 026c57d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;

import com.android.volley.VolleyError;
import com.checkout.android_sdk.CheckoutAPIClient;
import com.checkout.android_sdk.PaymentForm.PaymentFormCallback;
import com.checkout.android_sdk.Models.BillingModel;
import com.checkout.android_sdk.Models.PhoneModel;
import com.checkout.android_sdk.PaymentForm;
import com.checkout.android_sdk.Request.CardTokenisationRequest;
import com.checkout.android_sdk.PaymentForm.PaymentFormCallback;
import com.checkout.android_sdk.Response.CardTokenisationFail;
import com.checkout.android_sdk.Response.CardTokenisationResponse;
import com.checkout.android_sdk.Utils.CardUtils.Cards;
import com.checkout.android_sdk.Utils.Environment;

import java.util.Locale;

import checkout.com.demo.R;

public class CustomisationDemo extends Activity {

private PaymentForm mPaymentForm;
private ProgressDialog mProgressDialog;

// Callback used for the Payment Form interaction
private final PaymentFormCallback mFormListener = new PaymentFormCallback() {
// Callback used for the Payment Form interaction
private final PaymentFormCallback mFormListener = new PaymentFormCallback() {
@Override
public void onFormSubmit() {
mProgressDialog.show(); // show loader
Expand Down Expand Up @@ -61,47 +61,47 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.customisation_activity);

// initialise the loader
mProgressDialog = new ProgressDialog(DemoActivity.this);
mProgressDialog = new ProgressDialog(CustomisationDemo.this);
mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
mProgressDialog.setMessage("Loading...");

// initialise the payment from
mPaymentForm = findViewById(R.id.checkout_card_form);
mPaymentForm
.setFormListener(mFormListener)
.setEnvironment(Environment.SANDBOX)
.setKey("pk_test_6e40a700-d563-43cd-89d0-f9bb17d35e73")
.setAcceptedCard(new Cards[]{Cards.VISA, Cards.MASTERCARD})
.setAcceptedCardsLabel("We accept this card types")
.setCardHolderLabel("Name on Card")
.setCardLabel("Card Number")
.setDateLabel("Expiration Datee")
.setCvvLabel("Security Code")
.setAddress1Label("Address 1")
.setAddress2Label("Address 2")
.setTownLabel("City")
.setStateLabel("State")
.setPostcodeLabel("Zip Code")
.setPhoneLabel("Phone No.")
.setPayButtonText("Pay Now")
.setDoneButtonText("Save")
.setClearButtonText("Clear")
.setDefaultBillingCountry(Locale.UK)
.injectCardHolderName("John Smith")
.injectBilling(
new BillingModel(
"1 address",
"2 address",
"POST CODE",
"GB",
"City",
"State",
new PhoneModel(
"+44",
"07123456789"
)
)
);
.setFormListener(mFormListener)
.setEnvironment(Environment.SANDBOX)
.setKey("pk_test_6e40a700-d563-43cd-89d0-f9bb17d35e73")
.setAcceptedCard(new Cards[]{Cards.VISA, Cards.MASTERCARD})
.setAcceptedCardsLabel("We accept this card types")
.setCardHolderLabel("Name on Card")
.setCardLabel("Card Number")
.setDateLabel("Expiration Datee")
.setCvvLabel("Security Code")
.setAddress1Label("Address 1")
.setAddress2Label("Address 2")
.setTownLabel("City")
.setStateLabel("State")
.setPostcodeLabel("Zip Code")
.setPhoneLabel("Phone No.")
.setPayButtonText("Pay Now")
.setDoneButtonText("Save")
.setClearButtonText("Clear")
.setDefaultBillingCountry(Locale.UK)
.injectCardHolderName("John Smith")
.injectBilling(
new BillingModel(
"1 address",
"2 address",
"POST CODE",
"GB",
"City",
"State",
new PhoneModel(
"+44",
"07123456789"
)
)
);
}

private void displayMessage(String title, String message) {
Expand Down

0 comments on commit 026c57d

Please sign in to comment.