PaymentMethods
in package
Payment methods resource for saving and verifying customer payment instruments.
Payment methods store customer payment details for future use. Tokenize mobile money wallets, verify ownership, and charge saved methods without re-collecting details. Essential for subscription billing and returning customer checkout flows.
Tags
Table of Contents
Methods
- __construct() : mixed
- activate() : PaymentMethod
- archive() : PaymentMethod
- confirmVerification() : PaymentMethod
- Complete payment method verification using customer-provided OTP.
- deactivate() : PaymentMethod
- delete() : PaymentMethodDeletion
- Remove a saved payment method, preventing future charges.
- disactivate() : PaymentMethod
- lookup() : PaymentMethod
- Retrieve details of a saved payment method.
- page() : PaymentMethodPage
- Retrieve a paginated list of payment methods.
- settings() : PaymentMethodSettings
- Retrieve payment method configuration and capabilities.
- tokenize() : PaymentMethod
- Save a payment method for future use without charging it.
- unarchive() : PaymentMethod
- update() : PaymentMethod
- Update mutable payment method metadata and state.
- verify() : PaymentMethodVerificationSession
- Initiate verification of a saved payment method.
Methods
__construct()
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
activate()
public
activate(string $paymentMethodId) : PaymentMethod
Parameters
- $paymentMethodId : string
Return values
PaymentMethodarchive()
public
archive(string $paymentMethodId) : PaymentMethod
Parameters
- $paymentMethodId : string
Return values
PaymentMethodconfirmVerification()
Complete payment method verification using customer-provided OTP.
public
confirmVerification(array<string|int, mixed> $payload) : PaymentMethod
Submits the verification code to confirm payment method ownership. Once verified, the payment method can be charged without customer confirmation (frictionless charging).
Parameters
- $payload : array<string|int, mixed>
-
Verification parameters
- payment_method_id: string - Payment method being verified (required)
- token: string - OTP code provided by customer (required, typically 6 digits)
Tags
Return values
PaymentMethod —Verified payment method
deactivate()
public
deactivate(string $paymentMethodId) : PaymentMethod
Parameters
- $paymentMethodId : string
Return values
PaymentMethoddelete()
Remove a saved payment method, preventing future charges.
public
delete(string $paymentMethodId[, array<string|int, mixed> $requestMeta = [] ]) : PaymentMethodDeletion
Deletes the payment method from customer's saved instruments. Use this when customers remove payment methods from their account or when payment details become invalid. Deletion is permanent and cannot be undone.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method to delete (required)
- $requestMeta : array<string|int, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
PaymentMethodDeletion —Confirmation of deletion
disactivate()
public
disactivate(string $paymentMethodId) : PaymentMethod
Parameters
- $paymentMethodId : string
Return values
PaymentMethodlookup()
Retrieve details of a saved payment method.
public
lookup(string $paymentMethodId) : PaymentMethod
Returns full payment method information including type, masked details (e.g., last 4 digits), verification status, and associated customer. Use this to display saved payment methods to customers or check verification state before charging.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method to retrieve (required)
Tags
Return values
PaymentMethod —Complete payment method object
page()
Retrieve a paginated list of payment methods.
public
page([array<string|int, mixed> $payload = [] ]) : PaymentMethodPage
Parameters
- $payload : array<string|int, mixed> = []
Return values
PaymentMethodPagesettings()
Retrieve payment method configuration and capabilities.
public
settings() : PaymentMethodSettings
Returns the current payment method settings for your application, including supported payment types, verification requirements, and other configuration details.
Tags
Return values
PaymentMethodSettings —Payment method settings
tokenize()
Save a payment method for future use without charging it.
public
tokenize(array<string|int, mixed> $payload) : PaymentMethod
Tokenizes payment details and associates them with a customer. The payment method can be charged later without re-collecting details. Currently supports mobile money wallets. Optionally trigger verification immediately after tokenization.
Parameters
- $payload : array<string|int, mixed>
-
Tokenization parameters
- customer_id: string - Customer who will own this payment method (required)
- payment_method_data: array - Payment details to tokenize (required)
- verify_immediately: bool - Send verification OTP right after tokenization (default: false)
Tags
Return values
PaymentMethod —Tokenized payment method
unarchive()
public
unarchive(string $paymentMethodId) : PaymentMethod
Parameters
- $paymentMethodId : string
Return values
PaymentMethodupdate()
Update mutable payment method metadata and state.
public
update(array<string|int, mixed> $payload) : PaymentMethod
Parameters
- $payload : array<string|int, mixed>
Return values
PaymentMethodverify()
Initiate verification of a saved payment method.
public
verify(string $paymentMethodId[, array<string|int, mixed> $requestMeta = [] ]) : PaymentMethodVerificationSession
Sends an OTP to the payment method (e.g., SMS to mobile money number) to verify customer ownership. After verification, the payment method can be charged without requiring customer confirmation on each transaction.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method to verify (required)
- $requestMeta : array<string|int, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
PaymentMethodVerificationSession —Payment method with verification status