创建条带订阅后无法获取订阅详细信息?

时间:2016-04-14 22:29:28

标签: php stripe-payments

我正在创建Stripe订阅,我得到了回复。但是如何从响应中访问订阅详细信息?。

示例回复:

Stripe\ Customer Object

(     [_opts:protected] => Stripe \ Util \ RequestOptions对象(       [headers] =>阵列()

  [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
)

[_values: protected] => Array(
  [id] => cus_8GpbEwsWw1nfKU[object] => customer[account_balance] => 0[business_vat_id] => [cards] => Stripe\ Collection Object(
    [_requestParams: protected] => Array()

    [_opts: protected] => Stripe\ Util\ RequestOptions Object(
      [headers] => Array()

      [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
    )

    [_values: protected] => Array(
      [object] => list[count] => 1[data] => Array(
        [0] => Stripe\ Card Object(
          [_opts: protected] => Stripe\ Util\ RequestOptions Object(
            [headers] => Array()

            [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
          )

          [_values: protected] => Array(
            [id] => card_180HwL2ie8Vd7bbN0ZGGkGIj[object] => card[address_city] => [address_country] => [address_line1] => [address_line1_check] => [address_line2] => [address_state] => [address_zip] => [address_zip_check] => [brand] => Visa[country] => US[customer] => cus_8GpbEwsWw1nfKU[cvc_check] => [dynamic_last4] => [exp_month] => 10[exp_year] => 2017[fingerprint] => O4swH5j9BSbBV0T5[funding] => credit[last4] => 4242[metadata] => Stripe\ AttachedObject Object(
              [_opts: protected] => Stripe\ Util\ RequestOptions Object(
                [headers] => Array()

                [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
              )

              [_values: protected] => Array()

              [_unsavedValues: protected] => Stripe\ Util\ Set Object(
                [_elts: Stripe\ Util\ Set: private] => Array()

              )

              [_transientValues: protected] => Stripe\ Util\ Set Object(
                [_elts: Stripe\ Util\ Set: private] => Array()

              )

              [_retrieveOptions: protected] => Array()

              [_lastResponse: protected] =>
            )

            [name] => [tokenization_method] => [type] => Visa
          )

          [_unsavedValues: protected] => Stripe\ Util\ Set Object(
            [_elts: Stripe\ Util\ Set: private] => Array()

          )

          [_transientValues: protected] => Stripe\ Util\ Set Object(
            [_elts: Stripe\ Util\ Set: private] => Array()

          )

          [_retrieveOptions: protected] => Array()

          [_lastResponse: protected] =>
        )

      )

      [has_more] => [total_count] => 1[url] => /v1/customers / cus_8GpbEwsWw1nfKU / cards
    )

    [_unsavedValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_transientValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_retrieveOptions: protected] => Array()

    [_lastResponse: protected] =>
  )

  [created] => 1460669034[currency] => [default_card] => card_180HwL2ie8Vd7bbN0ZGGkGIj[default_source] => card_180HwL2ie8Vd7bbN0ZGGkGIj[delinquent] => [description] => Subscription
  for [discount] => [email] => [livemode] => [metadata] => Stripe\ AttachedObject Object(
    [_opts: protected] => Stripe\ Util\ RequestOptions Object(
      [headers] => Array()

      [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
    )

    [_values: protected] => Array()

    [_unsavedValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_transientValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_retrieveOptions: protected] => Array()

    [_lastResponse: protected] =>
  )

  [shipping] => [sources] => Stripe\ Collection Object(
    [_requestParams: protected] => Array()

    [_opts: protected] => Stripe\ Util\ RequestOptions Object(
      [headers] => Array()

      [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
    )

    [_values: protected] => Array(
      [object] => list[count] => 1[data] => Array(
        [0] => Stripe\ Card Object(
          [_opts: protected] => Stripe\ Util\ RequestOptions Object(
            [headers] => Array()

            [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
          )

          [_values: protected] => Array(
            [id] => card_180HwL2ie8Vd7bbN0ZGGkGIj[object] => card[address_city] => [address_country] => [address_line1] => [address_line1_check] => [address_line2] => [address_state] => [address_zip] => [address_zip_check] => [brand] => Visa[country] => US[customer] => cus_8GpbEwsWw1nfKU[cvc_check] => [dynamic_last4] => [exp_month] => 10[exp_year] => 2017[fingerprint] => O4swH5j9BSbBV0T5[funding] => credit[last4] => 4242[metadata] => Stripe\ AttachedObject Object(
              [_opts: protected] => Stripe\ Util\ RequestOptions Object(
                [headers] => Array()

                [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
              )

              [_values: protected] => Array()

              [_unsavedValues: protected] => Stripe\ Util\ Set Object(
                [_elts: Stripe\ Util\ Set: private] => Array()

              )

              [_transientValues: protected] => Stripe\ Util\ Set Object(
                [_elts: Stripe\ Util\ Set: private] => Array()

              )

              [_retrieveOptions: protected] => Array()

              [_lastResponse: protected] =>
            )

            [name] => [tokenization_method] => [type] => Visa
          )

          [_unsavedValues: protected] => Stripe\ Util\ Set Object(
            [_elts: Stripe\ Util\ Set: private] => Array()

          )

          [_transientValues: protected] => Stripe\ Util\ Set Object(
            [_elts: Stripe\ Util\ Set: private] => Array()

          )

          [_retrieveOptions: protected] => Array()

          [_lastResponse: protected] =>
        )

      )

      [has_more] => [total_count] => 1[url] => /v1/customers / cus_8GpbEwsWw1nfKU / sources
    )

    [_unsavedValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_transientValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_retrieveOptions: protected] => Array()

    [_lastResponse: protected] =>
  )

  [subscriptions] => Stripe\ Collection Object(
    [_requestParams: protected] => Array(
      [plan] => 1
    )

    [_opts: protected] => Stripe\ Util\ RequestOptions Object(
      [headers] => Array()

      [apiKey] => sk_test_BgBaz8P4HyNwRyFsEKYk9FtU
    )

    [_values: protected] => Array(
      [object] => list[count] => 0[data] => Array()

      [has_more] => [total_count] => 0[url] => /v1/customers / cus_8GpbEwsWw1nfKU / subscriptions
    )

    [_unsavedValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_transientValues: protected] => Stripe\ Util\ Set Object(
      [_elts: Stripe\ Util\ Set: private] => Array()

    )

    [_retrieveOptions: protected] => Array()

    [_lastResponse: protected] => Stripe\ ApiResponse Object(
      [headers] => Array(
        [Server] => nginx[Date] => Thu, 14 Apr 2016 21: 23: 57 GMT[Content - Type] => application / json[Content - Length] => 794[Connection] => keep - alive[Access - Control - Allow - Credentials] => true[Access - Control - Allow - Methods] => GET, POST, HEAD, OPTIONS, DELETE[Access - Control - Allow - Origin] => * [Access - Control - Max - Age] => 300[Cache - Control] => no - cache, no - store[Request - Id] => req_8GpbLFRu1q4mUN[Stripe - Version] => 2014 - 01 - 31[Strict - Transport - Security] => max - age = 31556926; includeSubDomains
      )

      [body] => {
        "id": "sub_8GpbKUITP6fByi",
        "object": "subscription",
        "application_fee_percent": null,
        "cancel_at_period_end": false,
        "canceled_at": null,
        "current_period_end": 1463261036,
        "current_period_start": 1460669036,
        "customer": "cus_8GpbEwsWw1nfKU",
        "discount": null,
        "ended_at": null,
        "metadata": {},
        "plan": {
          "id": "1",
          "object": "plan",
          "amount": 1000,
          "created": 1460626310,
          "currency": "usd",
          "interval": "month",
          "interval_count": 1,
          "livemode": false,
          "metadata": {},
          "name": "Stripe Plan 1",
          "statement_descriptor": null,
          "trial_period_days": null,
          "statement_description": null
        },
        "quantity": 1,
        "start": 1460669036,
        "status": "active",
        "tax_percent": null,
        "trial_end": null,
        "trial_start": null
      }

      [json] => Array(
        [id] => sub_8GpbKUITP6fByi[object] => subscription[application_fee_percent] => [cancel_at_period_end] => [canceled_at] => [current_period_end] => 1463261036[current_period_start] => 1460669036[customer] => cus_8GpbEwsWw1nfKU[discount] => [ended_at] => [metadata] => Array()

        [plan] => Array(
          [id] => 1[object] => plan[amount] => 1000[created] => 1460626310[currency] => usd[interval] => month[interval_count] => 1[livemode] => [metadata] => Array()

          [name] => Stripe Plan 1[statement_descriptor] => [trial_period_days] => [statement_description] =>
        )

        [quantity] => 1[start] => 1460669036[status] => active[tax_percent] => [trial_end] => [trial_start] =>
      )

      [code] => 200
    )

  )

)

[_unsavedValues: protected] => Stripe\ Util\ Set Object(
  [_elts: Stripe\ Util\ Set: private] => Array()

)

[_transientValues: protected] => Stripe\ Util\ Set Object(
  [_elts: Stripe\ Util\ Set: private] => Array()

)

[_retrieveOptions: protected] => Array()

[_lastResponse: protected] => Stripe\ ApiResponse Object(
  [headers] => Array(
    [Server] => nginx[Date] => Thu, 14 Apr 2016 21: 23: 55 GMT[Content - Type] => application / json[Content - Length] => 2451[Connection] => keep - alive[Access - Control - Allow - Credentials] => true[Access - Control - Allow - Methods] => GET, POST, HEAD, OPTIONS, DELETE[Access - Control - Allow - Origin] => * [Access - Control - Max - Age] => 300[Cache - Control] => no - cache, no - store[Request - Id] => req_8GpbT9mYOFxEJn[Stripe - Version] => 2014 - 01 - 31[Strict - Transport - Security] => max - age = 31556926; includeSubDomains
  )

  [body] => {
    "id": "cus_8GpbEwsWw1nfKU",
    "object": "customer",
    "account_balance": 0,
    "business_vat_id": null,
    "cards": {
      "object": "list",
      "count": 1,
      "data": [{
        "id": "card_180HwL2ie8Vd7bbN0ZGGkGIj",
        "object": "card",
        "address_city": null,
        "address_country": null,
        "address_line1": null,
        "address_line1_check": null,
        "address_line2": null,
        "address_state": null,
        "address_zip": null,
        "address_zip_check": null,
        "brand": "Visa",
        "country": "US",
        "customer": "cus_8GpbEwsWw1nfKU",
        "cvc_check": null,
        "dynamic_last4": null,
        "exp_month": 10,
        "exp_year": 2017,
        "fingerprint": "O4swH5j9BSbBV0T5",
        "funding": "credit",
        "last4": "4242",
        "metadata": {},
        "name": null,
        "tokenization_method": null,
        "type": "Visa"
      }],
      "has_more": false,
      "total_count": 1,
      "url": "/v1/customers/cus_8GpbEwsWw1nfKU/cards"
    },
    "created": 1460669034,
    "currency": null,
    "default_card": "card_180HwL2ie8Vd7bbN0ZGGkGIj",
    "default_source": "card_180HwL2ie8Vd7bbN0ZGGkGIj",
    "delinquent": false,
    "description": "Subscription for ",
    "discount": null,
    "email": null,
    "livemode": false,
    "metadata": {},
    "shipping": null,
    "sources": {
      "object": "list",
      "count": 1,
      "data": [{
        "id": "card_180HwL2ie8Vd7bbN0ZGGkGIj",
        "object": "card",
        "address_city": null,
        "address_country": null,
        "address_line1": null,
        "address_line1_check": null,
        "address_line2": null,
        "address_state": null,
        "address_zip": null,
        "address_zip_check": null,
        "brand": "Visa",
        "country": "US",
        "customer": "cus_8GpbEwsWw1nfKU",
        "cvc_check": null,
        "dynamic_last4": null,
        "exp_month": 10,
        "exp_year": 2017,
        "fingerprint": "O4swH5j9BSbBV0T5",
        "funding": "credit",
        "last4": "4242",
        "metadata": {},
        "name": null,
        "tokenization_method": null,
        "type": "Visa"
      }],
      "has_more": false,
      "total_count": 1,
      "url": "/v1/customers/cus_8GpbEwsWw1nfKU/sources"
    },
    "subscriptions": {
      "object": "list",
      "count": 0,
      "data": [],
      "has_more": false,
      "total_count": 0,
      "url": "/v1/customers/cus_8GpbEwsWw1nfKU/subscriptions"
    }
  }

  [json] => Array(
    [id] => cus_8GpbEwsWw1nfKU[object] => customer[account_balance] => 0[business_vat_id] => [cards] => Array(
      [object] => list[count] => 1[data] => Array(
        [0] => Array(
          [id] => card_180HwL2ie8Vd7bbN0ZGGkGIj[object] => card[address_city] => [address_country] => [address_line1] => [address_line1_check] => [address_line2] => [address_state] => [address_zip] => [address_zip_check] => [brand] => Visa[country] => US[customer] => cus_8GpbEwsWw1nfKU[cvc_check] => [dynamic_last4] => [exp_month] => 10[exp_year] => 2017[fingerprint] => O4swH5j9BSbBV0T5[funding] => credit[last4] => 4242[metadata] => Array()

          [name] => [tokenization_method] => [type] => Visa
        )

      )

      [has_more] => [total_count] => 1[url] => /v1/customers / cus_8GpbEwsWw1nfKU / cards
    )

    [created] => 1460669034[currency] => [default_card] => card_180HwL2ie8Vd7bbN0ZGGkGIj[default_source] => card_180HwL2ie8Vd7bbN0ZGGkGIj[delinquent] => [description] => Subscription
    for [discount] => [email] => [livemode] => [metadata] => Array()

    [shipping] => [sources] => Array(
      [object] => list[count] => 1[data] => Array(
        [0] => Array(
          [id] => card_180HwL2ie8Vd7bbN0ZGGkGIj[object] => card[address_city] => [address_country] => [address_line1] => [address_line1_check] => [address_line2] => [address_state] => [address_zip] => [address_zip_check] => [brand] => Visa[country] => US[customer] => cus_8GpbEwsWw1nfKU[cvc_check] => [dynamic_last4] => [exp_month] => 10[exp_year] => 2017[fingerprint] => O4swH5j9BSbBV0T5[funding] => credit[last4] => 4242[metadata] => Array()

          [name] => [tokenization_method] => [type] => Visa
        )

      )

      [has_more] => [total_count] => 1[url] => /v1/customers / cus_8GpbEwsWw1nfKU / sources
    )

    [subscriptions] => Array(
      [object] => list[count] => 0[data] => Array()

      [has_more] => [total_count] => 0[url] => /v1/customers / cus_8GpbEwsWw1nfKU / subscriptions
    )

  )

  [code] => 200
)

0 个答案:

没有答案