|
GoldMoney - Automated Batch Payments | | | | You can automatically make a single payment or multiple payments from your Holding (without manually logging into your Holding) by performing the following steps: Write a script or program, for example using PERL, PHP or Visual Basic, that will create text consisting of a single line in the following format (shown here across multiple lines for readability): PMT <TAB> <holding_number> <TAB> <passphrase> <TAB> <reference_number> <NEWLINE> where: - PMT = the name of the service being requested (PMT indicates a single payment or multiple payments);
- <holding_number> = the number of your Holding in the format XX-XX-XX-X;
- <passphrase> = the current passphrase of your Holding;
- <reference_number> = an optional reference number that the GoldMoney system will include in the response;
- <TAB> = the TAB character (ASCII 0x09).
- <NEWLINE> = the newline/linefeed character (ASCII 0x0a).
Then, immediately following the above line, for each payment you want to make, a line in the following format (once again shown across multiple lines for readability): <holding_number_to_pay> <TAB> <amount> <TAB> <currency_id_from> <TAB> <currency_id_to> <TAB> <vault_id> <TAB> <memo> <NEWLINE> where: - <holding_number_to_pay> = the number of the Holding to pay in the format XX-XX-XX-X;
- <amount> = the amount to pay, either expressed in terms of <currency_id_from> or <currency_id_to> (see below);
- <currency_id_from> = the numeric identifier of the currency that you want to perform a conversion with prior to payment The value of this field must either be identical to <currency_id_to>, or it can be set to one of the following to perform a currency conversion with:
- 124 - Canadian dollars
- 392 - Japanese yen
- 756 - Swiss francs
- 826 - British pounds
- 840 - US dollars
- 978 - euros
If set to one of the above currency identifiers, the GoldMoney system will convert <amount> from <currency_id_from> to <currency_id_to> using the prevailing conversion rate, and use the result as the amount of the payment. If <currency_id_from> and <currency_id_to> have the same value, then the system will perform no conversion and the payment amount will be set to exactly <amount>; - <currency_id_to> = the numeric identifier of the metal that you want to pay:
- 0 - GoldGrams
- 1000 - Silver ounces
- <vault_id> = the numeric identifier of the vault in which you want to make a payment:
- 1 - VIA MAT London
- 2 - VIA MAT Zurich
- <memo> = a memo to associate with the payment (optional);
- <TAB> = the TAB character (ASCII 0x09).
- <NEWLINE> = the newline/linefeed character (ASCII 0x0a).
| Programmatically submit the text, as an HTML form field using the HTTP POST method, to the following URL: https://secure.goldmoney.com/user/auto.php Prior to submission, you must also explicitly set/override the Content-Type field in the HTTP header to application/x-www-form-urlencoded. Various libraries exist that enable you to programmatically send HTTP messages and override HTTP headers, for example cURL (Linux) and MSINET (Microsoft). Depending on which library you use, you may need to explicitly construct the entire HTTP message header in your program (you do not need to do this when using cURL or MSINET). Furthermore, the name of the HTML form field that contains the populated template must be set to either GM_AUTO or to gm_auto. | Interpret the result that is returned by the GoldMoney system. The output from the service will always be enclosed in a set of <pre> </pre> tags. If any error occurred, the output will contain an error message which will always be prefixed with [ERROR]<TAB>. The GoldMoney system will attempt to execute each payment contained in the request (regardless of whether a previous payment failed, if any). The response will indicate, for each payment, whether it was successful or not. The service will indicate payment-specific errors by prefixing each failed payment with [i][ERROR]<TAB>, where [i] will indicate the row number (as per the request) of the payment that failed. |
| |