Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Alipay PaymentMethod public #2692

Merged
merged 6 commits into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# CHANGELOG

## 16.0.0 - unreleased
* [#2671](https://github.com/stripe/stripe-android/pull/2671) Add cardParams property to CardInputWidget and CardMultilineWidget
* [#2675](https://github.com/stripe/stripe-android/pull/2675) Add CardParams methods to Stripe class
* [#2677](https://github.com/stripe/stripe-android/pull/2677) Deprecate Card.create()
* See `MIGRATING.md` for more details
* [#2692](https://github.com/stripe/stripe-android/pull/2692) Make Alipay PaymentMethod public
* [#2696](https://github.com/stripe/stripe-android/pull/2696) Upgrade to Gradle v6.6

## 15.0.2 - 2020-08-03
* [#2666](https://github.com/stripe/stripe-android/pull/2666) Bump 3DS2 SDK to `4.0.4`
* [#2671](https://github.com/stripe/stripe-android/pull/2671) Add `cardParams` property to `CardInputWidget` and `CardMultilineWidget`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import com.stripe.android.model.PaymentIntent
* }
* </pre>
*/
internal interface AlipayAuthenticator {
interface AlipayAuthenticator {
@WorkerThread
fun onAuthenticationRequest(data: String): Map<String, String>
}
2 changes: 1 addition & 1 deletion stripe/src/main/java/com/stripe/android/Stripe.kt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Stripe internal constructor(
* @param callback a [ApiResultCallback] to receive the result or error
*/
@JvmOverloads
internal fun confirmAlipayPayment(
fun confirmAlipayPayment(
confirmPaymentIntentParams: ConfirmPaymentIntentParams,
authenticator: AlipayAuthenticator,
stripeAccountId: String? = this.stripeAccountId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ data class ConfirmPaymentIntentParams internal constructor(
* process
*/
@JvmStatic
internal fun createAlipay(
fun createAlipay(
clientSecret: String
): ConfirmPaymentIntentParams {
return ConfirmPaymentIntentParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ data class PaymentMethodCreateParams internal constructor(

@JvmSynthetic
@JvmOverloads
internal fun createAlipay(
fun createAlipay(
metadata: Map<String, String>? = null
): PaymentMethodCreateParams {
return PaymentMethodCreateParams(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,10 @@ class PaymentMethodEndToEndTest {

@Test
fun createPaymentMethod_withAlipay_shouldCreateObject() {
val repository = StripeApiRepository(
context,
ApiKeyFixtures.ALIPAY_PUBLISHABLE_KEY,
apiVersion = "2020-03-02;alipay_beta=v1"
)

val paymentMethod = repository.createPaymentMethod(
PaymentMethodCreateParams.createAlipay(),
ApiRequest.Options(ApiKeyFixtures.ALIPAY_PUBLISHABLE_KEY)
)
val params = PaymentMethodCreateParams.createAlipay()
val paymentMethod =
Stripe(context, ApiKeyFixtures.ALIPAY_PUBLISHABLE_KEY)
.createPaymentMethodSynchronous(params)
assertThat(paymentMethod?.type)
.isEqualTo(PaymentMethod.Type.Alipay)
}
Expand Down