opensocial.Payment


Method

opensocial.newPayment

Generates Payment object.

Parameter

Name

Type

Description

params

Map.

Additional parameters passed on to requests

Return value

Type

Description

opensocial.Payment

New Payment object

Sample

opensocial.newBillingItem

Generates BillingItem object.

Parameter

Name

Type

Description

params

Map.<opensocial.BillingItem.Field|Object>

Additional parameters passed on to requests

Return value

Type

Description

opensocial.BillingItem

New BillingItem object.

Sample

opensocial.requestPayment

Makes a request to create the specified activity without waiting for the operation to be completed.

Parameter

Name

Type

Description

payment

opensocial.Payment

Payment object

opt_callback

Function

The callback function that is called when the request is complete.

Return value

None

Sample

opensocial.requestPaymentRecords

Not supported.

opensocial.Payment.isPayment

Returns "True" when this Payment object type is PAYMENT.

Parameter

None

Return value

Type

Description

Boolean

"True" when this Payment type is PAYMENT; otherwise, it is "False".

Sample

opensocial.Payment.isCredit

Returns "True" when this Payment object type is CREDIT.

Parameter

None

Return value

Type

Description

Boolean

"True" when this Payment type is CREDIT; otherwise, it is "False".

Sample

opensocial.Payment.isComplete

Returns "True" when the PAYMENT_COMPLETE field of this Payment object is set.

Parameter

None

Return value

Type

Description

Boolean

"True" when this Payment is complete; otherwise, it is "False".

Sample

opensocial.Payment.getField

Acquires data for the Payment linked to the specified key.

Parameter

Name

Type

Description

key

String

Key for acquiring data. Refer to the Field class for possible values

opt_params

Map.<opensocial.DataRequest.DataRequestFields|Object>

Additional parameters passed on to requests

Return value

Type

Description

String

Data

Sample

opensocial.Payment.setField

Sets data in the Payment with the specified key.

Parameter

Name

Type

Description

key

String

The key to set in data

String

String

The data to set

Return value

None

Sample

opensocial.Payment.Field

opensocial.Payment.Field.SANDBOX

In a Sandbox environment, "True" is placed in this value.

opensocial.Payment.Field.ITEMS

A list of items included in this settlement. BillingItem is specified with an array. Currently, only one can be specified. This is a required value.

opensocial.Payment.Field.AMOUNT

The total amount of this settlement. It is specified using a positive integer. This is a required value.

opensocial.Payment.Field.MESSAGE

Currently not supported.

opensocial.Payment.Field.ATTACHMENT

Currently not supported.

opensocial.Payment.Field.PAYMENT_TYPE

A type of Payment object. It is specified with opensocial.Payment.PaymentType. Only opensocial.Payment.PaymentType.PAYMENT can be specified.

opensocial.Payment.Field.ORDER_ID

A unique settlement ID in an Application. It is a positive integer.

opensocial.Payment.Field.ORDER_TIME

The time at which settlement was requested. It is shown in milliseconds from epoch. Since this value is generated by the browser, it is not necessarily correct. It is used as a reference in the log.

opensocial.Payment.Field.SUBMITTED_TIME

The time at which the user permitted the settlement. It is shown in milliseconds from epoch. Since this value is generated by the browser, it is not necessarily correct. It is used as a reference in the log.

opensocial.Payment.Field.EXECUTED_TIME

The time at which the Coin was withdrawn. It is shown in milliseconds from epoch.

opensocial.Payment.Field.RESPONSE_CODE

Response code for the settlement. It specifies "OK" when there is no error.

opensocial.Payment.Field.RESPONSE_MESSAGE

Explanation of a readable response. NULL is permitted.

opensocial.Payment.Field.PAYMENT_COMPLETE

Boolean value that indicates whether or not the settlement is complete.

mbga.Payment.Field

mbga.Payment.Field.PAYMENT_ID

A unique settlement ID in Mobage.

opensocial.PaymentType

opensocial.PaymentType.PAYMENT

Regular Coin Payment type.

opensocial.PaymentType.CREDIT

Not supported.

opensocial.Payment.ResponseCode

opensocial.Payment.ResponseCode.APP_LOGIC_ERROR

Specify this status if an error has occurred on an Application server due to a logic problem.

opensocial.Payment.ResponseCode.LOGIC_ERROR

opensocial.Payment.ResponseCode.APP_NETWORK_FAILURE

Returns this status when a problem occurs, such as when the payment handler URL is not set or cannot be connected to, or a timeout has occurred.

opensocial.Payment.ResponseCode.INSUFFICIENT_MONEY

opensocial.Payment.ResponseCode.INVALID_TOKEN

opensocial.Payment.ResponseCode.MALFORMED_REQUEST

Returns this status when the request is incorrect.

opensocial.Payment.ResponseCode.NOT_IMPLEMENTED

opensocial.Payment.ResponseCode.OK

A normal response.

opensocial.Payment.ResponseCode.PAYMENT_ERROR

Returns this error when there is a problem with the settlement.

opensocial.Payment.ResponseCode.PAYMENT_PROCESSOR_ALREADY_OPENED

opensocial.Payment.ResponseCode.UNKNOWN_ERROR

opensocial.Payment.ResponseCode.USER_CANCELLED

Returns this status when the user cancels.

opensocial.Payment.RecordsRequestFields

opensocial.Payment.RecordsRequestFields.TYPE

opensocial.Payment.RecordsRequestFields.IS_COMPLETE

opensocial.Payment.RecordsRequestFields.MAX

opensocial.Payment.RecordsRequestFields.START_TIME

Revision History

  • 12/2010
    • Initial Release.

PREVIOUS

opensocial.Url

NEXT

opensocial.BillingItem