Skip to content

Commit

Permalink
Updated to 1.1 , fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
stoilkov committed Jan 31, 2014
1 parent 5179e2e commit 4fcb868
Show file tree
Hide file tree
Showing 14 changed files with 392 additions and 27 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Android 2.2 (API Level 8).
<dependency>
<groupId>com.paymill.android</groupId>
<artifactId>android-sdk</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>
```

Expand All @@ -48,7 +48,7 @@ repositories {
}
dependencies {
compile 'com.paymill.android:android-sdk:1.0'
compile 'com.paymill.android:android-sdk:1.1'
}
```

Expand Down Expand Up @@ -160,6 +160,10 @@ protected void onDestroy() {

## Release notes

### 1.1
+ Added new method to generate Payments using IBAN and BIC in the [PMFactory](http://paymill.github.io/paymill-android/docs/sdk/reference/com/paymill/android/factory/PMFactory.html) .
* Improved error handling and added additional BRIDGE error type in PMError. You can use this to give the user conrecte information, why his card is rejected.

### 1.0
+ First live release.
+ Added the possiblity to generate tokens without initializing the SDK. The method can be used exactly like the JS-Bridge and does not require extra activation for mobile.
Expand Down
2 changes: 1 addition & 1 deletion samples/vouchermill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you also want to change the layouts of the fragments you can change the pm_cr
#### Reuse Fragments
If you want to use the fragments in your own activity, you have to create them with the `instance` method specifying a valid [Settings](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/PaymentActivity.Settings.html) object. You also have to implement the `startRequest()` callback, that will receive the `PMPaymentMethod` object.
#### Reuse validation logic.
Use the [CreditCardValidator](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/CreditCardValidator.html) and [CardTypeParser](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/CardTypeParser) classes.
Use the [CreditCardValidator](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/CreditCardValidator.html) , [CardTypeParser](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/CardTypeParser) and [IbanBicValidator](http://paymill.github.io/paymill-android/docs/samples/vouchermill/reference/com/paymill/android/payment/IbanBicValidator) classes.

### Work with the PaymentActivity

Expand Down
Binary file removed samples/vouchermill/libs/android-sdk-1.0.jar
Binary file not shown.
Binary file added samples/vouchermill/libs/android-sdk-1.1.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions samples/vouchermill/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.paymill.android.samples</groupId>
<artifactId>vouchermill</artifactId>
<version>1.0-SNAPSHOT</version>
<version>1.1</version>
<packaging>apk</packaging>
<name>VoucherMill</name>

Expand Down Expand Up @@ -40,7 +40,7 @@
<dependency>
<groupId>com.paymill.android</groupId>
<artifactId>android-sdk</artifactId>
<version>1.0</version>
<version>1.1</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion samples/vouchermill/res/layout/pm_credit_card_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:hint="@string/pm_cc_holder_name_hint"
android:inputType="text"
android:inputType="textCapWords"
android:nextFocusDown="@+id/cardNumberText" />

<requestFocus />
Expand Down
90 changes: 90 additions & 0 deletions samples/vouchermill/res/layout/pm_direct_debit_fragment.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:editText="http://schemas.android.com/apk/res/com.paymill.android.samples.vouchermill"
android:id="@+id/fragmentLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/backgroundColor"
android:nextFocusDown="@+id/accountNumberText"
android:orientation="vertical" >

<TextView
android:id="@+id/nameLabel"
style="@style/labelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="@string/pm_dd_account_holder_label" />

<com.paymill.android.payment.CustomEditText
android:id="@+id/nameText"
style="@style/editTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:ems="10"
android:hint="@string/pm_dd_account_holder_hint"
android:inputType="textCapWords"
android:nextFocusDown="@+id/fragmentHolder" />

<TextView
android:id="@+id/accountNumberLabel"
style="@style/labelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="@string/pm_dd_account_number_label" />

<com.paymill.android.payment.CustomEditText
android:id="@+id/accountNumberText"
style="@style/editTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:ems="10"
android:inputType="textCapCharacters"
android:hint="@string/pm_dd_account_number_hint"
android:nextFocusDown="@+id/bankCodeText" />

<requestFocus />

<TextView
android:id="@+id/bankCodeLabel"
style="@style/labelStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:text="@string/pm_dd_bank_code_label" />

<com.paymill.android.payment.CustomEditText
android:id="@+id/bankCodeText"
style="@style/editTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:ems="10"
android:hint="@string/pm_dd_bank_code_hint"
android:inputType="textCapCharacters" />

<Button
android:id="@+id/elv_trigger_btn"
style="@style/buttonStyle"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginRight="5dp"
android:text="@string/pm_dd_trigger_btn_default" />

</LinearLayout>
8 changes: 4 additions & 4 deletions samples/vouchermill/res/layout/pm_payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
android:background="@drawable/pm_switch_button_left"/>

<RadioButton
android:id="@+id/elvButton"
android:id="@+id/directDebitButton"
style="@style/buttonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:button="@null"
android:gravity="center"
android:text="@string/pm_elv_button"
android:text="@string/pm_direct_debit_button"
android:background="@drawable/pm_switch_button_right" />
</RadioGroup>

Expand All @@ -48,8 +48,8 @@
android:layout_height="match_parent" />

<FrameLayout
android:id="@+id/elvLayout"
android:name="com.paymill.android.payment.ElvFragment"
android:id="@+id/directDebitLayout"
android:name="com.paymill.android.payment.DirectDebitFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Expand Down
14 changes: 12 additions & 2 deletions samples/vouchermill/res/values/pm_strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<resources>

<!-- Direct debit -->

<string name="pm_dd_account_holder_label">Holder</string>
<string name="pm_dd_account_holder_hint">Account holder</string>
<string name="pm_dd_account_number_label">IBAN</string>
<string name="pm_dd_account_number_hint">IBAN number</string>
<string name="pm_dd_bank_code_label">BIC</string>
<string name="pm_dd_bank_code_hint">Bank identification code</string>
<string name="pm_invalid_ibanMSG">IBAN is not valid</string>
<string name="pm_invalid_bicMSG">BIC is not valid</string>
<string name="pm_dd_trigger_btn_default">@string/pm_trigger_default</string>
<!-- ELV -->
<string name="pm_elv_account_number_label">Account</string>
<string name="pm_elv_account_number_hint">Account number</string>
Expand All @@ -25,7 +35,7 @@
<string name="pm_emptyMSG">Field cannot be empty</string>
<string name="pm_notAllowedCardMSG">Card type is not supported</string>
<string name="pm_credit_card_button">Credit Card</string>
<string name="pm_elv_button">Direct Debit</string>
<string name="pm_direct_debit_button">Direct Debit</string>
<string name="pm_trigger_payment">Pay</string>
<string name="pm_trigger_preauth">Authorize</string>
<string name="pm_trigger_default">Pay</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
public class CreditCardValidator {

private static final String TAG = "CreditCardValidator";
static boolean valid;

private static boolean validateIsEmpty(String field) {
return TextUtils.isEmpty(field);
Expand All @@ -27,7 +26,7 @@ private static boolean validateIsEmpty(String field) {
public static boolean validate(Context context, EditText name,
EditText creditCardNumber, EditText dateText, EditText checkNumber,
CardType cardType, Collection<CardType> allowedCardTypes) {
valid = true;
boolean valid = true;
valid = validateName(context, name) && valid;
valid = validateCreditCardNumber(context, creditCardNumber, cardType,
allowedCardTypes) && valid;
Expand Down
Loading

0 comments on commit 4fcb868

Please sign in to comment.