ℹ️ This document is a part of WooCommerce Payments Server Requests
The WCPay\Core\Server\Request\Update_Intention
class is used to construct the request for updating an intention.
When creating Update_Intention
requests, the item ID must be provided to the ::create()
method. The identifier should be in the pi_XXX
format.
Parameter | Setter | Immutable | Required | Default value |
---|---|---|---|---|
amount |
set_amount( int $amount ) |
Yes | - | - |
currency |
set_currency_code( string $currency_code ) |
- | - | - |
customer |
set_customer( string $customer_id ) |
- | - | - |
metadata |
set_fingerprint( $fingerprint = '' ) |
- | - | - |
description |
set_metadata( $metadata ) |
- | - | - |
payment_country |
set_payment_country( string $payment_country ) |
- | - | - |
payment_method_options |
set_payment_method_options( array $payment_method_options ) |
- | - | - |
payment_method_types |
set_payment_method_types( array $payment_methods ) |
- | - | - |
setup_future_usage |
setup_future_usage() |
- | - | - |
- Name:
wcpay_update_intention_request
- Arguments:
WC_Order $order
$request = Update_Intention::create( $id );
$request->set_amount( $amount );
$request->set_currency_code( $currency_code );
$request->set_customer( $customer_id );
$request->set_fingerprint( $fingerprint );
$request->set_metadata( $metadata );
$request->set_payment_country( $payment_country );
$request->set_payment_method_options( $payment_method_options );
$request->set_payment_method_types( $payment_methods );
$request->setup_future_usage();
$request->set_hook_args( $order );
$request->send();