Use Payload.submit
and Input
to build and submit a simple and secure payment form in your app.
<co.payload.android.Input
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:tag="pl:card"/>
Add any co.payload.android.Input
fields used in collecting payment details into your layout.
The android:tag
attribute can be any payment or payment method field, prefixed
with "pl:"
.
Payload.submit(view, new pl.Payment(){{
set("amount", 10.0);
}}).processed((pl.Payment pmt) -> {
handleSuccess(pmt);
}).error((Exception err) -> {
handleError(err);
});
/* iOS payment form coming soon */
/* iOS payment form coming soon */
To submit the form, create a button or trigger that will call the Payload.submit
function. The Payload.submit
accepts the view that contains the active inputs as
the first parameter and a Payload.Payment
object with additional
transaction details for the request as a second parameter.