Skip to content

Commit

Permalink
Release 1.14.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adyen-git-manager committed Dec 7, 2017
1 parent a6ffee5 commit 8840ce5
Show file tree
Hide file tree
Showing 32 changed files with 657 additions and 203 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This README provides the usage manual for the SDK itself. For the full documenta
To integrate the Adyen SDK into your project, import the **core**, **utils** and **ui** module by adding the following lines to your build.gradle file.

```
compile 'com.adyen.checkout:core:1.13.0'
compile 'com.adyen.checkout:utils:1.13.0'
compile 'com.adyen.checkout:ui:1.13.0'
compile 'com.adyen.checkout:cardscan:1.13.0'
compile 'com.adyen.checkout:core:1.14.1'
compile 'com.adyen.checkout:utils:1.14.1'
compile 'com.adyen.checkout:ui:1.14.1'
compile 'com.adyen.checkout:cardscan:1.14.1'
```

> For implementing Custom integration, only the **core** module is required. However, you might also want to include the **utils** module to use Adyen's utility methods such as Luhn check, credit card type detection, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static String getToken(final Context context, final PaymentStateHandler paymentS
Settings.Secure.ANDROID_ID);
deviceInfo.put("deviceFingerprintVersion", DEVICE_FINGER_PRINT_VERSION);
deviceInfo.put("platform", "android");
deviceInfo.put("apiVersion", "4");
deviceInfo.put("apiVersion", "6");
deviceInfo.put("osVersion", Build.VERSION.SDK_INT);
deviceInfo.put("sdkVersion", SDK_VERSION);
deviceInfo.put("deviceIdentifier", androidId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PaymentStateHandler implements State.StateChangeListener {
private static final String REDIRECT_RESPONSE = "redirect";
private static final String COMPLETE_RESPONSE = "complete";
private static final String ERROR_RESPONSE = "error";
private static final String VALIDATION_RESPONSE = "validation";
private static final String URL_JSON_KEY = "url";
private static final String ANDROID_PAY_TOKEN_PROVIDED = "com.adyen.androidpay.ui.AndroidTokenProvided";

Expand Down Expand Up @@ -298,7 +299,7 @@ public void onSuccess(@NonNull final byte[] response) {
} else if (COMPLETE_RESPONSE.equals(type)) {
paymentResult = new PaymentRequestResult(new Payment(responseJson));
paymentProcessorStateMachine.onTrigger(PaymentTrigger.PAYMENT_RESULT_RECEIVED);
} else if (ERROR_RESPONSE.equals(type)) {
} else if (ERROR_RESPONSE.equals(type) || VALIDATION_RESPONSE.equals(type)) {
Log.w(TAG, "Payment failed: " + responseJson.toString());
paymentErrorThrowable = new PostResponseFormatException(
responseJson.getString("errorMessage"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ public void onIssuerSelected(String issuer) {
final PaymentMethod paymentMethod = (PaymentMethod) bundle.getSerializable(PAYMENT_METHOD);

SepaDirectDebitFragment sepaDirectDebitFragment = new SepaDirectDebitFragmentBuilder()
.setPaymentMethod(paymentMethod)
.setAmount((Amount) intent.getSerializableExtra(AMOUNT))
.setSEPADirectDebitPaymentDetailsListener(new SepaDirectDebitFragment.SEPADirectDebitPaymentDetailsListener() {
@Override
Expand Down Expand Up @@ -272,9 +273,11 @@ public void onPaymentDetails(String countryCode, String telephoneNumber) {
break;
}
case GIROPAY_FRAGMENT: {
final PaymentMethod paymentMethod = (PaymentMethod) bundle.getSerializable(PAYMENT_METHOD);
final GiropayFragment giropayFragment = new GiropayFragment();

Bundle giroPayBundle = new Bundle();
giroPayBundle.putSerializable(PAYMENT_METHOD, paymentMethod);
giroPayBundle.putSerializable(AMOUNT, intent.getSerializableExtra(AMOUNT));
giropayFragment.setArguments(giroPayBundle);
replaceFragment(giropayFragment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public void onClick(View v) {

final TextView checkoutTextView = (TextView) fragmentView.findViewById(R.id.amount_text_view);
final String amountString = AmountUtil.format(amount, true, StringUtils.getLocale(getActivity()));
final String checkoutString = getString(R.string.pay_with_amount, amountString);
final String checkoutString = getString(R.string.payButton_formatted, amountString);
checkoutTextView.setText(checkoutString);
AdyenInputValidator validator = new AdyenInputValidator();
validator.setOnReadyStateChangedListener(new AdyenInputValidator.OnReadyStateChangedListener() {
Expand Down Expand Up @@ -367,7 +367,7 @@ public void onClick(final View view) {
});

if (getActivity() instanceof CheckoutActivity) {
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.title_card_details);
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.creditCard_title);
}
return fragmentView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.adyen.core.internals.HttpClient;
import com.adyen.core.models.Amount;
import com.adyen.core.models.PaymentMethod;
import com.adyen.core.utils.AmountUtil;
import com.adyen.core.utils.StringUtils;
import com.adyen.ui.R;
Expand Down Expand Up @@ -55,12 +56,14 @@ public final class GiropayFragment extends Fragment {

private GiroPayLookUpASyncTask lookupAsyncTask = null;

private PaymentMethod paymentMethod;
private Amount amount;

@Override
public void setArguments(Bundle args) {
super.setArguments(args);
amount = (Amount) args.get(CheckoutActivity.AMOUNT);
paymentMethod = (PaymentMethod) args.get(CheckoutActivity.PAYMENT_METHOD);
}

@Nullable
Expand All @@ -79,15 +82,15 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,

TextView amountTextView = (TextView) fragmentView.findViewById(R.id.amount_text_view);
final String amountLocalized = AmountUtil.format(amount, true, StringUtils.getLocale(getActivity()));
final String amountString = getString(R.string.pay_with_amount, amountLocalized);
final String amountString = getString(R.string.payButton_formatted, amountLocalized);
amountTextView.setText(amountString);

loadingView = fragmentView.findViewById(R.id.loading_icon_view);
payButton = (Button) fragmentView.findViewById(R.id.pay_giropay_button);
exampleView = fragmentView.findViewById(R.id.giropay_example_layout);

if (getActivity() instanceof CheckoutActivity) {
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.title_giropay);
((CheckoutActivity) getActivity()).setActionBarTitle(paymentMethod != null ? paymentMethod.getName() : "");
}
return fragmentView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void onGlobalLayout() {
}

if (getActivity() instanceof CheckoutActivity) {
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.title_payment_methods);
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.paymentMethods_title);
}

return fragmentView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ public void onClick(View v) {

final TextView amountTextview = (TextView) fragmentView.findViewById(R.id.amount_text_view);
final String valueString = AmountUtil.format(amount, true, StringUtils.getLocale(getActivity()));
final String amountString = getString(R.string.pay_with_amount, valueString);
final String amountString = getString(R.string.payButton_formatted, valueString);
amountTextview.setText(amountString);

if (getActivity() instanceof CheckoutActivity) {
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.title_qiwi_wallet);
((CheckoutActivity) getActivity()).setActionBarTitle(paymentMethod.getName());
}

return fragmentView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.widget.TextView;

import com.adyen.core.models.Amount;
import com.adyen.core.models.PaymentMethod;
import com.adyen.core.utils.AmountUtil;
import com.adyen.core.utils.StringUtils;
import com.adyen.ui.R;
Expand All @@ -29,6 +30,8 @@
*/
public class SepaDirectDebitFragment extends Fragment {

private PaymentMethod paymentMethod;

private Amount amount;

private int theme;
Expand All @@ -50,6 +53,9 @@ public interface SEPADirectDebitPaymentDetailsListener {
@Override
public void setArguments(Bundle args) {
super.setArguments(args);

paymentMethod = (PaymentMethod) args.get(CheckoutActivity.PAYMENT_METHOD);

amount = (Amount) args.get(CheckoutActivity.AMOUNT);

theme = args.getInt("theme");
Expand Down Expand Up @@ -107,11 +113,11 @@ public void onReadyStateChanged(boolean isReady) {

final TextView amountTextview = (TextView) fragmentView.findViewById(R.id.amount_text_view);
final String valueString = AmountUtil.format(amount, true, StringUtils.getLocale(getActivity()));
final String amountString = getString(R.string.pay_with_amount, valueString);
final String amountString = getString(R.string.payButton_formatted, valueString);
amountTextview.setText(amountString);

if (getActivity() instanceof CheckoutActivity) {
((CheckoutActivity) getActivity()).setActionBarTitle(R.string.title_sepa);
((CheckoutActivity) getActivity()).setActionBarTitle(paymentMethod.getName());
}

return fragmentView;
Expand Down
4 changes: 2 additions & 2 deletions adyen-ui/src/main/java/com/adyen/ui/views/CVCDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected void onCreate(Bundle savedInstanceState) {
final TextView cvcHintTextView = ((TextView) findViewById(R.id.extended_cvc_hint_textview));
final String cardName = paymentMethod.getName().replaceAll(" ", "\u00A0"); //replace whitespace
// in "**** 1234" with non-breakable whitespace
final String cvcHint = getContext().getString(R.string.cvc_extended_hint_with_last_digits, cardName);
final String cvcHint = getContext().getString(R.string.creditCard_oneClickVerification_message, cardName);
cvcHintTextView.setText(cvcHint);

final CVCEditText cvcEditText = (CVCEditText) findViewById(R.id.adyen_credit_card_cvc);
Expand All @@ -75,7 +75,7 @@ public void onClick(View v) {
AdyenInputValidator validator = new AdyenInputValidator();
final Button checkoutButton = (Button) findViewById(R.id.button_confirm_cvc_verification);
String amountStr = AmountUtil.format(amount, true, StringUtils.getLocale(activity));
final String amountString = getContext().getString(R.string.pay_with_amount, amountStr);
final String amountString = getContext().getString(R.string.payButton_formatted, amountStr);
checkoutButton.setText(amountString);
checkoutButton.setEnabled(false);
validator.setOnReadyStateChangedListener(new AdyenInputValidator.OnReadyStateChangedListener() {
Expand Down
20 changes: 10 additions & 10 deletions adyen-ui/src/main/res/layout/credit_card_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="@string/card_number"
android:text="@string/creditCard_numberField_title"
android:id="@+id/credit_card_no_label"
android:textSize="12sp" />

Expand All @@ -73,7 +73,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/hint_card_number"
android:hint="@string/creditCard_numberField_placeholder"
android:inputType="phone"
android:focusable="true"
android:gravity="center_vertical"
Expand Down Expand Up @@ -112,7 +112,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/expiry_date"
android:text="@string/creditCard_expiryDateField_title"
android:id="@+id/credit_card_exp_date_label"
android:textSize="12sp" />

Expand All @@ -121,7 +121,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:inputType="phone"
android:hint="@string/hint_expiry_date"
android:hint="@string/creditCard_expiryDateField_placeholder"
android:layout_marginRight="15dp"
android:nextFocusDown="@+id/adyen_credit_card_cvc" />

Expand All @@ -144,7 +144,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cvc_cvv"
android:text="@string/creditCard_cvcField_title"
android:id="@+id/credit_card_cvc_label"
android:layout_gravity="left"
android:textSize="12sp" />
Expand All @@ -153,7 +153,7 @@
android:id="@+id/adyen_credit_card_cvc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_cvc_cvv"
android:hint="@string/creditCard_cvcField_placeholder"
android:inputType="phone"
android:gravity="left" />

Expand All @@ -175,15 +175,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/cardholder_name"
android:text="@string/creditCard_holderName"
android:id="@+id/card_holder_name_label"
android:textSize="12sp" />

<com.adyen.ui.views.CardHolderEditText
android:id="@+id/credit_card_holder_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_cardholder_name"
android:hint="@string/creditCard_holderName_placeholder"
android:inputType="textCapWords|textNoSuggestions"
android:focusable="true" />
</LinearLayout>
Expand All @@ -202,7 +202,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/card_number_of_installments"
android:text="@string/creditCard_installmentsField"
android:id="@+id/installments_label"
android:textSize="12sp" />

Expand Down Expand Up @@ -235,7 +235,7 @@

<TextView
android:layout_alignParentLeft="true"
android:text="@string/remember_card_hint"
android:text="@string/creditCard_storeDetailsButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

Expand Down
12 changes: 6 additions & 6 deletions adyen-ui/src/main/res/layout/cvc_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:paddingTop="10dp"
android:textColor="@color/black_text"
android:layout_gravity="center_horizontal"
android:text="@string/title_verify_card"
android:text="@string/creditCard_oneClickVerification_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

Expand All @@ -29,7 +29,7 @@
android:paddingRight="10dp"
android:textSize="18sp"
android:gravity="center"
android:text="@string/cvc_extended_hint_with_last_digits"
android:text="@string/creditCard_oneClickVerification_message"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
Expand All @@ -44,7 +44,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cvc_cvv"
android:text="@string/creditCard_cvcField_title"
android:id="@+id/credit_card_cvc_label"
android:layout_gravity="left"
android:textSize="12sp" />
Expand All @@ -56,7 +56,7 @@
android:id="@+id/adyen_credit_card_cvc"
android:paddingRight="50dp"
android:layout_width="wrap_content"
android:hint="@string/hint_cvc_cvv"
android:hint="@string/creditCard_cvcField_placeholder"
android:layout_height="wrap_content" />

</LinearLayout>
Expand All @@ -83,7 +83,7 @@
android:id="@+id/button_cancel_cvc_verification"
android:background="@android:color/transparent"
android:textColor="@color/hint_text_color"
android:text="@string/cancel_button"
android:text="@string/cancelButton"
android:textSize="18sp"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Expand All @@ -93,7 +93,7 @@
android:paddingTop="0.5dp"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:id="@+id/button_confirm_cvc_verification"
android:text="@string/pay_with_amount"
android:text="@string/payButton_formatted"
android:layout_gravity="right"
android:textSize="18sp"
android:layout_weight="0.5"
Expand Down
6 changes: 3 additions & 3 deletions adyen-ui/src/main/res/layout/giropay_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="@string/giropay_search_field_hint"
android:text="@string/giropay_searchField_placeholder"
android:id="@+id/credit_card_no_label"
android:textSize="12sp" />

<com.adyen.ui.views.GiroPayEditText
android:id="@+id/adyen_giropay_lookup_edit_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/min_3_chars"
android:hint="@string/giropay_minimumLength"
android:inputType="textCapWords|textNoSuggestions"
android:drawablePadding="12dp"
android:gravity="center_vertical" />
Expand All @@ -103,7 +103,7 @@
android:layout_height="wrap_content" />
<TextView
android:layout_marginTop="4dp"
android:text="@string/giropay_example"
android:text="@string/giropay_searchField_placeholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
Expand Down
Loading

0 comments on commit 8840ce5

Please sign in to comment.