This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Payment Methods in Zuora
Overview
The following operations allow you to work with payment methods. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with transactions, see Sample configuration.
Operation | Description |
---|---|
Create a new credit card payment method | |
getPayments
| Retrieve all credit card information |
updatePayments
| Updates an existing credit card payment method |
deletePayments
| Deletes a credit card payment method |
Operation details
This section provides further details on the operations related to discussions.
Create Payments
The createPayments
operation creates a new credit card payment method for a customer account.
<zuora.createPayments> <accountKey>{$ctx:accountKey}</accountKey> <creditCardType>{$ctx:creditCardType}</creditCardType> <creditCardNumber>{$ctx:creditCardNumber}</creditCardNumber> <expirationMonth>{$ctx:expirationMonth}</expirationMonth> <expirationYear>{$ctx:expirationYear}</expirationYear> <securityCode>{$ctx:securityCode}</securityCode> <defaultPaymentMethod>{$ctx:defaultPaymentMethod}</defaultPaymentMethod> <cardHolderInfo>{$ctx:cardHolderInfo}</cardHolderInfo> </zuora.createPayments>
Properties
accountKey
:Required - The ID of the customer account to update.
creditCardType :Required -The type of the credit card.(Possible values are: Visa
, MasterCard
, AmericanExpress
, Discover
.)
creditCardNumber :Required -The credit card number, a string of up to 16 characters.
expirationMonth :Required -Two-digit expiration month (01-12)
expirationYear :Required -Four-digit expiration year
securityCode : The CVV or CVV2 security code for the credit card or debit card. Only required if changing expirationMonth,
expirationYear
, or cardHolderName
.
defaultPaymentMethod : The default payment method for a card, specify true
to make this card the default payment method.
cardHolderInfo :Container for cardholder information, If provided, Zuora will only use this information for this card. If not provided, Zuora will use the account's existing bill-to contact information for this card.
Sample request
Following is a sample REST/JSON request that can be handled by the createPayments
operation.
{ "apiUrl":"https://apisandbox-api.zuora.com/rest", "apiVersion":"v1", "apiAccessKeyId":"ZuoraTest@wso2.com", "apiSecretAccessKey":"ZuoraTest@wso2", "accountKey":"2c92c0fb523018ec01523584d37b30f1", "creditCardType":"Visa", "creditCardNumber":"4111111111111111", "expirationMonth":12, "expirationYear":2022, "securityCode":"123", "defaultPaymentMethod":true }
Related Zuora documentation
Get Payments
The
getPayments
operation retrieves all credit card information for the specified customer account.
<zuora.getPayments> <accountKey>{$ctx:accountKey}</accountKey> <pageSize>{$ctx:pageSize}</pageSize> </zuora.getPayments>
Properties
accountKey
:Required - The account number or account ID.
pageSize
: Number of rows to return. Maximum is 40; default is 20.
Sample request
Following is a sample REST/JSON request that can be handled by the getPayments
operation.
{ "apiUrl":"https://apisandbox-api.zuora.com/rest", "apiVersion":"v1", "apiAccessKeyId":"ZuoraTest@wso2.com", "apiSecretAccessKey":"ZuoraTest@wso2", "accountKey":"A00000812", "pageSize":1 }
Related Zuora documentation
Update Payments
The
updatePayments
operation updates an existing credit card payment method for the specified customer account.
<zuora.updatePayments> <paymentMethodId>{$ctx:paymentMethodId}</paymentMethodId> <expirationMonth>{$ctx:expirationMonth}</expirationMonth> <expirationYear>{$ctx:expirationYear}</expirationYear> <securityCode>{$ctx:securityCode}</securityCode> <defaultPaymentMethod>{$ctx:defaultPaymentMethod}</defaultPaymentMethod> <cardHolderName>{$ctx:cardHolderName}</cardHolderName> <addressLine1>{$ctx:addressLine1}</addressLine1> <addressLine2>{$ctx:addressLine2}</addressLine2> <city>{$ctx:city}</city> <zipCode>{$ctx:zipCode}</zipCode> <country>{$ctx:country}</country> <phone>{$ctx:phone}</phone> <email>{$ctx:email}</email> </zuora.updatePayments>
Properties
paymentMethodId
:Required -The unique ID of the payment method to update.
expirationMonth
:Two-digit expiration month (01-12).
expirationYear
: Four-digit expiration year.
securityCode
: The CVV or CVV2 security code for the credit card or debit card. Only required if changing expirationMonth
, expirationYear
, or cardHolderName
.
defaultPaymentMethod
: The default payment method for a card, specify true
to make this card the default payment method.
cardHolderName
: The full name as it appears on the card, 50 characters or less.
addressLine1
: First address line, 255 characters or less.
addressLine2
: Second address line, 255 characters or less.
city
: The city name, 40 characters or less.
zipCode
: The Zip code, 20 characters or less.
country
: The country name.
phone
: The Phone number, 40 characters or less.
email
: Card holder's email address, 80 characters or less.
Sample Request
Following is a sample REST/JSON request that can be handled by the
updatePayments
operation.
{ "apiUrl":"https://apisandbox-api.zuora.com/rest", "apiVersion":"v1", "apiAccessKeyId":"ZuoraTest@wso2.com", "apiSecretAccessKey":"ZuoraTest@wso2", "paymentMethodId":"2c92c0fb528220ae0152832323a71ca8", "expirationMonth": 12, "expirationYear": 2020, "securityCode": "123", "defaultPaymentMethod": false, "cardHolderName": "j.c", "addressLine1": "3400 Bridge Pkwy", "addressLine2": "#000", "city": "Colombo", "zipCode": "94000", "country": "United States", "phone": "+1(123)4567890", "email": "j.c@abc.com" }
Related Zuora documentation
Delete Payments
The
deletePayments
operation deletes a credit card payment method from the specified customer account.
<zuora.deletePayments> <paymentMethodId>{$ctx:paymentMethodId}</paymentMethodId> </zuora.deletePayments>
Properties
paymentMethodId
:Required -The unique ID of the payment method to delete.
Sample Request
Following is a sample REST/JSON request that can be handled by the
deletePayments
operation.
{ "apiUrl":"https://apisandbox-api.zuora.com/rest", "apiVersion":"v1", "apiAccessKeyId":"ZuoraTest@wso2.com", "apiSecretAccessKey":"ZuoraTest@wso2", "paymentMethodId":"2c92c0fa52399330015239c9fd7b05dd" }
Related Zuora documentation
Sample configuration
Following is a sample proxy service that illustrates how to connect to Zuora with the init
operation and use the
createPayments
operation.The sample request for this proxy can be found in createPayments sample request .
<proxy xmlns="http://ws.apache.org/ns/synapse" name="Zuora_Creat_Payments" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiVersion" expression="json-eval($.apiVersion)"/> <property name="apiAccessKeyId" expression="json-eval($.apiAccessKeyId)"/> <property name="apiSecretAccessKey" expression="json-eval($.apiSecretAccessKey)"/> <property name="accountKey" expression="json-eval($.accountKey)"/> <property name="creditCardType" expression="json-eval($.creditCardType)"/> <property name="creditCardNumber" expression="json-eval($.creditCardNumber)"/> <property name="expirationMonth" expression="json-eval($.expirationMonth)"/> <property name="expirationYear" expression="json-eval($.expirationYear)"/> <property name="securityCode" expression="json-eval($.securityCode)"/> <property name="defaultPaymentMethod" expression="json-eval($.defaultPaymentMethod)"/> <property name="cardHolderInfo" expression="json-eval($.cardHolderInfo)"/> <zuora.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiVersion>{$ctx:apiVersion}</apiVersion> <apiAccessKeyId>{$ctx:apiAccessKeyId}</apiAccessKeyId> <apiSecretAccessKey>{$ctx:apiSecretAccessKey}</apiSecretAccessKey> </zuora.init> <zuora.createPayments> <accountKey>{$ctx:accountKey}</accountKey> <creditCardType>{$ctx:creditCardType}</creditCardType> <creditCardNumber>{$ctx:creditCardNumber}</creditCardNumber> <expirationMonth>{$ctx:expirationMonth}</expirationMonth> <expirationYear>{$ctx:expirationYear}</expirationYear> <securityCode>{$ctx:securityCode}</securityCode> <defaultPaymentMethod>{$ctx:defaultPaymentMethod}</defaultPaymentMethod> <cardHolderInfo>{$ctx:cardHolderInfo}</cardHolderInfo> </zuora.createPayments> <respond/> </inSequence> </target> <description/> </proxy>