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
- Creates the payment methods resource client.
- activate() : PaymentMethod
- Activates the payment method.
- archive() : PaymentMethod
- Archives the payment method.
- confirmVerification() : PaymentMethod
- Complete payment method verification using customer-provided OTP.
- deactivate() : PaymentMethod
- Deactivates the payment method.
- delete() : Deletion
- Remove a saved payment method, preventing future charges.
- disactivate() : PaymentMethod
- Deactivates the payment method.
- lookup() : PaymentMethod
- Retrieve details of a saved payment method.
- page() : Page
- Retrieve a paginated list of payment methods.
- settings() : Settings
- Retrieve payment method configuration and capabilities.
- tokenize() : PaymentMethod
- Save a payment method for future use without charging it.
- unarchive() : PaymentMethod
- Restores the archived payment method.
- update() : PaymentMethod
- Update mutable payment method metadata and state.
- verify() : VerificationSession
- Initiate verification of a saved payment method.
Methods
__construct()
Creates the payment methods resource client.
public
__construct(HttpClient $http) : mixed
Parameters
- $http : HttpClient
-
Shared authenticated HTTP transport used by this resource client.
activate()
Activates the payment method.
public
activate(string $paymentMethodId) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method.
Return values
PaymentMethod —The activated payment method.
archive()
Archives the payment method.
public
archive(string $paymentMethodId) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method.
Return values
PaymentMethod —The archived payment method.
confirmVerification()
Complete payment method verification using customer-provided OTP.
public
confirmVerification(array<string, 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, 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()
Deactivates the payment method.
public
deactivate(string $paymentMethodId) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method.
Return values
PaymentMethod —The deactivated payment method.
delete()
Remove a saved payment method, preventing future charges.
public
delete(string $paymentMethodId[, array<string, mixed> $requestMeta = [] ]) : Deletion
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, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
Deletion —Confirmation of deletion
disactivate()
Deactivates the payment method.
public
disactivate(string $paymentMethodId) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method.
Return values
PaymentMethod —The resulting payment method.
lookup()
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, mixed> $payload = [] ]) : Page
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed> = []
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
Page —A typed page of matching payment methods.
settings()
Retrieve payment method configuration and capabilities.
public
settings() : Settings
Returns the current payment method settings for your application, including supported payment types, verification requirements, and other configuration details.
Tags
Return values
Settings —Payment method settings
tokenize()
Save a payment method for future use without charging it.
public
tokenize(array<string, 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, 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()
Restores the archived payment method.
public
unarchive(string $paymentMethodId) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $paymentMethodId : string
-
Unique identifier of the payment method.
Return values
PaymentMethod —The resulting payment method.
update()
Update mutable payment method metadata and state.
public
update(array<string, mixed> $payload) : PaymentMethod
Sends the documented request through the shared authenticated transport and hydrates the successful response into the declared return type.
Parameters
- $payload : array<string, mixed>
-
Request fields keyed by the documented
snake_caseAPI names.
Return values
PaymentMethod —The updated payment method.
verify()
Initiate verification of a saved payment method.
public
verify(string $paymentMethodId[, array<string, mixed> $requestMeta = [] ]) : VerificationSession
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, mixed> = []
-
Request controls such as idempotency_key (optional)
Tags
Return values
VerificationSession —Payment method with verification status