CreateCharge

Struct CreateCharge 

Source
pub struct CreateCharge { /* private fields */ }
Expand description

トークンIDまたはカードを保有している顧客IDを指定して支払いを作成します。. テスト用のキーでは、本番用の決済ネットワークへは接続されず、実際の請求が行われることもありません。. 本番用のキーでは、決済ネットワークで処理が行われ、実際の請求が行われます。.

支払いを確定せずに、カードの認証と支払い額のみ確保する場合は、 capturefalse を指定してください。. このとき expiry_days を指定することで、認証の期間を定めることができます。 expiry_days はデフォルトで7日となっており、1日~60日の間で設定が可能です。なお60日に設定した場合、認証期限は59日後の11:59PM(日本時間)までになります。また確保されました与信枠は、expiry_days で設定されました期間を過ぎると解放されるようなっております。.

three_d_secure にtrueを指定することで、3Dセキュアを開始できます。 指定した場合、支払いオブジェクトは作成されますが実際の決済処理は保留された状態になります。. 保留中の支払いは、引数指定の内容に関わらずcapturedfalsecaptured_atnullexpired_atnullと表示されます。. なお、支払い作成から30分を経過すると、3Dセキュアフローはタイムアウトし、処理が進められなくなります。. 3Dセキュアの進め方は、 支払いで3Dセキュアを実施する を参照してください。.

Implementations§

Source§

impl CreateCharge

Source

pub fn new() -> Self

Construct a new CreateCharge.

Source

pub fn amount(self, amount: impl Into<i64>) -> Self

50~9,999,999の整数

Source

pub fn capture(self, capture: impl Into<bool>) -> Self

支払い処理を確定するかどうか

Source

pub fn card(self, card: impl Into<String>) -> Self

トークンIDまたはカードID

Source

pub fn currency(self, currency: impl Into<String>) -> Self

3文字のISOコード(現状 “jpy” のみサポート)

Source

pub fn customer(self, customer: impl Into<String>) -> Self

顧客ID

Source

pub fn description(self, description: impl Into<String>) -> Self

概要

Source

pub fn expiry_days(self, expiry_days: impl Into<u32>) -> Self

認証状態が失効するまでの日数

Source

pub fn metadata(self, metadata: impl Into<Value>) -> Self

キーバリューの任意データ

Source

pub fn platform_fee(self, platform_fee: impl Into<i64>) -> Self

PAY.JP Platform のみ設定可能

プラットフォーマーに振り分けられる入金金額。

Source

pub fn product(self, product: impl Into<String>) -> Self

プロダクトID

Source

pub fn tenant(self, tenant: impl Into<String>) -> Self

PAY.JP Platform のみ設定可能

テナントID

Source

pub fn three_d_secure(self, three_d_secure: impl Into<bool>) -> Self

3Dセキュアを行うならtrue

Source§

impl CreateCharge

Source

pub async fn send<C: PayjpClient>( &self, client: &C, ) -> Result<<Self as PayjpRequest>::Output, C::Err>

Send the request and return the deserialized response.

Source

pub fn send_blocking<C: BlockingClient>( &self, client: &C, ) -> Result<<Self as PayjpRequest>::Output, C::Err>

Send the request and return the deserialized response, blocking until completion.

Trait Implementations§

Source§

impl Clone for CreateCharge

Source§

fn clone(&self) -> CreateCharge

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CreateCharge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CreateCharge

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PayjpRequest for CreateCharge

Source§

type Output = Charge

The data returned from the eventual API call.
Source§

fn build(&self) -> RequestBuilder

Convert the struct into library-agnostic data that can be used by compatible clients to make API calls.
Source§

fn customize(&self) -> CustomizablePayjpRequest<Self::Output>

Convert to a builder allowing per-request customization.
Source§

impl Serialize for CreateCharge

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more