You are looking at the HTML representation of the XML format.
HTML is good for debugging, but probably is not suitable for your application.
See complete documentation, or API help for more information.
<?xml version="1.0"?>
<api>
  <query-continue>
    <allpages gapfrom="Requested minimum modification lies too far in the past" />
  </query-continue>
  <query>
    <pages>
      <page pageid="360" ns="0" title="Re-paste Script Steps">
        <revisions>
          <rev xml:space="preserve">For a quick way to re-paste script steps, see the video here:

[https://youtu.be/I7xWVv8B44w Re-paste Script Steps]</rev>
        </revisions>
      </page>
      <page pageid="225" ns="0" title="RealEx">
        <revisions>
          <rev xml:space="preserve">==Working with Plug-ins==

Plastic 2 is a plug-in for FileMaker Pro and FileMaker Server that processes secure payments within FileMaker.

{{Template:Plugin Basics}}

==RealEx==

RealEx supports running charges, authorizations and captures, and payment profiles.  For detailed examples of each of these transactions, check the demo file included as a download with Plastic 2. These scripts are ready for insertion into your own solution!

=== Getting an account ===

You'll need an account using the [http://www.realexpayments.com/home RealEx Gateway], and use your '''merchant ID''' and the '''account name''' as the first two parameters for every plug-in function call that performs a transaction. You'll also need the shared secret, provided by RealEx, provided as an additional but required parameter. In the function signature template, you may see the terms ''merchant account name'' and ''transaction key'' instead of merchant ID and account name. This is due to the fact that Plastic 2 supports many gateways that use different definitions of log-in credentials. 

 Set Variable [ $result; Value:
 CCProcessPayment (
 merchantID;
 accountName;
 &quot;sharedSecret=shh&quot; ...) ]

=== Setting the Gateway ===

Before processing any payments, you need to tell Plastic which gateway you are using. This is done by calling CCSetGateway.

 Set Variable [$gateway; Value:CCSetGateway(&quot;RealEx&quot;)

'''Returns''': 1 if a valid gateway is provided, &quot;ERROR&quot; on failure.

If running card present charges, you should also set cardPresent to true when setting the gateway.

&lt;pre&gt;Set Variable [$gateway; Value:CCSetGateway(&quot;RealEx&quot;; &quot;cardPresent=true&quot;)]&lt;/pre&gt;

===Test Mode===

{{Template:Test Mode}}

{{Template:Emulators}}

==Processing Payments==

===Basic Credit Card Charge===

This simple example will run a single charge and requires you to input a card number and expiration date. To prevent this information from being saved in your database and to simplify PCI compliance, jump to the [[#Payment Profiles]] section.

Once you properly configure your merchant account, you can quickly and easily process payment transactions.
You must provide the following information for a credit card payment transaction:

*merchant ID
*account name
*dollar amount
*credit card number
*credit card expiration date (Format the expiration date as MMYY or MM/YY or MM/DD/YY)
*shared secret
*order ID

The CCProcessPayment function will process a transaction and return a transaction ID. This function returns a transaction ID if the transaction is successful or the word ERROR if the transaction fails. For detailed information about the most recent transaction failure, call the CCLastError function before calling any other transaction-processing function.

In your script, you would then have a second line after setting the gateway.
&lt;pre&gt;Set Variable [$result Value: 
CCProcessPayment(
merchantId;
accountName;
chargeAmount;
cardNumber;
expDate;
&quot;sharedSecret=&quot;;
&quot;orderId=&quot;)]
&lt;/pre&gt; 

'''Returns''': a verification code from the payment gateway service if the order is successful, or &quot;ERROR&quot; if there was a problem 

'''Note''': It is important to store the resulting transaction ID because you may need it later to void the transaction, issue a refund or capture a previously authorized transaction.

You may submit optional parameters to most of Plastic's payment-transaction processing functions. These parameters will be submitted to the payment gateway along with the basic transaction information. Although they are not usually required to process an order, these parameters can be useful for tasks such as address verification or linking a transaction to a customer id or an invoice number. To supply additional parameters to a function call, add them to the end of the parameter list after the last required parameter, using a &quot;key=value&quot; syntax.

 Set Variable $result Value:
 CCProcessPayment(
 merchantId,
 accountName;
 chargeAmount;
 cardNumber;
 expDate;
 &quot;sharedSecret=&quot;;
 &quot;orderId=&quot;;
 &quot;chargeDescription=&quot; &amp; Payment::description;
 &quot;verificationCode=&quot; &amp; $securityCode)

&lt;center&gt;&lt;big&gt;Click Expand to see the list of optional parameters:&lt;/big&gt;

{| class=&quot;wikitable mw-collapsible mw-collapsed&quot;
! Parameter
! Description
|-
|verificationCode	
|the numeric verification code on the credit card. This is also known as Card Security Code (CSC), Card Verification Value (CVV), Card Verification Value Code (CVVC), Card Verification Code (CVC) or Verification Code (V-Code/V Code)
|-
|chargeDescription	
|brief description of the charges
|-
|customerId	
|an arbitrary customer ID for your records
|-
|firstName	
|First (given) name of the credit card holder
|-
|lastName	
|Last (surname) of the credit card holder
|-
|address
|the billing address
|-
|zip	
|the billing address zip
|-
|country	 
|billing address country
|-
|shipAddress	
|the shipping street address
|-
|shipZip	
|the shipping address zip
|-
|shipCountry	 
|the shipping address country
|-
|currency	 
|the type of currency
|-
|card type	
|the type of card used
|}
&lt;/center&gt;

===Authorizing and Capturing Payments===

Use '''CCProcessAuthorizedPayment'''. Normally, you would also pass in a dollarAmount as the final variable, but this is not required in RealEx. Instead, use &quot;&quot;; for the final parameter and add the sharedSecret and orderID.

&lt;pre&gt;Set Variable $result Value: 
CCProcessAuthorizedPayment(
merchantId, 
accountName;
previousTransactionId;
&quot;&quot;;
&quot;sharedSecret=&quot;;
&quot;orderId=&quot;)
&lt;/pre&gt;


=== Voiding Transactions ===

&lt;pre&gt;
Set Variable [$result; Value: 
CCVoidPayment ( 
merchantId ;
accountName ; 
previousTransactionID;
&quot;sharedSecret=&quot;;
&quot;orderId=&quot;)]
&lt;/pre&gt; 

'''Returns''': 1 on success, or &quot;ERROR&quot; if there was a problem.

Voids a previously processed payment. The parameters are similar to the CCProcessPayment function, except dollarAmount is replaced with the addition of the previousTransactionID parameter. The previousTransactionID should be the transaction ID of the transaction you wish to void. This value is returned by the CCProcessPayment function. Alternately, you can use the CCLastPaymentTransactionID function to get the transactionID of the last processed payment.

Note that CCVoidPayment will only work on orders that have not settled yet, which means that it will generally only work on payments made that same day. To void settled orders, use CCRefund instead.

See also: CCLastPaymentTransactionID, which returns the transactionID from the payment gateway service if the order is successful, or &quot;ERROR&quot; if there was a problem (use CCLastError for more detailed information about the nature of the error).

Optionally, you can also pass in a chargeDescription.

=== Crediting or Refunding Transactions ===

To credit a transaction, you need the transaction ID returned by CCProcessPayment. Pass this (along with other payment info and the refund password) to the CCRefund function. This is similar to the void process, except it accepts a dollar amount and the credit card number (or the last four digits of the credit card number) used to process the original transaction.

&lt;pre&gt;
Set Variable [$result; Value:
CCRefund( 
merchantId; 
accountName; 
transactionID; 
cardNumber; 
dollarAmount;
&quot;sharedSecret=&quot;;
&quot;refundPassword=&quot;;
&quot;orderId=&quot; &lt;/pre&gt;

'''Returns''': 1 on success, or &quot;ERROR&quot; if there was a problem.

You can also pass in a chargeDescription and currency as optional parameters.

== Payment Profiles ==

=== Creating Customer Profiles===

Profiles save payment and customer data straight to the gateway securely for future use. To create a customer profile, call '''CCProfileCreateCustomer'''. After creation, update the customer information with '''CCProfileUpdateCustomer'''. Create your own customer ID for use with RealEx and pass it to customerId with creation. After that, use that same ID in the customerProfileId on update.

{| class=&quot;wikitable&quot;
| &lt;big&gt;CCProfileCreateCustomer&lt;/big&gt;|| &lt;big&gt;CCProfileUpdateCustomer&lt;/big&gt;
|-
|merchantId||merchantId
|-
|accountName||accountName
|-
|customerId||&quot;&quot;;
|-
|&quot;sharedSecret=&quot;||customerProfileId
|-
|&quot;orderId=&quot;||&quot;sharedSecret=&quot;
|-
|||&quot;orderId=&quot;
|}

&lt;center&gt;&lt;big&gt;Click Expand to see the list of optional parameters:&lt;/big&gt;

{| class=&quot;wikitable mw-collapsible mw-collapsed&quot;
!Parameter
|-
|profileDescription||firstName
|-
|lastName||companyName
|-
|email || phone
|-
|fax || address
|-
|address2||city
|-
|zip||country
|-
|colspan=&quot;2&quot;|countryCode - if you provide a country name, you must also add the ISO country code.
|}
&lt;/center&gt;

'''Returns''': 1 on success, or &quot;ERROR&quot; if there was a problem.

{{Template:Profiles}}

=== Creating Payment Profiles===

To create a payment, use '''CCProfileCreatePayment'''. You can also update the payment method with '''CCProfileUpdatePayment'''. Both also accept &quot;cardType=&quot; as an optional parameter.

{| class=&quot;wikitable&quot;
| &lt;big&gt;CCProfileCreatePayment&lt;/big&gt;|| &lt;big&gt;CCProfileUpdatePayment&lt;/big&gt;
|-
|merchantId||merchantId
|-
|accountName||accountName
|-
|customerProfileId||customerProfileId
|-
|cardNumber||paymentProfileId
|-
|expirationDate||''cardNumber''
|-
|&quot;sharedSecret=&quot;||expirationDate
|-
|&quot;orderId=&quot;||&quot;sharedSecret=&quot;
|-
|&quot;paymentProfileId=&quot;||&quot;firstName=&quot;
|-
|&quot;firstName=&quot;||&quot;lastName=&quot;
|-
|&quot;lastName=&quot;||
|}

'''Returns''': 1 on success, or &quot;ERROR&quot; if there was a problem.

After creation, payments can be deleted with '''CCProfileDeletePayment'''.

{| class=&quot;wikitable&quot;
| &lt;big&gt;CCProfileDeletePayment&lt;/big&gt;
|-
|merchantId
|-
|accountName
|-
|customerProfileId
|-
|paymentProfileId;
|-
|&quot;sharedSecret=&quot;
|}

'''Returns''': 1 on success, or &quot;ERROR&quot; if there was a problem.

=== Running Charges Against Profiles ===

You can process a payment or refund a payment using this payment profile. Items in bold are required.

{| class=&quot;wikitable&quot;
| &lt;big&gt;CCProfileProcessPayment&lt;/big&gt;
| &lt;big&gt; CCProfileRefund &lt;/big&gt;
|-
|merchantId||merchantId
|-
|accountName||accountName
|-
|customerProfileId||customerProfileId
|-
|paymentProfileId||paymentProfileId
|-
|dollarAmount||previousTransactionId
|-
|sharedSecret=&quot;||amountToCredit
|-
|&quot;orderId=&quot;||&quot;&quot;;
|-
|||&quot;sharedSecret=&quot;
|-
|||&quot;orderId=&quot;
|-
|||&quot;refundPassword=&quot;
|}

'''Returns''': a transaction ID from the payment gateway service if the transaction is successful, or &quot;ERROR&quot; if there was a problem

CCProfileProcessPayment and CCProfileRefund accept the following parameters as well:

{| class=&quot;wikitable mw-collapsible mw-collapsed&quot;
! Parameter
! Description
|-
|verificationCode (only payment, not refunds)||currency
|-
|chargeDescription||customerId
|-
|address||zip
|-
|country||shipAddress
|-
|shipZip||shipCountry
|}

==Getting Information==

{{Template:Getting information}}

== Getting Help ==

{{Template:Getting Help}}</rev>
        </revisions>
      </page>
    </pages>
  </query>
</api>